Find Us On:

# Java Programming if while statements

pol212

Will need the solution to Salary.java page 67 and will need you to fix/finish the code for factorials. Check the doc file. Instructions for the factorial exercise is on page 73 of the pdf Attachments Tags Clarifications

## Java - Factorial and Salary

dickersonka

Attached is the solution for the Java - Factorial and Salary assignments. Attachments
src.zip (1 K)
Preview
... if(rating == 1){//excellent raise = currentSalary * .06; } else if(rating == 2){//good raise = currentSalary * .04; } else {//poor raise = currentSalary * .015; } // Print the results System.out.println ("Amount of your raise: \$" +

Preview
Factorials { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter a number to calculate the factorial for: "); int

Screenshots

mariobeka

As asked. Salary class has been solved and also the code for Factorials has been rewritten from the ground up. Also for Factorials are been made to codes. The first one calculates the factorial of any number and the second one prompts the user just for positive numbers. Attachments
Factorial.java (1 K) Preview
" + "of a number."); System.out.print("Enter a number: "); theNum = scan.nextInt(); if (theNum == 0) { theFact = 1; System.out.println(theNum + "!

Factorial2.java (1 K) Preview
+ "! = " + theFact); } else { System.out.print(theNum + "! = "); for (count = 1; count <= theNum; count++) { theFact *=

Salary.java (1 K) Preview
the raise -- Use if ... else ... if (rating < 1 || rating > 3){ System.err.println("Rating does not exist! Try a rating between 1 - 3!"); return; } if (rating == 1){ raise = currentSalary*0.06; } else if (rating == 2){ raise = currentSalary*0.04; } else if (rating ==

Screen Shot 2013-11-17 at 4.28.09 PM.png (12 K) Preview

Screen Shot 2013-11-17 at 4.28.29 PM.png (10 K) Preview

Screen Shot 2013-11-17 at 4.29.17 PM.png (12 K) Preview

Screenshots