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;
- namespace ConsoleApplication1
- {
- class Program
- {
- static void Main(string[] args)
- {
- while (true)
- {
- try
- {
- Console.ForegroundColor = ConsoleColor.White;
- Console.WriteLine("Welcome to Grand Circus' Room Detail Generator");
- Console.WriteLine();
- Console.WriteLine("Enter Length:");
- string length = Console.ReadLine();
- double lengthint = double.Parse(length);
- Console.WriteLine();
- Console.WriteLine("Enter Width");
- string Width = Console.ReadLine();
- double Widthint = double.Parse(Width);
- Console.WriteLine();
- Console.WriteLine("Area");
- double Area = lengthint * Widthint;
- Console.WriteLine(Area);
- Console.WriteLine();
- Console.WriteLine("Perimeter");
- double Perimeter = 2 * (lengthint + Widthint);
- Console.WriteLine(Perimeter);
- string answer = null;
- while (answer != "YES" | answer != "NO")
- {
- Console.WriteLine("Run again [Yes][No]?");
- answer = Console.ReadLine().ToUpper();
- if (answer == "NO")
- return;
- if (answer == "YES")
- {
- Console.Clear();
- break;
- }
- }
- }
- catch (Exception ex)
- {
- Console.ForegroundColor = ConsoleColor.Red;
- Console.WriteLine(string.Format("ERROR: {0}", ex.Message));
- Console.ForegroundColor = ConsoleColor.White;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement