Question: 1 Question 35 Marks //Final01.cpp #include #include #define SIX 3 You are given a CH program (Finalqi.cpp) with errors (syntax errors and/ or logical crrors,

 1 Question 35 Marks //Final01.cpp #include #include #define SIX 3 You

1 Question 35 Marks //Final01.cpp #include #include #define SIX 3 You are given a CH program (Finalqi.cpp) with errors (syntax errors and/ or logical crrors, if any). The program has three (3) user-defined functions as listed in Tablc 1. 3 4 5 using r.amespace std; 7 string getType() string *p data - new string; cout >#p_data; Function Name getType celuen pala setBusinessData void setBusinessData(atring *caption, int *p_data[]} cout > *p_data: Table 1: Description of functions Description The function asks the users to enter business type and then return the entered data as a string pointer-type variable. The returned business type is later assigned as an item of string pointer type array variable named types. The function accepts two arguments. The first argument is the caption text to guide users to enter the capital or the sale of the business. The second argument is either the capital or the sale data represented by an array of integer pointer type variables: capital and sale. The setBusinessData function assigns data entered by the users to the corresponding item of these array variables. The function accepts three arguments that are the types, capital, and sale parallel array pointer-type variables. It calculates the profit's percent over the capital for cach business type. For example, delivery profit percent was calculated as: (450 - 300)/300*100. The function also returns the index number of array items which representing the highest profit percent of business. int highest Profit (string 'tu. Int C[], int *st), float "hop) float profit percent, highest percent - 100; int idx; COLL "Check profil percent: "; 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 highest Profit for (int i - 0; i #include #define SIX 3 You are given a CH program (Finalqi.cpp) with errors (syntax errors and/ or logical crrors, if any). The program has three (3) user-defined functions as listed in Tablc 1. 3 4 5 using r.amespace std; 7 string getType() string *p data - new string; cout >#p_data; Function Name getType celuen pala setBusinessData void setBusinessData(atring *caption, int *p_data[]} cout > *p_data: Table 1: Description of functions Description The function asks the users to enter business type and then return the entered data as a string pointer-type variable. The returned business type is later assigned as an item of string pointer type array variable named types. The function accepts two arguments. The first argument is the caption text to guide users to enter the capital or the sale of the business. The second argument is either the capital or the sale data represented by an array of integer pointer type variables: capital and sale. The setBusinessData function assigns data entered by the users to the corresponding item of these array variables. The function accepts three arguments that are the types, capital, and sale parallel array pointer-type variables. It calculates the profit's percent over the capital for cach business type. For example, delivery profit percent was calculated as: (450 - 300)/300*100. The function also returns the index number of array items which representing the highest profit percent of business. int highest Profit (string 'tu. Int C[], int *st), float "hop) float profit percent, highest percent - 100; int idx; COLL "Check profil percent: "; 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 highest Profit for (int i - 0; i

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!