SHARE
TWEET

Untitled

markov5534 Nov 19th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class oshteEdnaDulga {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         System.out.print("What fruit: ");
  7.         String plod = scanner.next();
  8.         System.out.print("Which day: ");
  9.         String day = scanner.next();
  10.         day = day.substring(0, 1).toUpperCase() + day.substring(1).toLowerCase();
  11.         System.out.print("How much: ");
  12.         double amount = Double.parseDouble(scanner.next());
  13.  
  14.  
  15.         boolean b = day.equals("Monday") || day.equals("Tuesday") ||
  16.                 day.equals("Wednesday") || day.equals("Thursday") || day.equals("Friday");
  17.         boolean a = day.equals("Saturday") || day.equals("Sunday");
  18.         if (plod.equals("banana") && b) {
  19.             double seks = amount * 2.50;
  20.             System.out.printf("You owe %.2f", seks);
  21.         } else if ((plod.equals("banana") && a)) {
  22.  
  23.             double seks = amount * 2.70;
  24.             System.out.printf("You owe %.2f", seks);
  25.         } else if (plod.equals("apple") && b) {
  26.             double seks = amount * 1.20;
  27.             System.out.printf("You owe %.2f", seks);
  28.         } else if ((plod.equals("apple") && a)) {
  29.  
  30.             double seks = amount * 1.25;
  31.             System.out.printf("You owe %.2f", seks);
  32.         } else if (plod.equals("orange") && b) {
  33.             double seks = amount * 0.75;
  34.             System.out.printf("You owe %.2f", seks);
  35.         } else if ((plod.equals("orange") && a)) {
  36.  
  37.             double seks = amount * 0.90;
  38.             System.out.printf("You owe %.2f", seks);
  39.         } else if (plod.equals("grapefruit") && b) {
  40.             double seks = amount * 1.45;
  41.             System.out.printf("You owe %.2f", seks);
  42.         } else if ((plod.equals("grapefruit") && a)) {
  43.  
  44.             double seks = amount * 1.60;
  45.             System.out.printf("You owe %.2f", seks);
  46.         } else if (plod.equals("kiwi") && b) {
  47.             double seks = amount * 2.70;
  48.             System.out.printf("You owe %.2f", seks);
  49.         } else if ((plod.equals("kiwi") && a)) {
  50.  
  51.             double seks = amount * 3.00;
  52.             System.out.printf("You owe %.2f", seks);
  53.         } else if (plod.equals("pineapple") && b) {
  54.             double seks = amount * 5.50;
  55.             System.out.printf("You owe %.2f", seks);
  56.         } else if ((plod.equals("pineapple") && a)) {
  57.  
  58.             double seks = amount * 5.60;
  59.             System.out.printf("You owe %.2f", seks);
  60.         } else if (plod.equals("grapes") && b) {
  61.             double seks = amount * 3.85;
  62.             System.out.printf("You owe %.2f", seks);
  63.         } else if ((plod.equals("grapes") && a)) {
  64.  
  65.             double seks = amount * 4.20;
  66.             System.out.printf("You owe %.2f", seks);
  67.         }
  68.     }
  69. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top