Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class redoTestQ5
- {
- public static void main (String []args)
- {
- double yearsCalc, weeksCalc, daysCalc;
- String outputMessage;
- }
- public static double realInput //<- error here stating ";" expected
- {
- double realInput;
- Scanner sc = new Scanner(System.in);
- System.out.println("Please enter years as a real");
- realInput = sc.nextDouble();
- return realInput;
- }
- public static double yearsCalc(double realInput)
- {
- double yearsCalc;
- yearsCalc = (int)realInput;
- return yearsCalc;
- }
- public static double weeksCalc(double realInput)
- {
- double weeksCalc;
- weeksCalc = (realInput - ((int)realInput) * 52);
- return weeksCalc;
- }
- public static double daysCalc(double weeksCalc)
- {
- double daysCalc;
- daysCalc = (weeksCalc - ((int)weeksCalc) * 7);
- return daysCalc;
- }
- public static void outputMessage(double realInput, double yearsCalc, double weeksCalc, double daysCalc)
- {
- System.out.println("Thus " + realInput + " Years is " + yearsCalc + " Years " + weeksCalc + " Weeks and " + daysCalc + " Days.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement