Fuunctions and stub1. Your task is to write a C++ program which performs one of three operations basedon the input values. Once again we will only input integers. All of the inputs willbe non-negative. This program will run in a loop, asking the user for values, makingcomputations, printing results, until the user inputs the sentinel value of -9999.(a) Your program will prompt the user for a non-negative integer.This prompt and input MUST be done with a function.If the user inputs a negative value that is not the sentinel value you willdisplay the prompt again and read another value until either a non-negativevalue is input or the sentinel value is input.This function will have no arguments (void).It will return an integer.Its prototype is exactlyint myPrompt( void );The return value will be either a non-negative integer or the sentinel value.(b) If the user inputs a value from 10 to 50 (inclusive), then you will compute thesum of the numbers between 1 and the input value.This computation MUST be done with a function.This function will take as an argument a single integer.It will return an integer.Its prototype is exactlyint mySum( int );(c) If the user inputs a non-negative value less than 10, then you will compute theproduct of the values between 1 and the number.This computation MUST be done with a function.This function will take as an argument a single integer.It will return an integer.Its prototype is exactlyint myProd( int );Note that if the user enters 0, the result should still be 1.(d) If the user inputs a value greater than 50, then you will compute the remainderof that value divided by 13.This computation MUST be done with a functionThis function will take as an argument a single integerIt will return an integer.Its prototype is exactlyint myMod( int );(e) Once you have made a computation, you will print the result. This print outwill be one of1. The sum from 1 to 13 is 912. The product from 1 to 7 is 50403. The remainder of 68 / 13 is 3This output MUST be all generated by a function.This function will take as arguments two integers. The rst argument willbe used to determine which output line to print. The second argument isactual value that is being printed.It will return void.Its prototype is exactlyvoid myPrint( int, int );(f) All of the function prototypes will be before main().(g) There will be NO global variables. All the information the functions need orsupply will be in their arguments or return values.(h) All of the function denitions will occur after main().Should look likeEnter a non-negative integer (-9999 to end): 8The product from 1 to 8 is 40320Enter a non-negative integer (-9999 to end): 9The product from 1 to 9 is 362880Enter a non-negative integer (-9999 to end): 10The sum from 1 to 10 is 55Enter a non-negative integer (-9999 to end): 11The sum from 1 to 11 is 66Enter a non-negative integer (-9999 to end): 12The sum from 1 to 12 is 78Enter a non-negative integer (-9999 to end): 13The sum from 1 to 13 is 91Enter a non-negative integer (-9999 to end): 50The sum from 1 to 50 is 1275Enter a non-negative integer (-9999 to end): 51The remainder of 51 / 13 is 12Enter a non-negative integer (-9999 to end): 52The remainder of 52 / 13 is 0Enter a non-negative integer (-9999 to end): -9878Enter a non-negative integer (-9999 to end): 0The product from 1 to 0 is 1Enter a non-negative integer (-9999 to end): 1The product from 1 to 1 is 1Enter a non-negative integer (-9999 to end): 2The product from 1 to 2 is 2Enter a non-negative integer (-9999 to end): 3The product from 1 to 3 is 6Enter a non-negative integer (-9999 to end): -9999
Order Management

Premium Service
- 100% Custom papers
- Any delivery date
- 100% Confidentiality
- 24/7 Customer support
- The finest writers & editors
- No hidden charges
- No resale promise
Format and Features
- Approx. 275 words / page
- All paper formats (APA, MLA, Harvard, Chicago/Turabian)
- Font: 12 point Arial/Times New Roman
- Double and single spacing
- FREE bibliography page
- FREE title page
0% Plagiarism
We take all due measures in order to avoid plagiarisms in papers. We have strict fines policy towards those writers who use plagiarisms and members of QAD make sure that papers are original.