Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i need help with this question please, C++ computer language Description You bought several acres of farm to grow and sell vegetables. Suppose that you

i need help with this question please, C++ computer languageimage text in transcribedimage text in transcribedimage text in transcribed

Description You bought several acres of farm to grow and sell vegetables. Suppose that you want to grow a maximum of two types of vegetables. Write a program that prompts the user to do the following 1. Enter the total farm area in acres (double) 2. The number of vegetables (one or two) that the user wants to grow (int) 3. If the user wants to grow two types of vegetables, then specify the portion, as a percentage, of the farm land used for each type of vegetable (read two int variables) 4. Enter the seed cost, plantation cost, fertilization cost, labor cost, for each acre (all double values) 5. Enter vegetable selling price per acre 6. Output the cost to produce vegetables 7. Output the profit/loss Specifications In order to get full credit, your code must contain/perform the following * Variables with correct type with meaningful names . Comment your code, comment the variables and parts of code for input, output, and calculations . Program must compile and run with any input Once again, use iomanip to format the output (two decimal places and aligned properly) . Check for input failure and use exit(0) to terminate your program whenever you have any failure, you need to include cstdlib in order to use this function Input failure is if a non number is entered or if a non positive number is entered . If the number of vegetables is not 1 or 2 you will also need to terminate the program If two vegetables are entered, and if the two percentages read do not sum up to 100, terminate the program

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

SQL Database Programming

Authors: Chris Fehily

1st Edition

1937842312, 978-1937842314

More Books

Students also viewed these Databases questions