Computer Science(python)

posted by .

Service Price
Basic Lawn Mowing $20
Trimming and Sweeping $25
Pool Cleaning $50
Watering Plants $10

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'. Print out the total of the bill. Write this as efficiently as you can, using as few comparisons and if statements as possible, no more than 4 if statements.

Example run:
Enter your choices as y or n.
Do you want Basic Lawn Mowing? y
Do you want Trimming and Sweeping? n
Do you want Pool Cleaning? y
Do you want Watering Plants? n

The total for your services is $70
Thank you for your business!



I'm having a little trouble with this problem. Anyone got any ideas

Respond to this Question

First Name
School Subject
Your Answer

Similar Questions

  1. Computer Science-Java

    Hi, I have to prompt a user to input a password and have to verify whether or not it is a single word. How would I do something like?
  2. microeconomics problems

    The GreenAcres mowing company wants to buy the new “Titan3000” lawn mowers. Assume that the lawn mowers are expected to last indefinitely, that operating expenses are negligible, and that the price per acre of mowed lawn is expected …
  3. Programming Logic

    I need help creating a program to compare the value in input[0] with the value in input[1]. For example, if input[0] is less than input[1] print ‘input[0] is less than input[1]’; otherwise, print ‘input[0] is not less than input[1]’.
  4. Computer Programming

    I need a check on my answers 1) prompt a user to enter an employee name, employee id, and hours worked until a value of "-1" is entered for employye name. my answer: Start Declarations num EmployId, HrsWrked string EmployName housework() …
  5. java

    Write a java application that finds the smallest of several integers. Prompt the user for the number of integers that will be input, then prompt the user for that number of integers. Evaluate the integers to determine the smallest …
  6. programming

    Using Raptor, create a condition loop that will ask the user for input of two numbers. The numbers should be added and the sum displayed. The loop should also ask the user if he or she wishes to enter two more numbers and perform the …
  7. Computing: Simple Python

    Hi this is the code I'm working on, but every time I run it, every character inputted is printed, so hello becomes 'h','e','l','l','o', even numbers! I can't seem to fix it so that it can be added to the list and printed normally, …
  8. Microecon

    Juan mows lawns in his neighborhood for extra money. Suppose the demand for lawn mowing in Joe’s neighborhood is: QD = 48 – 2P and that the supply of lawn mowing (Juan’s willingness to mow lawns) is: Qs = -12 + P. The market-clearing …
  9. Multimedia

    Not sure if you will get this right away.. but here is the question... Prompt the user for their name and then prompt the user for a number between 1 and 12. After getting the input, you will display the user’s name and then display …
  10. Computer Science

    What is the rule for this function? input 1 output 2 input 2 output 5 Input 3 output 12 Input 4 output 34 Input 5 output 135 Input 6 output 741

More Similar Questions