Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Statements
- {
- class MainClass
- {
- public static void Main(string[] args)
- {
- string fruit = Console.ReadLine().ToLower();
- string day = Console.ReadLine().ToLower();
- var ammount = double.Parse(Console.ReadLine());
- double total = 0;
- if (fruit == "banana")
- {
- if (day != "sunday" && day != "saturday")
- {
- total = ammount * 2.50;
- Console.WriteLine(Math.Round(total, 2));
- }
- else
- {
- total = ammount * 2.70;
- Console.WriteLine(Math.Round(total, 2));
- }
- }
- if (fruit == "apple")
- {
- if (day != "sunday" && day != "saturday")
- {
- total = ammount * 1.20;
- Console.WriteLine(Math.Round(total, 2));
- }
- else
- {
- total = ammount * 1.25;
- Console.WriteLine(Math.Round(total, 2));
- }
- }
- if (fruit == "orange")
- {
- if (day != "sunday" && day != "saturday")
- {
- total = ammount * 0.85;
- Console.WriteLine(Math.Round(total, 2));
- }
- else
- {
- total = ammount * 0.90;
- Console.WriteLine(Math.Round(total, 2));
- }
- }
- if (fruit == "grapefruit")
- {
- if (day != "sunday" && day != "saturday")
- {
- total = ammount * 1.45;
- Console.WriteLine(Math.Round(total, 2));
- }
- else
- {
- total = ammount * 1.60;
- Console.WriteLine(Math.Round(total, 2));
- }
- }
- if (fruit == "kiwi")
- {
- if (day != "sunday" && day != "saturday")
- {
- total = ammount * 2.70;
- Console.WriteLine(Math.Round(total, 2));
- }
- else
- {
- total = ammount * 3.00;
- Console.WriteLine(Math.Round(total, 2));
- }
- }
- if (fruit == "pineapple")
- {
- if (day != "sunday" && day != "saturday")
- {
- total = ammount * 5.50;
- Console.WriteLine(Math.Round(total, 2));
- }
- else
- {
- total = ammount * 5.60;
- Console.WriteLine(Math.Round(total, 2));
- }
- }
- if (fruit == "grapes")
- {
- if (day != "sunday" && day != "saturday")
- {
- total = ammount * 3.85;
- Console.WriteLine(Math.Round(total, 2));
- }
- else
- {
- total = ammount * 4.20;
- Console.WriteLine(Math.Round(total, 2));
- }
- }
- else
- {
- Console.WriteLine("error");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement