C++ Programming: From Problem Analysis to Program Design
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN: 9781337102087
Author: D. S. Malik
Publisher: Cengage Learning
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 4, Problem 19PE

Ron bought several acres of farm to grow and sell vegetables. Suppose that Ron wants to grow a maximum of two types of vegetables. Write a program that prompts Ron or the user to do the following:

  1. Enter the total farm area in acres.
  2. The number of vegetables (one or two) that the user wants to grow.
  3. If the user wants to grow trwo types of vegetables, then specify the portion,as a percentage, of the farm land used for each type of vegetable.
  4. Enter the seed cost, plantation cose, fertilizing cost, labor cost, for each acre.
  5. Enter vegetable selling price per acre.
  6. Output the total revenue.
  7. Output the profit/loss.
Blurred answer
Students have asked these similar questions
The company discounted used cars pays their employees according to this chart: 250$ per months plus 50$ per car sold. If the salesman sells more than 10 cars, the employee receives a bonus of 5% of the total of his sales, in addition to his regular salary.Each month, the owner sits in front of the computer, and enters the following information: The name of the employee, the number of cars sold, as well as the total of all the sales for the month.  algorithm that will calculate the salary of an employee for the month, and then display on the screen, his name, total cars sold, base salary, bonus if applicable and entire salary
Question: Party budget planning - complex Prompt the user to enter their current budget and the number of people who need to share a meal. You are ordering food from a restaurant that has two menu items: Tacos $4 Empanadas $3 Calculate and print out all the options of meals where the budget is used entirely(where possible) and each person has an equal number of items to eat. They may eat different things, but everyone gets the same number of food items, e.g. 2 tacos or 1 empanada and 1 taco or 2 empanadas. Hints: Here are some things that might help you in your solution. If total items purchased does not equally divide by the number of diners, then abandon that combination. It may help to calculate the max number of empanadas that the budget can buy and also the max number of tacos that the budget could buy. These can be thought of as upper bounds in your loops. In your solution, keep track of items per person Also, keep track of total number of viable solutions, as that might…
Question: Party budget planning - complex Prompt the user to enter their current budget and the number of people who need to share a meal. You are ordering food from a restaurant that has two menu items: Tacos $4 Empanadas $3 Calculate and print out all the options of meals where the budget is used entirely(where possible) and each person has an equal number of items to eat. They may eat different things, but everyone gets the same number of food items, e.g. 2 tacos or 1 empanada and 1 taco or 2 empanadas. Hints: Here are some things that might help you in your solution. If total items purchased does not equally divide by the number of diners, then abandon that combination. It may help to calculate the max number of empanadas that the budget can buy and also the max number of tacos that the budget could buy. These can be thought of as upper bounds in your loops. In your solution, keep track of items per person Also, keep track of total number of viable solutions, as that might…
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Python Tutorial #10; Math Functions in Python; Author: Art of Engineer;https://www.youtube.com/watch?v=OviXsGf4qmY;License: Standard YouTube License, CC-BY