Answered step by step
Verified Expert Solution
Question
1 Approved Answer
[C#] I need to print out numbers between highest and lowest. Here's a picture of what is required. 1. You should create a new class,
[C#] I need to print out numbers between highest and lowest. Here's a picture of what is required.
1. You should create a new class, named NumberPrinter below it. A. This class should have, as data members (instance variables), the lowest and highest numbers to print. B. It should also have a method, named Print, which prints out all the (integer) numbers between lowest and highest. The method should have a single, bool, parameter, and if that parameter is true, then the method should print out only the even numbers. If the parameter is false, then you should print out all the numbers in the specified range. C. Additionally, it should have a default constructor that sets both the lowest and highest to be 0 2. The following code: NumberPrinter npnew NumberPrinter(); np.SetLowest( 3.14159 np.SetHighest( 12); np.Print (true); np. SetHighest( 17.1; np.Print (false); np.SetLowest (17); // note that lohi np.Print (false): // no output np.SetLowest (22); // note that lo > hi np.Print (false): // no output should produce the following results 4 8 4 7 8 16 17Step 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