Question: I need help with C++, not really good with advanced concepts and shortcuts so if you could keep it very basic it would be very
I need help with C++, not really good with advanced concepts and shortcuts so if you could keep it very basic it would be very much appreciated. Thank you in advanced.//Example program #include #include #include using namespace std; const float WOLF_PRICE = 55.00; const float RABBIT_PRICE = 15.00; const float STEAK_PRICE = 12.00; //all of the above are measured in $/yd^3 //--------------------------------------------------------------------------- // Name: GetYorN // Parameters: Questions, string, input, the YN question to ask // Returns: char; the character the user entered. Must be 'y' or 'Y' or 'n' or 'N' // Purpose: This function returns the user's response to a yeso question //--------------------------------------------------------------------------- char GetYorN(const string Question) { char choice; cout > choice; choice = toupper(choice); while (choice != 'Y' && choice != 'N') { cout > choice; choice = toupper(choice); } return (choice); } //--------------------------------------------------------------------------- // Name: GetLoadChoice // Parameters: reference char choice // Returns: none (passed in via reference), Must be 'R', 'W', or 'S' // Purpose: Determine which of the items the user would like to ship // //--------------------------------------------------------------------------- void GetLoadChoice(char &choice) { cout > choice; choice = toupper(choice); while(choice != 'W' && choice != 'S' && choice != 'R') { cout > choice; choice = toupper(choice); } } //--------------------------------------------------------------------------- // Name: AddLoad // Parameters: const char loadChoice - the type of item to be shipped // Returns: float cost // Purpose: Find the (positive integer) quantity of yards to be shipped, then // add the appropriate price to the total //--------------------------------------------------------------------------- float AddLoad(const char loadChoice) { float cost = 0.0; int quantity = 0; cout > quantity; while(quantity = 0. "; cout > quantity; } if (loadChoice == 'W') cost = cost + quantity * WOLF_PRICE; else if (loadChoice == 'S') cost = cost + quantity * STEAK_PRICE; else cost = cost + quantity * RABBIT_PRICE; return cost; } //--------------------------------------------------------------------------- // Name: PrintMain // Parameters: none // Returns: none // Purpose: Prints the main menu for the shipping scheduler //--------------------------------------------------------------------------- void PrintMain() { cout
1. Problem Statement: The objective of this programming assignment is to become familiar with calling C++ functions. You will be modifying an existing program: hw4a.cpp. Your task is to write a main program to accomplish certain goals by calling functions that are already written and provided to you Aesop Shipping LLC is a freight company that schedules loads of three live arctic wolves, live arctic rabbits, and frozen steak. Due to the nature of the shipments, some restrictions are in place. Orders consist of 1 or more shipments Each shipment consists of a pair of loads Each load consists of one of the three commodities Live wolves and rabbits cannot be shipped in the same shipment, for obvious reasons. Steak requires refrigerated cars (the animals won't mind, they're arctic). . Your task is to use the provided functions to write a main function that will prompt the user for the information you will need to calculate the total bill. The prices, necessary variables, and functions are already provided. Your task is to get what and in what quantity the user wants to ship, ensure that all restrictions are not being violated, and print the total cost of the shipment if it is valid 2. Design Once you have an idea of what needs to be done, think about how you can use the provided functions in your main) function, which actual parameters need to be passed to the functions, the type of parameters that are being used and how you can use the return values. A skeleton of the main program is included with comments showing the necessary steps where work needs to be provided. The necessary variables for your program are already declared, therefore all you need to do is use them in your work Do not change the functions themselves
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock


//Example program #include #include #include using namespace std; const float WOLF_PRICE = 55.00; const float RABBIT_PRICE = 15.00; const float STEAK_PRICE = 12.00; //all of the above are measured in $/yd^3 //--------------------------------------------------------------------------- // Name: GetYorN // Parameters: Questions, string, input, the YN question to ask // Returns: char; the character the user entered. Must be 'y' or 'Y' or 'n' or 'N' // Purpose: This function returns the user's response to a yeso question //--------------------------------------------------------------------------- char GetYorN(const string Question) { char choice; cout > choice; choice = toupper(choice); while (choice != 'Y' && choice != 'N') { cout > choice; choice = toupper(choice); } return (choice); } //--------------------------------------------------------------------------- // Name: GetLoadChoice // Parameters: reference char choice // Returns: none (passed in via reference), Must be 'R', 'W', or 'S' // Purpose: Determine which of the items the user would like to ship // //--------------------------------------------------------------------------- void GetLoadChoice(char &choice) { cout > choice; choice = toupper(choice); while(choice != 'W' && choice != 'S' && choice != 'R') { cout > choice; choice = toupper(choice); } } //--------------------------------------------------------------------------- // Name: AddLoad // Parameters: const char loadChoice - the type of item to be shipped // Returns: float cost // Purpose: Find the (positive integer) quantity of yards to be shipped, then // add the appropriate price to the total //--------------------------------------------------------------------------- float AddLoad(const char loadChoice) { float cost = 0.0; int quantity = 0; cout > quantity; while(quantity = 0. "; cout > quantity; } if (loadChoice == 'W') cost = cost + quantity * WOLF_PRICE; else if (loadChoice == 'S') cost = cost + quantity * STEAK_PRICE; else cost = cost + quantity * RABBIT_PRICE; return cost; } //--------------------------------------------------------------------------- // Name: PrintMain // Parameters: none // Returns: none // Purpose: Prints the main menu for the shipping scheduler //--------------------------------------------------------------------------- void PrintMain() { cout