Advertisement
Guest User

Untitled

a guest
Feb 28th, 2020
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.74 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Fruit_Shop
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string fruit = Console.ReadLine();
  10.             string day = Console.ReadLine();
  11.             double quantity = double.Parse(Console.ReadLine());
  12.  
  13.             if (day == "Monday" || day == "Tuesday" || day == "Wednesday" || day == "Thursday" || day == "Friday")
  14.             {
  15.                 if (fruit == "banana")
  16.                 {
  17.                     Console.WriteLine("{0:f2}", 2.50 * quantity);
  18.  
  19.                 }
  20.                 if (fruit == "apple")
  21.                 {
  22.                     Console.WriteLine("{0:f2}", 1.20 * quantity);
  23.                 }
  24.                 if (fruit == "orange")
  25.                 {
  26.                     Console.WriteLine("{0:f2}", 0.85 * quantity);
  27.                 }
  28.                 if (fruit == "grapefruit")
  29.                 {
  30.                     Console.WriteLine("{0:f2}", 1.45 * quantity);
  31.                 }
  32.                 if (fruit == "kiwi")
  33.                 {
  34.                     Console.WriteLine("{0:f2}", 2.70 * quantity);
  35.                 }
  36.                 if (fruit == "pineapple")
  37.                 {
  38.                     Console.WriteLine("{0:f2}", 5.50 * quantity);
  39.                 }
  40.                 if (fruit == "grapes")
  41.                 {
  42.                     Console.WriteLine("{0:f2}", 3.85 * quantity);
  43.                 }
  44.  
  45.  
  46.             }
  47.  
  48.             else if (day == "Saturday" || day == "Sunday")
  49.             {
  50.                 if (fruit == "banana")
  51.                 {
  52.                     Console.WriteLine("{0:f2}", 2.70 * quantity);
  53.                 }
  54.                 if (fruit == "apple")
  55.                 {
  56.                     Console.WriteLine("{0:f2}", 1.25 * quantity);
  57.                 }
  58.                 if (fruit == "orange")
  59.                 {
  60.                     Console.WriteLine("{0:f2}", 0.90 * quantity);
  61.                 }
  62.                 if (fruit == "grapefruit")
  63.                 {
  64.                     Console.WriteLine("{0:f2}", 1.60 * quantity);
  65.                 }
  66.                 if (fruit == "kiwi")
  67.                 {
  68.                     Console.WriteLine("{0:f2}", 3.00 * quantity);
  69.                 }
  70.                 if (fruit == "pineapple")
  71.                 {
  72.                     Console.WriteLine("{0:f2}", 5.60 * quantity);
  73.                 }
  74.                 if (fruit == "grapes")
  75.                 {
  76.                     Console.WriteLine("{0:f2}", 4.20 * quantity);
  77.                 }
  78.             }
  79.  
  80.             else
  81.             {
  82.                 Console.WriteLine("error");
  83.             }
  84.            
  85.            
  86.            
  87.            
  88.                
  89.  
  90.            
  91.            
  92.            
  93.  
  94.  
  95.         }
  96.     }
  97. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement