Presentation is loading. Please wait.

Presentation is loading. Please wait.

Java Project 3 In Class Practice. IF Statements Create a simple program that allows the user to enter a test score as an integer. If the test score is.

Similar presentations


Presentation on theme: "Java Project 3 In Class Practice. IF Statements Create a simple program that allows the user to enter a test score as an integer. If the test score is."— Presentation transcript:

1 Java Project 3 In Class Practice

2 IF Statements Create a simple program that allows the user to enter a test score as an integer. If the test score is greater than 85, the user should get the feedback – “You Passed” Otherwise the user should get the feedback “Sorry, try again”

3 Payroll program – page 221 of Adobe file Follow the program guidelines to set up a program to determine pay of employees Constant – full time hours worked per week Constant – overtime rate – 1.5 (allows this to be changed easily)

4 Nested IF statement Instructions in handout, page 223, 224 Follow instructions below figure 5-11 In the program the amount of bonus depends not only on the number of items sold, but the value of each item. Good practice with Nested IF

5 Switch Statements Use the Switch statements to set up a program to allow the user to Enter a number 1 – 4. If they enter a 1, it should report – Freshman If they enter a 2, it should report – Sophomore If they enter a 3, it should report – Junior If they enter a 4, it should report – Senior If they enter anything other than 1 -4 they should get a message that it is an invalid choice.

6 Conditional statements Two variables – GPA and ACT score. If the GPA is greater than 3.65 or the ACT score is greater than 27, Admission to Madison is granted Otherwise tell the user to try again.

7 Constants – determining amount of commission Allow the user to enter a salesperson’s Amount of sale Set up a program with a commission rate as a constant A variable to calculate the amount of the commission Amount of Sale * Commission Rate Print back the amount of the Commission


Download ppt "Java Project 3 In Class Practice. IF Statements Create a simple program that allows the user to enter a test score as an integer. If the test score is."

Similar presentations


Ads by Google