SYCS-135 INTRODUCTION TO PROGRAMMING

 

ASSIGNMENT 3

 

Due Date: September 16, 1999 at 8:10 AM in class

 

Problem:� Harriet and Henry Higginbottom are doing gardening work this summer to earn money to buy a computer.� They have prepared flyers to post around their neighborhood offering a lawn-mowing service, but they have not decided how to charge for their work.� Harriet wants to charge by the hour; Henry wants to charge by the area of grass cut.� In order to determine which method of charging is more advantageous, Harriet and Henry have decided to compare the two methods using their own rectangular lawn as a test.

 

Harriet and Henry measure the length and width of their own lawn by pacing out the perimeter.� They measure their stride (a single walking step) and find it is 2ft. 6 inches.�� They then cut the lawn timing how many minutes it takes.

 

Assuming that they charge their parents $10 for cutting the lawn, design and implement a program to calculate:

 

1.� Their hourly rate to cut the lawn

2.� Their charge per square foot to cut the lawn

 

Problem Input:� three integers in the following sequence:

 

length of lawn in paces

width of lawn in paces

time to cut lawn in minutes

 

ASSIGNMENT SUBMISSION: �Hand in a copy of your algorithm in pseudocode, your test oracle and desk-checking calculations, your C++ program compilation listing, and output listing obtained from running your program with your test data.

 

Pseudocode:� A 1-page description of your algorithm in pseudocode.

 

Test Oracle:� Choose one or more sets of data.� For each set of data, use your algorithm to calculate by hand (you can use a calculator) the answer to the problem and write down this answer.� Make sure that you have included any unusual sets of data.

 

Program Input:� One set of test data.

 

Program Output: �First print out the your name, Howard U. ID number, course number and title, assignment number, and date, followed by a description of the problem.

 

Then print the input data with appropriate headings.�

 

Next print the lawn area in square feet, the hourly rate per hour to cut the lawn and the rate per square foot to cut the lawn if the charge is $10.� Include appropriate headings to make your output understandable.� All money amounts must be printed with 2 decimal places and a dollar sign ($).

 

Program Documentation:� At the top of your source code as a comment, include your name, Howard U. ID number, course number and title, assignment number, and date, followed by a description of the problem (This same information should also be printed out at the top of your output).� Include comments as necessary throughout your program to illustrate the algorithm, logic of flow, meaning of variables etc.� Follow the style guidelines described in class.