Question: You are given a C++ program (Final01.cpp) with errors (syntax errors and or logical errors, if any). The program has two (2) user-defined functions as

 You are given a C++ program (Final01.cpp) with errors (syntax errors
and or logical errors, if any). The program has two (2) user-defined
functions as listed in Table 1. Table 1: Description of functions Function

You are given a C++ program (Final01.cpp) with errors (syntax errors and or logical errors, if any). The program has two (2) user-defined functions as listed in Table 1. Table 1: Description of functions Function Name Description getSpec The function accepts two arguments. The first argument is the caption text to guide users to enter a correct type of car's attributes. The second argument is the car's attribute itself which was represented by a parallel array of pointers type for variables: models, horsepower, and weight. The getSpec function assigns data entered by the users to the corresponding item of these array variables with their index is based on variable used to control the loop. fastestModel The function accepts three arguments that are the models, horsepower, and weight parallel array pointer variables. It calculates the weight/horsepower ratio of each car's model and then returns the index number of array item which representing the fastest car (car's model which has the lowest weight/ horsepower ratio). The main function of the program has a series of calls to getSpec function inside a loop control structure. The models, horsepower, and weight are parallel pointer type arrays with references to their item's index was made based on variable used to control the loop (loop which used to make a series of call to getSpec function). Some of the output was produced by a call made to fastestModel function. The last part of the output produced after the index number of parallel array items representing the fastest car was returned by the fastestModel function. You are required to debug the errors, compile, and run the program. You are NOT ALLOWED to remove any statements in the program. You are only allowed to update the statements provided in the program and add a new statement(s) if absolutely necessary The program should produce the output as in Figure 1. Note: The values in bold are input by the user. 2 //Finall.cpp #include #define SIRE 4 using namespace std; void getSpectating caption string *p_data! cout > P data: void get spectatring caption, int p_data) cout

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!