## CS 115 Lab 4 (Team)

### 80 Points

Due Date: Monday September 17 during lab section

Educational goals of this lab

• practice with if statements
• practice with sep=
• practice with accumulators

The Problem

A landscaping company wants a program that will calculate how much a customer's bill will be depending on what services they want to have.

(20 points) Team Problem #1: Test cases

• Use the table of prices below to answer the questions.
• Fill out what the outputs should be
• Put them comments at the end of the program file.
• Do these FIRST before the program is started!
• Description Input
4 or 5 y's and n's
Expected Output
Example y,y,n,n,y Total bill is \$45
Only one service, not mowing n,n,y,n ___A.___
Only one service, mowing, small yard y,y,n,n,n ___B.___
Three services desired n,y,y,y ___C.___
No services desired n,n,n,n ___D.___
All services, large yard y,n,y,y,y ___E.___

(20 points) Team Problem #2: Write a design

• Write a design for this problem. To save yourself time, put them in a .py file and make each step a comment. It can be very high-level steps.
• You do NOT have to NUMBER the steps!
• State the three P's (purpose, pre-conditions and post-conditions).
• Don't forget Team members' names (who are present) and the team number.

(40 points) Team Problem #3: Calculating a bill

• Starting with the design from problem #2, write a program that will get some input from the user about a lawn mowing service. The program will calculate the bill for the services requested.
• The services available are
• ServicePrice
Mowing (small yard)\$25
Mowing (not small yard)\$35
Application of Pesticides\$15
Flower Bed Weeding\$10
Tree Trimming\$20
• Prompt the user to input whether or not they want each of the services. You can assume the input will be a character that is either a 'y' or an 'n'.
• You need to compare a variable to a constant string. Quotes are used around the constant.
• Use some of the augmented operators to find the total of the bill. Use some accumulator statements. All the service fees are integers.
• Print out the total of the bill.
• Note one of the questions is in two parts. You have to ask them first if they want mowing. If they say yes, then you ask large or small. If they say no, you move on to the next thing. Write this as efficiently as you can, using as few comparisons and if statements as possible.
• Example run:
```Please enter your choices as y or n
Mowing? (y/n) y
Small yard? (y/n) n
Application of Pesticides? (y/n) n
Flower Bed Weeding? (y/n) y
Tree Trimming? (y/n) y