Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Magazin_za_detski_igrachki
- {
- class Program
- {
- static void Main(string[] args)
- {
- //Toy prices
- double puzzle = 2.60;
- double doll = 3;
- double teddybear = 4.10;
- double minion = 8.20;
- double truck = 2;
- //Input (6)
- double TourPrice = double.Parse(Console.ReadLine());
- int puzzleQ= int.Parse(Console.ReadLine());
- int dollQ = int.Parse(Console.ReadLine());
- int teddybearQ = int.Parse(Console.ReadLine());
- int minionQ = int.Parse(Console.ReadLine());
- int truckQ = int.Parse(Console.ReadLine());
- //Total amount of orders
- int orders = (puzzleQ+dollQ+teddybearQ+minionQ+truckQ);
- //Single order price
- double puzzleP = (puzzle*puzzleQ);
- double dollP = (doll*dollQ);
- double teddybearP = (teddybear * teddybearQ);
- double minionP = (minion * minionQ);
- double truckP = (truck * truckQ);
- //Total order price
- double totalprice = Math.Abs(puzzleP + dollP + teddybearP + minionP + truckP);
- //Discount
- double discount = 0;
- if (orders >= 50) { discount = Math.Abs(0.25 * totalprice); }
- //End price/winnings
- double endprice = Math.Abs(totalprice - discount);
- //Rent
- double rent = Math.Abs(0.10 * endprice);
- //endendprice
- double endendprice = Math.Abs(endprice - rent);
- //
- if (TourPrice<endendprice)
- {
- Console.WriteLine("Yes! {0:F} lv left."
- , Math.Abs(endendprice -TourPrice));
- }
- else
- {
- Console.WriteLine("Not enough money! {0:F} lv needed."
- , Math.Abs(TourPrice -endendprice));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement