Write statements that assign random integers to the variable n in the following ranges.

Assume Random randomNumbers = new Random() has been defined and use the two-parameter version of the method Random.Next.
a) 1 ?n ?2
b) 1 ? n ? 100
c) 0 ? n ? 9
d) 1000 ? n ? 1112
e) –1 ? n ? 1
f) –3 ? n ? 11


a) n = randomNumbers.Next(1, 3);
b) n = randomNumbers.Next(1, 101);
c) n = randomNumbers.Next(0, 10);
d) n = randomNumbers.Next(1000, 1113);
e) n = randomNumbers.Next(-1, 2);
f) n = randomNumbers.Next(-3, 12);

Computer Science & Information Technology

You might also like to view...

The chief executive officer of Oracle defends his practice to hire private investigators to sift through the garbage of which competitor?

a. Red Hat b. McAfee c. Norton d. Microsoft

Computer Science & Information Technology

Options for modifying the format of report objects are found on the ____ tab in Layout view when the contextual REPORT LAYOUT TOOLS tab is available.

A. FORMAT B. MODIFY C. DESIGN D. PAGE SETUP

Computer Science & Information Technology

Data entered in a query is actually stored in the underlying table(s).

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

The ____________________ command can be used to switch a process running in the background to the foreground.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology