type this into Google to get that number: 1 km to miles Google tells you that 1
ID: 3669632 • Letter: T
Question
type this into Google to get that number: 1 km to miles Google tells you that 1 km equals 0.621371 miles. Enter flow rate in liters per minute: 18 Enter radius of oil drum in inches: 45 Enter height of oil drum in inches: 80 Time to fill barrel: 7 hour(s), 43 minute(s) and 20 seconds Note that you will need to do rounding at some point in your calculations. This process is very simple. Suppose you wanted to round a variable called total to the nearest integer. You would write this: total = round(total) Do not be concerned if the number of seconds in your answer differs slightly (i.e., a couple of seconds) from the sample given above. No credit will be deducted in such cases. This program is worth a total of 10 points, broken down as follows: 2: input prompts 2: hours correct 2: minutes correct 2: seconds correct (within a few seconds of the correct answer) 2: all output values are integers Partial credit will be available.Explanation / Answer
import java.util.Scanner;
public class TimeOfBarrel {
public static void main(String[] args) {
int floawrate;
int radius;
int height;
Scanner sc=new Scanner(System.in);
System.out.println("Enter Flow rate in minutes....");
floawrate=sc.nextInt();
System.out.println("Enter the radius");
radius=sc.nextInt();
System.out.println("Enter the height");
height=sc.nextInt();
double volume=Math.PI*radius*radius*height;
int Total_time=(int) Math.round(volume/floawrate);
int total_hours=Total_time/3600;
System.out.println("Total secods are");
System.out.println(total_hours);
int total_minutes=(Total_time-total_hours*3600)/60;
System.out.println("Total minutes are ");
System.out.println(total_minutes);
}
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.