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 owners of the Annan Supermarket would like to have a program that computes the weekly gross pay of their employees. The user will enter an employee’s first name, last name, the hourly rate of pay, and the number of hours worked for the week. In addition, Annan Supermarkets would like the program to compute the employee’s net pay and overtime pay. Overtime hours, any hours over 40, are paid at 1.5 the regular hourlyrate. Net pay is gross pay minus taxes (Refer to the tax table on the second page).Define a class called Employee. The class must have private attributes to store the employee's name, hourly rate, and regular (≤ 40) and overtime hours worked. The class must also have methods to perform the following tasks:• A constructor to initialize the hourly rate to the minimum wage of $7.25 per hourand the hours worked (regular and overtime) to 0.0.• A method to get (a setter/mutator method)⬧ the employee's name⬧ the hourly rate⬧ the hours work for the month (by the week – assume 4…
The owners of the Annan Supermarket would like to have a program that computes the weekly gross pay of their employees. The user will enter an employee’s first name, last name, the hourly rate of pay, and the number of hours worked for the week. In addition, Annan Supermarkets would like the program to compute the employee’s net pay and overtime pay. Overtime hours, any hours over 40, are paid at 1.5 the regular hourly rate. Net pay is gross pay minus taxes (Refer to the tax table on the second page). Define a class called Employee. The class must have private attributes to store the employee's name, hourly rate, and regular (≤ 40) and overtime hours worked. The class must also have methods to perform the following tasks: A constructor to initialize the hourly rate to the minimum wage of $7.25 per hour and the hours worked (regular and overtime) to 0.0. A method to get (a setter/mutator method)⬧ the employee's name⬧ the hourly rate⬧ the hours work for the month (by the week –…
The great circle distance is the distance betweentwo points on the surface of a sphere. Let (x1, y1) and (x2, y2) be the geographicallatitude and longitude of two points. The great circle distance between the twopoints can be computed using the following formula:d = radius X arccos(sin (x1) X sin(x2) + cos(x1) X cos(x2) X cos(y1 - y2))Write a program that prompts the user to enter the latitude and longitude of twopoints on the earth in degrees and displays its great circle distance. The averageradius of the earth is 6,371.01 km. Note you need to convert the degrees into radiansusing the Math.toRadians method since the Java trigonometric methods useradians. The latitude and longitude degrees in the formula are for north and west.Use negative to indicate south and east degrees. Here is a sample run:   Enter point 1 (latitude and longitude) in degrees: 39.55 −116.25 ↵EnterEnter point 2 (latitude and longitude) in degrees: 41.5 87.37 ↵EnterThe distance between the two points is…
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
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Python Tutorial #10; Math Functions in Python; Author: Art of Engineer;https://www.youtube.com/watch?v=OviXsGf4qmY;License: Standard YouTube License, CC-BY