Question: 1. Say a program computes two integer quantities inventory-Number and numberOrdered. Write a single output statement that prints these two quantities along with appropriate text

1. Say a program computes two integer quantities inventory-Number and numberOrdered. Write a single output statement that prints these two quantities along with appropriate text information.

2. The variables age and weight currently have the values 32 and 187, respectively. Write the exact output generated by the following statement:

print(Your age is + str(age)\ + and your weight is\ + str(weight))

3. In the SportsWorld program of Figure 14, the user must respond with C to choose the circumference task. In such a situation, it is preferable to accept either uppercase or lowercase letters. Rewrite the condition in the program to allow this.

*Note: Please give your answers according to how it would be done in Python1. Say a program computes two integer quantities inventory-Number and numberOrdered. Write

FIGURE 14 The SportsWorld Program #This program helps SportsWorld estimate costs # for pool covers and pool fencing by computing #the area or circumference of a circle #with a given radius #Any number of circles can be processed . #Uses module math for pi &Written by M. Phelps, 10/05/13 import math print("Do you want to process a pool?" more = input ("Enter Y or N: ") while (more "Y") or (more "y"):tmore circles to process radius -float (input("Enter the value of the "radius of the pool:")) #see what user wants to compute print("nEnter your choice of task.") taskToDoinput ("C to compute circumference," "A to compute area: ") if taskToDo-- "C": #compute circumference circumference2*math.piradius print(" The circumference for a pool of radius", radius, "is", circumference) else: #compute area area math . pi * radius * radius print("InThe area for a pool of radius", radius, "is", area) print("nDo you want to process more pools?") more-input("Enter Y or N: ) #finish up input(" n Press the Enter key to exit")

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!