Program Planning document
Here is the template for the Program Planning Document
Assignment1
Description
This one we will do together
The purpose of this program is to calculate gas mileage and cost per mile.
Instructions
First we wll fill out the planning form, listing the outputs, the inputs and the steps to get from one to the other
Open a Visual Studio and start a new console application in C#.
At the top of the code page, enter a comment header with your name, the assignment number, the class time and the date. I will want this header at the top of every assignment
Write the code to fulfill the steps
Compile the code
Fix any compile errors
Test the code in according to to your test plan to see if it works as expected
To Turn in
Copy and paste the code into the box for code in the plan. Save it.
Attach it to an email and send it to me at steven.conger@seattlecolleges.edu
Assignment 2
Description
This is an individual assignment
For this program we are going to focus on methods
The goal of the program is to calculate a week's pay based on an hourly rate
We want to calculate the gross pay and then a net pay. The gross pay should be based on 40 hours a week, any hours over that should be paid at time and 1/2. The net pay is the pay after deductions. For our purposes we will deduct Social Security, medicate and a bus pass. The Social security deduction is 9% of the Gross pay, The medicare is 3% of the Gross and the bus pass is just a flat $25.
Instructions
Fill out the planning form
In coding each seperate action (such as calculating gross pay or deducting social security) should be a seperate method. Even getting the input should be separated into a method. The only thing in main should be a call to the method that gets and displays the values.
Don't forget to comment the code, including the code header.
Fix any errors
Test your code according to your test plan
To Turn in
Paste your code into your completed planning form and attach it to an email to me
Assignment 3
Description
This is an individual assignment.
This assignment is a variation of Assignment 2. The main difference is we will vary the percentages for Social security and Medicare based on the gross amount. We will use this table for Social Security:
| Gross | Percent |
|---|---|
| 5000 or greater | 40% |
| 4000 to 4999 | 35% |
| 3000 to 3999 | 25% |
| 2000 to 2999 | 20% |
| 1000 to 1999 | 12% |
| under 1000 | 9% |
We will use this table for medicare
| Gross | Percent |
|---|---|
| 5000 or greater | 20% |
| 2000-4999 | 10% |
| 1999 or less | 3% |
Instructions
Fill out the planning form
The methods should be the same as in the previous example. What you will add is the descision structures (ifs or switches) to determine which percentages to take.
Don't forget to comment the code, including the code header.
Fix any errors
Test your code according to your test plan. You should have several test scenarios to test the different percentages
To Turn in
Paste your code into your completed planning form and attach it to an email to me
Assignment 4
Description
This is an individual assignment
This assignment uses loops and arrays. The program will calculate a persons Grade Point Average.
You calculate a GPA by getting the Grade point and number of credits for each class taken. You multiply the two together to get the "Weight." Then, to get the weighted average you divide the weight by the sum of the credits. Below is an example. The bottom line contains totals
| Grade Point | Credits | Weight |
|---|---|---|
| 3.2 | 5 | 16 |
| 4 | 2 | 8 |
| 2.5 | 5 | 12.5 |
| 12 | 36.5 |
36.5 / 12 = 3.04
Instructions
Your program should ask the user how many grades they want to enter and then prompt them for the grade and number of credits. You should store the grades and credits in parallel arrays. When they are done the program should tell the user what their current GPA is.
Other things that would be good to do: Check to make sure that the grades are in range (0 to 4), Put the whole program in a loop so that it can be run more than one time. Break it into the appropriate methods.
As always document the code
To Turn in
Fill in the planning sheet.
Paste your code into the sheet and mail it to me
Assignment 5
Description
This is a group assignment. I want you to get into groups of three (no less than 3, no more than 4)
The goal of the assignment is to create a guessing game where a random number between 1 and 1000 is chose and the user tries to guess it in the fewest tries possible.
Instructions
As mentioned above, the program should randomly select an integer number between 1 and 1000.
For each new game the user is given 10 points. Each unsuccessful guess subtracts a point. A user's score is the number of points left when he or she correctly guesses the number. After 10 wrong guesses the game should tell the user that they have a 0 score for the game and show them the random number. Whether the use wins of loses, The game should first show the player the number of games that they have played, their total score and their average score. Then game should ask whether they want to play again.
You only have to keep the scores for a session. Later I might show you how to store them in a file
To Turn in
I want pretty much the same as before: the work sheet and the code, but I want each team member's name on the sheet and in the code header
Assignment 6 and 7
Description
This is an individual assignment
We are going to make a class that calculates BMI (body mass index) and use that class both with a console application and a Windows Presentation Foundation (WPF) form.
Instructions
The equation we will use to calculate the BMI is
BMI = Weight in Pounds * 703 / (height in inches) * (height in inches)
Console Application
First we will do the console application. Add a class called BMI. the class should have private fields for each of the input values and public properties. It should have methods to convert feet to inches and determine total height in inches. It should have a method to calculate the BMI that returns a value. It should also have a default constructor and a constructor that takes three arguments--height in feet, inches, and weight in pounds. The idea is you can initialize the class by entering your hight as 5 feet 10 inches, 225 pounds.
After creating the class instantiate it and call it from the console. When you enter values it should return your BMI. You might also have a method in your class that evaluates whether the BMI represents someone "under weight," "normal," "overweight" or "obese." (these ranges can be found online)
Windows Application
Start a new windows application. Add text fields for the user to input all the needed values.
Use the Project menu to add an exiting item to the project and add the BMI class. You may have to change its namepace to match the current project.
Add a button to the form.
When the button is clicked instantiate the class and return the BMI. You will need a label to display it. Have the backcolor of the label turn colors based on the value that is returned. If under weight have the label turn blue, if normal, green, if overweight, yellow and if obese, red.
To Turn in
Create a separate project sheet for each application
Paste the code into the box and send to me
Assignment Eight
Description
This is a Group assignment
For this assignment we will make an ASP.Net page. The idea is to create a web application that helps elementary school students with their math.
The program should offer the uses a choice of Addition, Subtraction, Multiplication or Division. (aim the problems at a third grade student. Division should be integer with a remainder. Multiplication should focus on the basic multiplication tables. when a user chooses an option, the program should provide two random numbers and text box for the user to enter an answer.
If the answer is correct the program should congradulate the user. If not it should promp the user to try again. There should be an option to just reveal the answer.
a few things to be aware of
- For subtraction make sure the random numbers do not result in a negative number
- For division make sure there is no division by zero. Also don't return decimals, return a whole number and a remainder
- try to break up the application into classes and use good structure
- Make the program attractive to an elementary student. Add color and images
This is a difficult assignment. Make sure you work together as a group. It will make for richer ideas and better trouble shooting
To Turn in
Fill out the program planner
paste in the code including the source code for the web form
also attach a screen shot of the program running