Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Vapor_Store
- {
- class Vapor_Store
- {
- static void Main(string[] args)
- {
- double priceOutFall = 39.99;
- double priceCS = 15.99;
- double priceZplinter = 19.99;
- double priceHonored = 59.99;
- double priceRoverWatch = 29.99;
- double priceRoverWatchOrig = 39.99;
- int countOutFall = 0;
- int countCS = 0;
- int countZplinter = 0;
- int countHonored = 0;
- int countRoverWatch = 0;
- int countRoverWatchOrig = 0;
- double sumPrice = 0;
- double balans = double.Parse(Console.ReadLine());
- string game = null;
- while (game != "Game Time")
- {
- game = Console.ReadLine();
- if (game == "CS: OG")
- {
- if (balans < priceCS)
- {
- Console.WriteLine($"Too Expensive");
- continue;
- }
- else
- {
- Console.WriteLine($"Bought {game}");
- balans -= priceCS;
- countCS++;
- }
- }
- else if (game == "Zplinter Zell")
- {
- if (balans < priceZplinter)
- {
- Console.WriteLine($"Too Expensive");
- continue;
- }
- else
- {
- Console.WriteLine($"Bought {game}");
- balans -= priceZplinter;
- countZplinter++;
- }
- }
- else if (game == "RoverWatch")
- {
- if (balans < priceRoverWatch)
- {
- Console.WriteLine($"Too Expensive");
- continue;
- }
- else
- {
- Console.WriteLine($"Bought {game}");
- balans -= priceRoverWatch;
- countRoverWatch++;
- }
- }
- else if (game == "RoverWatch Origins Edition")
- {
- if (balans < priceRoverWatchOrig)
- {
- Console.WriteLine($"Too Expensive");
- continue;
- }
- else
- {
- Console.WriteLine($"Bought {game}");
- balans -= priceRoverWatchOrig;
- countRoverWatchOrig++;
- }
- }
- else if (game == "OutFall 4")
- {
- if (balans < priceOutFall)
- {
- Console.WriteLine($"Too Expensive");
- continue;
- }
- else
- {
- Console.WriteLine($"Bought {game}");
- balans -= priceOutFall;
- countOutFall++;
- }
- }
- else if (game == "Honored 2")
- {
- if (balans < priceHonored)
- {
- Console.WriteLine($"Too Expensive");
- continue;
- }
- else
- {
- Console.WriteLine($"Bought {game}");
- balans -= priceHonored;
- countHonored++;
- }
- }
- else if (game == "Game Time") break;
- else if (game != "OutFall 4" && game != "CS: OG" && game != "Zplinter Zell" &&
- game != "Honored 2" && game != "RoverWatch" && game != "RoverWatch Origins Edition")
- {
- Console.WriteLine($"Not Found");
- continue;
- }
- if (balans <= 0)
- {
- Console.WriteLine($"Out of money!");
- return;
- }
- }
- sumPrice = countOutFall * priceOutFall + countCS * priceCS + countZplinter * priceZplinter +
- countHonored * priceHonored + countRoverWatch * priceRoverWatch +
- countRoverWatchOrig * priceRoverWatchOrig;
- Console.WriteLine($"Total spent: ${sumPrice:f2}. Remaining: ${balans:f2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement