Update our Doggy Day Care logic: pseudocode and Flowchart, to now continue to process customer bills until a sentinel loop control variable (pgs. 21, 171) is entered for: input ID number of the dog's owner = 0. Once the user enters 0 for the dog owners ID the program exits the loop and ends the processing of customer bills. write a Phyton program for a Doggy Daycare facility that needs a program to print a customer's bill. The program accepts input data for an ID number of the dog's owner, dog name, dog breed, dog age and dog weight. Display a bill containing all the input data items as well as the weekly day care fee, which is $55.00/wk for dogs under 15 pounds, $75.00 for dogs from 15 pounds to 30 pounds inclusive, $105.00 for dogs from 31 pounds to 80 pounds inclusive, and $125.00 for dogs over 80lbs.
based on this information
Required:
Update our Doggy Day Care logic: pseudocode and Flowchart, to now continue to process customer bills until a sentinel loop control variable (pgs. 21, 171) is entered for: input ID number of the dog's owner = 0. Once the user enters 0 for the dog owners ID the
write a Phyton program for a Doggy Daycare facility that needs a program to print a customer's bill. The program accepts input data for an ID number of the dog's owner, dog name, dog breed, dog age and dog weight. Display a bill containing all the input data items as well as the weekly day care fee, which is $55.00/wk for dogs under 15 pounds, $75.00 for dogs from 15 pounds to 30 pounds inclusive, $105.00 for dogs from 31 pounds to 80 pounds inclusive, and $125.00 for dogs over 80lbs.
Code:
while True:
ID = int(input("\nEnter ID: "))
if ID == 0:
break
name = input("Enter Name: ")
breed = input("Enter Breed: ")
age = float(input("Enter Age: "))
weight = float(input("Enter Weight: "))
print("\n__________________ Bill __________________")
print(f'ID\t\t\t:\t{ID}')
print(f'Name\t\t:\t{name}')
print(f'Breed\t\t:\t{breed}')
print(f'Age\t\t\t:\t{age}')
print(f'Weight\t\t:\t{weight}')
if weight<15:
print(f"Daycare Fee\t:\t$55")
elif 15<=weight<=30:
print(f"Daycare Fee\t:\t$75")
elif 30<weight<=80:
print(f"Daycare Fee\t:\t$105")
elif weight>80:
print(f"Daycare Fee\t:\t$125")
Submit Modularized Doggy Day Care FlowChart
submit DoggyDayCareMod.py
pseudocode:
define module calculate_fee(w): takes in the weight and returns the fee amount,
contains our selection structure to calculate fee from dog weight
def module end_of_job(): prints out "Doggy Day Care program has ended"
define variables for all the doggy information
get person_id
while person_id doesn't equal 0
input rest of doggy information
call calculate_fee(weight) pass in the weight
print out Doggy informtion along with the fee that was calculated
call end_of_job() that prints out program has ended
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 3 images