Question
(C++) 1. Write a program that prompts the user to input a decimal number and outputs the number rounded to the nearest integer. There is
(C++)
1. Write a program that prompts the user to input a decimal number and outputs the number rounded to the nearest integer. There is no one function that will do this automatically. You will have to resort to some mathematical trick (very simple one) or a combination of functions. Remember static_cast will only truncate and not round.
2. Write a program that prompts the user to enter five test scores and then prints the average test score. (Assume that the test scores are decimal numbers.)
3. Write a C++ program that prompts the user to input the elapsed time for an event in seconds. The program then outputs the elapsed time in hours, minutes, and seconds. (For example, if the elapsed time is 9630 seconds, then the output is 2:40:30.), and seconds. The program then outputs the elapsed time in seconds.)
Step 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