Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is a C++ program (FinalQ1.cpp) with errors (syntax errors and/ or logical errors, if any). Please fix all errors. #include #include #define SIZE 3

This is a C++ program (FinalQ1.cpp) with errors (syntax errors and/ or logical errors, if any). Please fix all errors.

#include #include #define SIZE 3

using namespace std;

string getType() { string *p_data = new string; cout > *p_data; return *p_data; }

void setBusinessData(string caption, int *p_data[]) { cout > *p_data; }

int highestProfit(string *t[], int *c[], int *s[], float *hpp) { float profit_percent, highest_percent = 100; int idx; cout

// Start main function int main() { string *types [SIZE]; int *capital [SIZE]; int *sale [SIZE]; float *hp_profit = new int; // highest percentage of profit // Examples of business types, capital & total sale // Delivery - RM 300 - RM 450 // Hawker - RM 750 - RM 900 // Tailor - RM 500 - RM 550 for (int i = 0; i

cout

Output should be

image text in transcribed

Business type: Delivery Capital (RM): 300 Sale (RM): 450 Business type: Hawker Capital (RM): 750 Sale (RM): 900 Business type: Tailor Capital (RM): 500 Sale (RM): 550 Check profit percent: Delivery - 50% Hawker - 20% Tailor - 10% Most profitable business is Delivery with 50% of profit over the capital 4 /4 00

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transact SQL Cookbook Help For Database Programmers

Authors: Ales Spetic, Jonathan Gennick

1st Edition

1565927567, 978-1565927568

Students also viewed these Databases questions