Advertisement
Guest User

Untitled

a guest
Nov 18th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.85 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Module_08_Project
  4. {
  5.     class Checks
  6.     {
  7.         /* By: Adam
  8.          * Module 08 Programming Project
  9.          * 11/18/2017
  10.          *
  11.          * This program checks whether or not the user inputs numbers which increase in value, and returns
  12.          * true. The program will also check if numbers do not constantly increase, and will return false.
  13.          *
  14.          * 2 < 3 = true
  15.          * 3 < 1 = false
  16.          * 2 < 3 < 4 = true
  17.          * 3 < 2 < 5 < 1 = false
  18.          *
  19.          * */
  20.         static bool wow = true;
  21.         static int x,y,z,a = 0;        
  22.         public static void Main(string[] args)
  23.         {   //I really hope making 3 separate methods for 2, 3, and 4 overloads was appropriate, and what you were asking for.        
  24.             Check(x, y);
  25.             Console.WriteLine(wow);
  26.             Console.WriteLine("Press enter to continue to second overloaded method...");
  27.             Console.ReadKey();
  28.             Check(x, y, z);
  29.             Console.WriteLine(wow);
  30.             Console.WriteLine("Press enter to continue to second overloaded method...");
  31.             Console.ReadKey();
  32.             Check(x, y, z, a);            
  33.             Console.WriteLine(wow);
  34.             Console.Read();            
  35.         }
  36.         static bool Check(int x, int y)
  37.         {
  38.             Console.Write("Enter first number: ");
  39.             x = Convert.ToInt32(Console.ReadLine());
  40.             Console.Write("Enter first second: ");
  41.             y = Convert.ToInt32(Console.ReadLine());
  42.             if (x < y)
  43.             {wow = true;}
  44.             else
  45.             {wow = false;}            
  46.             return false;                        
  47.         }
  48.         static bool Check(int x, int y, int z)
  49.         {
  50.             Console.Write("Enter first number: ");
  51.             x = Convert.ToInt32(Console.ReadLine());
  52.             Console.Write("Enter first second: ");
  53.             y = Convert.ToInt32(Console.ReadLine());
  54.             Console.Write("Enter third number: ");
  55.             z = Convert.ToInt32(Console.ReadLine());            
  56.             if (x < y && y < z)
  57.             { wow = true; }
  58.             else { wow = false; }
  59.             return false;
  60.         }
  61.         static bool Check(int x, int y, int z, int a)
  62.         {
  63.             Console.Write("Enter first number: ");
  64.             x = Convert.ToInt32(Console.ReadLine());
  65.             Console.Write("Enter first second: ");
  66.             y = Convert.ToInt32(Console.ReadLine());
  67.             Console.Write("Enter third number: ");
  68.             z = Convert.ToInt32(Console.ReadLine());
  69.             Console.Write("Enter fourth second: ");
  70.             a = Convert.ToInt32(Console.ReadLine());
  71.             if (x < y && y < z && z < a)
  72.             { wow = true; }
  73.             else { wow = false; }
  74.             return false;
  75.         }
  76.     }
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement