Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class E01shoppingTime{
- public static void main (String[]args) {
- Scanner scanner = new Scanner(System.in);
- double lunchTime = Double.parseDouble(scanner.nextLine());
- double pricePeriferia = Double.parseDouble(scanner.nextLine());
- double priceProgram= Double.parseDouble(scanner.nextLine());
- double priceFrape = Double.parseDouble(scanner.nextLine());
- double frapeTime = 5;
- double periferiaTime = 6; //3 x 2min
- double programmsTime = 4; //2 x 2min
- double Total = priceFrape + (2 * priceProgram) + (pricePeriferia * 3);
- double TimeLeft = lunchTime - (frapeTime + periferiaTime + programmsTime);
- System.out.printf("%.2f%n", Total);
- System.out.printf("%.0f", TimeLeft);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment