Question
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: 7823
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: 7823Step 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