Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming in C 1. You and a few friends are trying to earn a few extra dollars while in school and have started a lawn

Programming in C

1. You and a few friends are trying to earn a few extra dollars while in school and have started a lawn mowing service. Your service has been hired by a subdivision that pays for all lawn care. All of the lots and the homes in the subdivision are rectangular in shape. All homes also have a rectangular concrete driveway. Some homes have a single circular landscaped area that contains no grass that needs to be cut. Two hundred square feet of lawn can be mowed in one minute. Since you are doing all scheduling, you have decided to write a C program that estimates the amount of time it is going to take to mow a specific lawn. Write a program which will accept user input for lawn, house, driveway, and circle dimensions and will display both the number of square feet to be mowed and the time required to mow the lawn. Follow the guidelines below:

  • Define PI as a defined constant or declare as a constant with a value of 3.14159265.
  • Prompt the user each dimension value (lot width, lot length, house width, house length, etc)
  • If no circular landscaped area is present, the user should enter zero for the measurement(s).
  • Use floating point numbers for dimensions and area, but use integers for hours and minutes.
  • The area that is to be mowed should be displayed on the screen using two decimal digits.
  • The time required for the lawn to be mowed must be displayed in values of hours and minutes. Truncate to an even number of minutes. Do not round. (For example, 842.8 minutes = 14 hours and 2 minutes.)
  • Below are some values you might use to test your program:
    • Lawn width: 250 ft
    • Lawn length: 150 ft
    • House width: 75 ft
    • House length: 40 ft
    • Driveway width: 12 ft
    • Driveway length: 50 ft
    • Circle radius: 5 ft

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

Database Internals A Deep Dive Into How Distributed Data Systems Work

Authors: Alex Petrov

1st Edition

1492040347, 978-1492040347

Students also viewed these Databases questions