Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace test111
- {
- class MainClass
- {
- public static void Main (string[] args)
- {start:
- Random ng = new Random ();
- float num1 = ng.Next (1,11) ;
- float num2 = ng.Next (1,11);
- double num3;
- int responseIndex = ng.Next (1, 5);
- switch (responseIndex){
- case 1:
- Console.WriteLine("what is " + num1 + " times " + num2);
- num3 = Convert.ToDouble (Console.ReadLine ());
- if (num3 == num1 * num2)
- {
- Console.WriteLine ("you are correct, good job!!!");
- goto start;
- }
- else
- {
- Console.WriteLine ("nice try but you are incorrect!!!");
- goto start;
- case 2:
- Console.WriteLine("what is " + num1 + " divide " + num2);
- num3 = Convert.ToDouble (Console.ReadLine ());
- if (num3 == num1 / num2)
- {
- Console.WriteLine ("you are correct, good job!!!");
- goto start;
- }
- else
- {
- Console.WriteLine ("nice try but you are incorrect!!!");
- goto start;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement