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.
Crop, Cost per acre, Yield (bushel/acre), $/bushel, $/bushel (increase)
Program requirements:
1 - Allow all the data from the table to be entered by a user (no $, no % entered).
2 - Calculate projected range of profit and the average profit for each crop.
3 - Print out the projected range of profit and the average profit for each crop. Crop Minimum Profit Maximum Profit Average Profit
Crop - Minimum Profit - Maximum Profit - Average Profit Sweet Corn
Wheat
Soybeans
Green beans
4 - Tell Old MacDonald which crop he should plant to maximize his profit.;
im extremely confused and have basically resorted to random guessing in order to figure ouw how to take the numbers provided and allow the user to enter them, which the computer will then use calculate Minimum Profit, Maximum Profit, and Average Profit for the crop. Please help if you can, i know my code is quite messy and confused in nature. Any help would be greatly appreciated! Thank you for your time.
// Suggestions:
// Start by creating a program that handles information for one crop and build from there.
//Code one function at a time and test it.
//Clarification:
//The output displayed on the assignment sheet included borders, your output does not //need to include these, it just needs to be displayed in formatted columns.
//- Dollar amounts should be formatted to 2 decimals places and be displayed with a $.
Assignment #1
#include<iostream>
#include<iomanip>
#include<fstream>
using namespace std;
int main()
{
int numrec; //Given
string cropName[50];
double costperAcre[50],yield[50], dperB[50],dperBINC[50];
ifstream inFile;
ofstream outFile;
inFile.
int cost;
int grossMin;
int grossMax
int netMin;
int netMax;
int netAve;
int yield;
cout<<"\nData for the first crop:\n"; //Display data stored for the first crop->printData(&first);
cout<<endl<<endl;
cout<<"\nData for the second crop:\n";//Display data stored for the second crop->printData(&second);
cout<<endl<<endl;
when your first post on this forum is asking for homework help, we know you don't love learning.
Try and use the code tags, bottom right corner of text box, <> picture, people are more inclined to help you if 1. You show your own attempt at coding it and 2. You make it look nice