Question
Having problems with this one as it keeps giving me errors, it is 7.17 in C# ,(Visual C# 2012, How to Program), the Even or
Having problems with this one as it keeps giving me errors, it is 7.17 in C# ,(Visual C# 2012, How to Program), the Even or Odd program:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;
namespace Seven {
// Class definition // class EvenOrOdd { /* Method to find out if the number is an even number @param number is the integer to be checked return true if number is even, false otherwise. */
static bool isEven(int number) { // Divide the number by 2 and check if the remainder is 0. If so, return true; false otherwise. if (number % 2 == 0)
return true;
else
return false; }
//main() static void Main(string[] args) { // Header message Console.WriteLine("---------- Even or Odd ----------"); // Variable to store the number int number; // Variable to store the value returned by isEven() method bool check; // Loop to input values for (int i = 1; i <= 5; i++); }
// Prompt the user to input the value Console.Write("input the number: "); // Take the value as input number=Convert.ToInt32(Console.ReadLine()); check=isEven(number); // Chaeck if method returns true if(checked==true) // Display the success message Console.WriteLine("{0} is an even number", number);
else // Display the failure message Console.WriteLine("{0} is not an even number", number); } //end loop Console.Write("Good Bye..."); Console.ReadKey(); //end main() } // End Class }
Thank you for any help and why I am getting error # CS1519
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started