Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Program Please Use The Template Below #include #define ?? // use at least one symbolic constant using namespace std; class Crop { } //

C++ Program

image text in transcribedimage text in transcribed

Please Use The Template Below

#include

#define ?? // use at least one symbolic constant

using namespace std;

class Crop {

}

// Function prototypes. void calculate(***); void inputData(***); void printResults(***);

int main() { -- loop - call global function to get data for a crop - call global function to perform calculations for the crop - call global function to display results for the crop - keep track of best crop

cout

void calculate(***) { }

void inputData(***) { }

void printResults(***) {

}

/* Copy the results of your program here. Replace the '***' with the appropriate parameter list for each function Remove all unused code */

Avg profit should be (Maximum profit + Minimum Profit)/2

the acre should be entered by user

Description Old MacDonald has a farm and not only does he have animals, he also has 1000 acres on which to grow his crops. The problem is that it is becoming more difficult to decide which crop is most profitable so he needs some help. Given the data below, write a program that will help Old MacDonald decide which crop is the most profitable to grow ushel $/bushel (increase) 0.54 0.43 0.61 0.72 Crop Cost per acre Yield (bushel/acre) $/b 47% 3.1% Sweet corn Wheat Soybeans Green beans 45.25 43.00 43.50 40.80 173 200 157 118 27% Program requirements 1 -Allow all the data from the table to be entered by a user (no % entered for increase) 2 - Calculate projected range of net profit and the average net profit for each crop Minimum Gross Profit (MnGP)- (yield $/bushel * acres) Maximum Gross ProfitMnGP (MnGP *(increase 100)) * You need to subtract the cost of growing the crop to get the net profit range 3 - Print out the minimum net profit, maximum net profit and the average net profit for each crop 4 - Tell Old MacDonald which crop he should plant to maximize his profit. The crop with the best average profit. Results of the program Enter the crop name: Sweet corn Enter cost, yield, price per bushel, and increase data: 45.25 173 0.54 4.7 Minimum Profit Maximum Profit $52560.75 Average Profit $50365.38 Sweet corn $48170.01 Enter the crop name: Wheat Enter cost, yield, price per bushel, and increase data: 43.00 200 0.43 3.1 Minimum Profit $43000.00 Maximum Profit $45666.00 Average Profit $44333.00 Wheat Enter the crop name: Soybeans Enter cost, yield, price per bushel, and increase data: 43.50 157 0.61 4.3 Minimum Profit $52270.01 Maximum Profit $56388.12 Average Profit $54329.06 Soybeans Enter the crop name: Green beans Enter cost, yield, price per bushel, and increase data: 40.80 118 0.72 2.7 Minimum Profit Maximum Profit $46453.93 Average Profit $45306.97 Green beans $44160.01 Old MacDonald, you should plant Soybeans Another Option Using arrays, gather and store all the input data before printing out the results. Results must be in the format shown below Enter the crop name: Sweet corn Enter cost, yield, price per bushel, and increase data: 45.25 173 0.54 4.7 Enter the crop name: Wheat Enter cost, yield, price per bushel, and increase data: 43.00 200 0.43 3.1 Enter the crop name: Soybeans Enter cost, yield, price per bushel, and increase data: 43.50 157 0.61 4.3 Enter the crop name: Green beans Enter cost, yield, price per bushel, and increase data: 40.80 118 0.72 2.7 ro Sweet corn Wheat Soybeans Green beans Minimum Profit $48170.01 $43000.00 $52270.01 $44160.01 Maximum Profit $52560.75 $45666.00 $56388.12 $46453.93 Average Profit $50365.38 $44333.00 $54329.06 $45306.97 Old MacDonald, you should plant Soybeans

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

More Books

Students also viewed these Databases questions

Question

Examine the three major pricing methods that firms employ.

Answered: 1 week ago

Question

10-9 How have social technologies changed e-commerce?

Answered: 1 week ago