Question: solve in c++ Part II: Implement References using Functions (5 pts) To help you practice functions, you will write a short program that asks the

solve in c++
solve in c++ Part II: Implement References using Functions (5 pts) To
help you practice functions, you will write a short program that asks

Part II: Implement References using Functions (5 pts) To help you practice functions, you will write a short program that asks the user to enter a string (get_string ()), then makes a copy of the string, and takes the copy and changes all non-space letters to dashes (set_replace_string ()). The program then gets a letter from the user to search in the original string and replace the dashes in the copy string with the letter found, returning the number of letters found (get_search_replace ()). (2 pts) You should design first. You can have more functions, but you must have at least the three below with the EXACT function prototypes. Each of your functions should have the proper function headers/descriptions I/ prompt the user to get a string input, and store it into str_to_store void get_string (string \&str_to_store); I/ take the copy of the string (copy_str), change all non-space letters to dashes, and store it into dash_str void set_replace_string (string copy_str, string \&dash_str); //take a char from the user (c), search in copy_str, and replace the dash(es) in dash_str with the letter found // return the number of letters found int get_search_replace (char c, string copy_str, string \&dash_str); Write the function headers/descriptions for each of the functions above, as well as all the functions you create. This includes information about parameters, return values, and pre/post conditions. Design - Give as much detail as possible for the main function and all the functions above. - Why do the function prototypes have the specific parameter types on them? - Why do the functions have void or a return value? - How do all the functions interact together? Testing - Provide testing values with expected results. - What do you plan to use as bad values? Good values? - What do you expect to happen with bad values? Good values? Get checked off by a TA before beginning to implement. This will help with logic and function mistakes. (3 pts) Now, incrementally write your functions and program. Part III: More Array Practice ( 3 pts) Write another program that does the following, using the given prototypes: 1. Create an array of 20 integers 2. Populate the array with random numbers from -100 to 100 , inclusive 3. Write functions that calculate the sum of the array, and find the largest and smallest elements 4. Output the sum, largest and smallest elements of the array Prototypes: void populate_array (int arr [], int size); int find_sum(int arr [], int size); int find_max (int arr [] , int size); int find_min(int arr [] , int size); Show your completed work to the TAs for credit. You will not get points if you do not get checked off

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!