Question: needed urgently!!!help #include #define MAX_WEIGHT 3.0 using namespace std; // function prototypes float get_Price; float get_Weight(); void postage(float, float); // start main function int main()

needed urgently!!!helpneeded urgently!!!help #include #define MAX_WEIGHT 3.0 using namespace std; // function prototypesfloat get_Price; float get_Weight(); void postage(float, float); // start main function intmain() { float weight == 0; // should not more than 3

#include #define MAX_WEIGHT 3.0 using namespace std;

// function prototypes float get_Price; float get_Weight(); void postage(float, float);

// start main function int main() { float weight == 0; // should not more than 3 kg float price = 0; // should > 0

weight = get_weight(); price = get_Price();

cout

// The postage function should able calculate and set price // which including postage cost postage(price, weight);

cout

return 0; }

// start new user-defined functions float get_price() { float p = 0;

cout > p; }

return p; }

void get_Weight() { float w = 0;

do { cout > w; } while (w MAX_WEIGHT);

return w; }

// weight more than 2 kg postage cost is RM 10 // weight 1 - 2 kg postage cost is RM 7 // weight less than 1 kg postage cost is RM 4 void postage(float p, float w) { float post = 0;

if (w >= 2) { post = 10; } else if (w > 1) { post = 7; } else { post = 4; }

cout Question 135 Marks] You are given a C++ program (Test201.cpp) with 11 errors (syntax errors and/ or logical errors, if any). The program is developed to calculate the total price of an item after the inclusion of postage cost. It has three (3) user-defined functions as listed below: Function Name get Weight get Price Description To get weight from the user. This function will keep asking the user to enter valid weight input (1 to 3 kg) To get price from the user. This function will keep asking the user to enter valid input if the price value entered is not a valid one. To calculate the postage cost based on the item's weight. Read the comment section before postage function definition for details about postage cost imposed on the iter based on its weight postage The main function of the program has cout statements to display the item price that was previously entered by the user via the get Price function and item price after a call to postage function was made. The postage fimction should able to update the item's price that includes postage cost imposed on the item based on its weight. You are required to debug the errors, couple, 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 outputs as in Figure 1. Note: The values in bold are input by the user. 1/Teatagi.PP include catre datin X_WIGIT 3.0 sing SPADR atd; // function prototypes float get_Pro lont get to void paataga lost, toat) 11 12 11 atat main function lost weight - 0; // horld not seen than 3 ks tlost price - D; 1/ sherid > 0 weight - pat_weight: price - gat_Frical): cout > : catum : 33 34 35 36 37 30 39 40 41 42 43 44 45 46 47 40 49 50 51 52 53 54 55 56 57 50 void qat_Wedght! lost - 0; de cout > WI Isle IN ODE> RX_WINE); satu w > // weight more than 2 k postage coat is RM 10 1/ weight 1 - 2 kg postage at IT? 1/ weight loss than 1 kg poutage sont 4 void postage (tlost p. tlost ! tlost post - 0; 60 61 peat - 10: 62 64 65 poat- pont - 41 67 GD 69 70

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!