Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Q1
- int basketball =8;
- int running =10;
- int sleeping =1;
- int weight =0;
- double poundsToKilos =0.454;
- double factor = 1.05;
- double totalCals = sleeping + basketball +running;
- double mins = 30;
- double minsToHours = mins/60;
- double hours= minsToHours;
- double sleepTime=6.5;
- //Q1a
- weight = (int) (125 * poundsToKilos);
- running = (int) ((int)(factor * running * weight) *minsToHours);
- mins=40;
- basketball = (int) ((int) (factor * basketball * weight)*minsToHours);
- sleeping = (int) ((int) (factor * sleeping * weight) *sleepTime);
- System.out.println(sleeping);
- System.out.println(basketball);
- System.out.println(running);
- System.out.println("The total number of calories burned is " + totalCals);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement