Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribed

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 17

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions