Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Module_08_Project
- {
- class Checks
- {
- /* By: Adam
- * Module 08 Programming Project
- * 11/18/2017
- *
- * This program checks whether or not the user inputs numbers which increase in value, and returns
- * true. The program will also check if numbers do not constantly increase, and will return false.
- *
- * 2 < 3 = true
- * 3 < 1 = false
- * 2 < 3 < 4 = true
- * 3 < 2 < 5 < 1 = false
- *
- * */
- static bool wow = true;
- static int x,y,z,a = 0;
- public static void Main(string[] args)
- { //I really hope making 3 separate methods for 2, 3, and 4 overloads was appropriate, and what you were asking for.
- Check(x, y);
- Console.WriteLine(wow);
- Console.WriteLine("Press enter to continue to second overloaded method...");
- Console.ReadKey();
- Check(x, y, z);
- Console.WriteLine(wow);
- Console.WriteLine("Press enter to continue to second overloaded method...");
- Console.ReadKey();
- Check(x, y, z, a);
- Console.WriteLine(wow);
- Console.Read();
- }
- static bool Check(int x, int y)
- {
- Console.Write("Enter first number: ");
- x = Convert.ToInt32(Console.ReadLine());
- Console.Write("Enter first second: ");
- y = Convert.ToInt32(Console.ReadLine());
- if (x < y)
- {wow = true;}
- else
- {wow = false;}
- return false;
- }
- static bool Check(int x, int y, int z)
- {
- Console.Write("Enter first number: ");
- x = Convert.ToInt32(Console.ReadLine());
- Console.Write("Enter first second: ");
- y = Convert.ToInt32(Console.ReadLine());
- Console.Write("Enter third number: ");
- z = Convert.ToInt32(Console.ReadLine());
- if (x < y && y < z)
- { wow = true; }
- else { wow = false; }
- return false;
- }
- static bool Check(int x, int y, int z, int a)
- {
- Console.Write("Enter first number: ");
- x = Convert.ToInt32(Console.ReadLine());
- Console.Write("Enter first second: ");
- y = Convert.ToInt32(Console.ReadLine());
- Console.Write("Enter third number: ");
- z = Convert.ToInt32(Console.ReadLine());
- Console.Write("Enter fourth second: ");
- a = Convert.ToInt32(Console.ReadLine());
- if (x < y && y < z && z < a)
- { wow = true; }
- else { wow = false; }
- return false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement