Question: Write a C++ program that takes two positive integers i and p from the keyboard: i in the range [2..50], p in the range [2..6].
Write a C++ program that takes two positive integers i and p from the keyboard: i in the range [2..50], p in the range [2..6].
The program generates i random non-integer numbers in the range [0..5000], with p decimal digits after the decimal point (p precision). It outputs them one under another in one column, lined up by decimal point (as shown).
Make sure to validate the input and ask the user to resubmit the numbers, if necessary. You can assume that the user will enter only integer numbers.
Example, if i=18 and p=2, generate 18 numbers with two decimal places:
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
