This function displays a menu to the user. It will then accept the user\'s choic
ID: 3544358 • Letter: T
Question
This function displays a menu to the user. It will then accept the user's choice (as a string) and check it for validity - that is did the user enter a "1" or "2" or "3" or "4" or "Q" or "q"? If not, an error message should be displayed and the user should be given another chance to make a choice - this should continue until the user enters a valid value. Once a valid choice is made, the string should be returned to the calling function (main()). The menu should resemble the following:
This function will get an integer value from the user that is within a specified range. It takes three arguments: a string that will be part of the prompt that is displayed to the user, and two integers that represent the lower and upper bound for a specified range. It returns an integer value that is within the specified range.
The function should display a prompt to the user and accept a value. If the value is within the range, it should be returned to the calling function. If the value is invalid, display an error message and ask the user to to re-enter a value - this should be repeated until a valid value is entered.
A calling statement like:
should produce the following prompt to the user:
This function will perform the steps that are necessary to calculate and display an average. It should call thegetValue() function to prompt the user for a sum between -1000 and 1000, call the getValue() a second time to prompt the user for a count between 1 and 1000, pass the two values that were returned by the getValue() calls to the calcAverage() function, and then display the result that is returned by the calcAverage() function. The calculated average should be displayed with 3 digits after the decimal point.
This function will calculate an average. It takes two arguments: an integer that represents a sum of values and an integer that represents the number of values that were used to calculate the sum. It returns a double value, which is the calculated average.
This function will perform the steps that are necessary to calculate and display the factorial of a number. It should call the getValue() function to prompt the user for a value between 0 and 8, the value should be passed to thecalcFactorial() function, and then display the result that is returned by the calcFactorial()function.
This function will calculate the factorial of an integer. It takes one argument: the integer number to use in the factorial calculation. It returns an integer value, which is the calculated factorial of the number.
The factorial of a number is the product of the values between 1 and the number, inclusive. For example, 4! is equal to 1 * 2 * 3 * 4 = 24. The exception to the rule is 0!, which is equal to 1.
This function will perform the steps that are necessary to raise a number to a power and display the result. It should call the getValue() function to promt the user for a M value between 0 and 20, call the getValue() function to prompt the user for a N value between 1 and 7, those values should be passed to thecalcMtoN() function to calculate the result of raising M to the Nth power, and then the result should be displayed.
This function will calculate the result of raising M to the Nth power. It takes two arguments: the double M value and the integer N value to use in the calculation; and returns the result of raising M to the Nth power.
This function will perform the steps that are necessary to find and display the range of four integer numbers. It should call the getValue() function four times to prompt the user for four integer numbers that lie between -100 and 100, the four integer numbers should be passed to the calcRange() function, and then the calculated range should be displayed.
This function will find the range of four integer numbers. It takes four arguments: the four integer values to find the range of; and returns and integer: the range of the values.
The range is the difference betweeen the largest and the smallest of the four numbers.
Create and use at least four symbolic constants. They should represent the minimum and maximum values for the calculations of your choice.
The values inputted by the user should all be data type int.
The float/double result should be displayed with exactly 2 digits after the decimal point, including zeros.
As with the previous assignment and the assignments until the end of the semester, complete program documentation is required. For this assignment, that means that line documentation and function documentation boxes are needed. In regards to line documentation, there is no need to document every single line, but logical "chunks" of code should be preceded by a line or two that describe what the "chunk" of code does.
This is the program but its not running correctly and i cant figure out why. help plz
Explanation / Answer
Where is your code?
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.