Question
This is for C++, I was wondering if anyone could help me Please use as a reference Programming Challenge #1 Sum Of Numbers of your
This is for C++, I was wondering if anyone could help me
Please use as a reference Programming Challenge #1 "Sum Of Numbers" of your textbook on page 297. You will need at least 4 functions: menu, summation, factorial, and exponential.
Make sure that your header block shows that you have functions and how information is passed between them. Each function should have its own header block. A header block is comprised of several lines of comments at the top of each function that explain what the function does. See program 6-28 in your chapter for examples.
Think about the scope of your variables. Variables used only inside of the function should be declared locally to that function. No global variables, please. Return "choice" from displayMenu function. And, (for example) if you have a counter variable down in Summation, then declare it locally to Summation.
Make the menu display and resultant output look very clean and professional.
Same validation requirements as what you submitted for previous assignments such as invalid selection etc.
Pseudocode for the main function might look like this:
main()
do
choice = displayMenu (this function will return the user's choice)
switch on choice
case 1
call function to handle summation
case 2
call function to handle factorial
case 3
call function to handle exponential
case 4
output goodbye statement
case 5
handle incorrect choice (ie, choice not 1-4)
end switch
while (choice not equal to 4)
end main
--------pseudocode for displaymenu function
int function displayMenu()
output the menu
input the user's choice
return choice
-------pseudocode for function summation
void function summation()
prompt for summation maxNumber
input maxNumber
while (maxNum <0 or maxnum> TOOBIG)
output error message
input maxNumber
end while
etc.....
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