Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C++ program that: (a) uses your studentID as a seed for rand() function. (b) generates a random floating-point number with 4 decimal points

Write a C++ program that: (a) uses your studentID as a seed for rand() function. (b) generates a random floating-point number with 4 decimal points between -10 and -9 e.g. -9.5427 and store it a variable. The interval does NOT include -9 and -10 i.e. (-10,-9). (c) print the generated random value. (d) print the absolute value, ceiling and floor of the generated random value. (e) print the decimal part of the generated random value. Sample Output Random number : -9.7823 Absolute value: 9.7823 Its floor : -10 Its ceiling: -9 Its decimal part: 7823image text in transcribed

Write a C++ program that: (a) uses your studentID as a seed for rand() function. (b) generates a random floating-point number with 4 decimal points between -10 and -9 e.g. -9.5427 and store it a variable. The interval does NOT include -9 and -10 i.e. (-10,-9). (c) print the generated random value. (d) print the absolute value, ceiling and floor of the generated random value. (e) print the decimal part of the generated random value. Sample Output Random number : -9.7823 Absolute value: 9.7823 Its floor : -10 Its ceiling: -9 Its decimal part: 7823

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_2

Step: 3

blur-text-image_3

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

Question

8. Explain competency models and the process used to develop them.

Answered: 1 week ago