Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- // GONZALES JOHN MICHAEL
- // BSIT CUBAO
- // ACTIVITY 5
- namespace ACTIVITY5
- {
- class Program
- {
- public static void Main(string[] args)
- {
- double first, second;
- int choice;
- Console.Title = ("ACT5 BSIT CUBAO");
- Console.ForegroundColor = ConsoleColor.DarkGreen;
- Console.Write("Enter 1st Number: ");
- first = Convert.ToDouble(Console.ReadLine());
- Console.Write("Enter 2nd number: ");
- second = Convert.ToDouble(Console.ReadLine());
- Console.WriteLine("\nMain Menu\n1. Addtion\n2. Subtraction\n3. Multiplication\n4. Divition");
- Console.Write("\nchoose from the menu the operation you want to perform: ");
- choice = Convert.ToInt32(Console.ReadLine());
- switch (choice)
- {
- case 1:
- double sum = first + second;
- Console.WriteLine("\nThe result of addition is: {0}", sum);
- break;
- case 2:
- double difference = first - second;
- Console.WriteLine("\nThe result of subtraction is: {0}", difference);
- break;
- case 3:
- double product = first * second;
- Console.WriteLine("\nThe result of multiplication is: {0}", product);
- break;
- case 4:
- double quotient = first / second;
- Console.WriteLine("\nThe result of division is: {0}", quotient);
- break;
- default:
- Console.WriteLine("INVALID INPUT!!");
- break;
- Console.WriteLine("Press any key to continue. . .");
- Console.ReadKey(true);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment