Question
Objectives Write proper documentation comments. Create a program using proper style conventions. Create a program using C++ include directives and using statements. Create C++ function
Objectives
Write proper documentation comments.
Create a program using proper style conventions.
Create a program using C++ include directives and "using" statements.
Create C++ function prototypes.
Declare variables using C++.
Get user input.
Write code to read in entire lines, including spaces and tabs.
Write the code needed to make cin and getline(cin, string) work properly together
Display output.
Display formatted output.
Create a program that does proper input validation.
Call functions, sending the appropriate values, and storing returned values as needed.
Use C math library functions.
Create functions to perform specified tasks.
Program requirements
Write documentation comments. They must include the name of the program, the date, the course number, and your name.
Use proper indentation throughout the program using four spaces per level of indent.
Use spaces and NO tabs for the indentation.
Write whatever include directives and using statements that your program needs.
Write a function prototype for a function named reverse that takes a string and returns the reverse of that string (so "Kish" as input would get "hsiK" as output).
Write a function prototype for a function named display that takes an int "n" and a string "s" and returns nothing. This function should display the string s on the console n times, with a newline after each.
Declare an int variable named "num", a char named "dir", and a string named "msg".
Use input validation and loop until a valid value is entered for num. The prompt should be, "Enter an integer between 1 and 10: ". Display the error message, "Error: Below minimum value of 1", or, "Error: Above maximum value of 10" if the number entered is out of range.
Use an input validation loop to get a message to store in the "msg" variable. Prompt the user with, "Enter message to display: ". Keep looping until the message is a non-zero length. The message must be handled properly (all read in) even if it contains spaces.
Use input validation and loop until a valid value is entered for "dir". The prompt should be, "Enter a direction (F/R): ". Display the error message, "Error: Invalid choice" if the input value is not an 'F' or 'R'.
If the direction entered was 'R', then send the msg to the reverse function and store the returned results back in msg.
Send num and msg to the display function to display the message num times.
Display the square root of num to four decimal positions.
Return a success exit status (0 means success).
Write a function named reverse that takes a string argument, reverses that string and returns it.
Write a function named display that takes an int and a string, and displays the string on the console the number of times specified by the int. Have each message appear on its own line. Return nothing.
Objectives Write proper documentation comments. . Create a pragrarn using proper style conventions . Create a program using C++ include directives and "using" statements . Create C++ function prototypos . Declare variables using C . Get user input Write code to read in entire lines, including spaces and tabs Write the code nooded to make cin and getline(cin, string) work propery together . Display output. .Display formatted output .Create a program that does proper input validation. . Call functions, sonding the appropriate values, and storing returned values as needed. . Use C math library functions . Create functions to perform specified tasks Program requirements 1. Write documentation comments. They must include the name of the program, the date, the course number, and your name 2. Use proper indentation throughout the program using four spaces per level of indent. 3 Use spaces and NO tabs for the indentation 4. Write whatever include directives and using statements that your program needs. 5. Write a function prototype for a function named reverse that takes a string and retums the roverse of that string (so Kish" as input would get "hsik" as output). 6. Write a function prototype for a function named display that takes an int "n and a string "s" and returns nothing. This function should display the string s on the console n times, with a newine after each. 7, Declare an int variable named "nun", a char naned "dir", and a string narmed "msg" 8. Use input validation and loop until a valid value is entered for num. The prompt should be, "Enter an integer between 1 and 10: . Display the error message, "Error Below minimum value of 1", or, "Error: Above maximum valuc of 10" if the number entered is out of range 9. Use an input validation loop to get a message to store in the "msg" vaniable. Prompt the user with, "Enter message to display ". Keep looping until the message is a non-zero length. The message must be handled properly (all read in) even if it contains spaces 10. Use input validation and loop until a valid value is entered for "dir". The prompt should be, "Enter a direction (FIR): Display the error message, "Error: Invalid choice" if the input value is not an 'F' or 'R 11. If the direction entered was 'R', then send the msg to the reverse function and store the retumed results back in msg 12. Send num and msg to the display function to display the message num times. 13 Display the square roat of num to four decimal positions 14. Return a success exit status (0 means success). 15. Write a function named reverse that takos a string argument, reverses that string and retums it. 16. Write a function named display that takes an int and a string, and displays the string on the console the number of times specified by the int. Have each message appear on its own line. Retum nothingStep 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