Question: Using C++ (use prototype function) Create a program with one main function and at least four other functions. Create a string called name in the
Using C++ (use prototype function)
Create a program with one main function and at least four other functions.
Create a string called name in the main function to hold a complete first and last name. Call a function to ask the user to enter the first name. Then ask the user to enter the second name. Concatenate the two names together so it will print out as a first name space last name with the other callouts at the end. Return the concatenated name as the return value of the function to main.
Create an array called addIt that can contain 10 integers in the main function. Call a function, passing the array addIt that will allow the user to enter up to 10 integers. If the user enters -99 then the loop should stop there and return to the main function, otherwise, accept 10 integers before returning.
From main, pass the array addIt to a function that will loop to step through all the numbers in the array and add them together. Return the sum of all the numbers as the return value of the function to main.
From main, pass the array to a function that will sort the array in a descending order.
Print to the screen the full name entered. Then print the currently sorted array and the sum of all the numbers in the array. Use a format that tells me what each item is, ie The name is: The sum of the array is: The array is as follows, sorted descending:
Thoughtfully comment your code. And use prototype function!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
