Find Us On: Facebook Twitter Rss Feed Blog
Need To Register? Sign Up Login

Java Programming if while statements

pol212
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

Answers

Java - Factorial and Salary

dickersonka
dickersonka 



Attached is the solution for the Java - Factorial and Salary assignments. Attachments
src.zip (1 K) Download
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
Purchase Answer

Answer

mariobeka
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) Download 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) Download Preview
+ "! = " + theFact); } else { System.out.print(theNum + "! = "); for (count = 1; count <= theNum; count++) { theFact *=

Salary.java (1 K) Download 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) Download Preview

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

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

Screenshots
Screenshot
Screenshot
Screenshot
Purchase Answer