Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. import java.util.*;
  2. public class redoTestQ5
  3. {
  4. public static void main (String []args)
  5. {
  6. double yearsCalc, weeksCalc, daysCalc;
  7. String outputMessage;
  8.  
  9. }
  10.  
  11. public static double realInput //<- error here stating ";" expected
  12. {
  13. double realInput;
  14. Scanner sc = new Scanner(System.in);
  15. System.out.println("Please enter years as a real");
  16. realInput = sc.nextDouble();
  17. return realInput;
  18. }
  19.  
  20. public static double yearsCalc(double realInput)
  21. {
  22. double yearsCalc;
  23. yearsCalc = (int)realInput;
  24. return yearsCalc;
  25. }
  26.  
  27. public static double weeksCalc(double realInput)
  28. {
  29. double weeksCalc;
  30. weeksCalc = (realInput - ((int)realInput) * 52);
  31. return weeksCalc;
  32. }
  33.  
  34. public static double daysCalc(double weeksCalc)
  35. {
  36. double daysCalc;
  37. daysCalc = (weeksCalc - ((int)weeksCalc) * 7);
  38. return daysCalc;
  39. }
  40.  
  41. public static void outputMessage(double realInput, double yearsCalc, double weeksCalc, double daysCalc)
  42. {
  43. System.out.println("Thus " + realInput + " Years is " + yearsCalc + " Years " + weeksCalc + " Weeks and " + daysCalc + " Days.");
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement