Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace desktop
- {
- class Program
- {
- static void Main(string[] args)
- {
- //Make red (red=good)
- //Welcome to shop
- //Declare all variables
- //Ask name
- //Ask price doubles (if possable try convert from int??)
- //Ask if continue shopping
- //Ask price for second item if true
- //Add prices and calucate gst
- //Print price
- //Print “Thank you for shopping with us (var name), please come again”
- //Clear red
- Console.Clear();
- Console.ForegroundColor = ConsoleColor.Red;
- var int2 = 0;
- var item1 = 0.00;
- var item2 = 0.00;
- Console.WriteLine("Hello welcome to my shop");
- Console.WriteLine("What is your name?");
- var name = (Console.ReadLine());
- Console.WriteLine($"please enter the price of your item");
- Double.TryParse(Console.ReadLine(), out item1);
- {
- Console.WriteLine($"{item1}");
- }
- Console.WriteLine("would you like to add another item? (y/n)");
- var addItem = Console.ReadLine();
- if (addItem == "y");
- {
- Console.WriteLine($"please enter the price of your item");
- int2 = Double.TryParse(Console.ReadLine(), out item2);
- {
- Console.WriteLine($"{item2}");
- }
- }
- double totalPrice = (item1 + item2);
- totalPrice = totalPrice+(totalPrice*0.15);
- totalPrice = (Double)totalPrice;
- Console.WriteLine($"${totalPrice}");
- Console.WriteLine($"thank you for shopping with us {name}");
- Console.ResetColor();
- Console.WriteLine();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement