Question: Activity 1 . Now lets write a program to calculate a customers monthly Internet bill by using nested conditional. Suppose an internet service provider has
Activity 1.
Now lets write a program to calculate a customers monthly Internet bill by using nested conditional. Suppose an internet service provider has three different subscription packages for its customers:
Package A: $2.00 per hour plus $5 per month base fee.
Package B: $1.00 per hour plus for $10 per month base fee
Package C: $30 per month unlimited access is provided.
It should ask the user to enter the letter of the package the customer has purchased (A, B, or C) and the number of hours that were used. It should then display the total charge
# copy and paste your code here
Activity 2.
Let's return to the program sign.py. Suppose we want to find out if a number is positive, negative, and zero. We can also use a chained conditional, that is, if..elif..else statement. Please modify your copy of sign.py in this way, and do some experiments to convince yourself that it works. (Again, you must be careful to include the colon after else.)
number = float(input("Enter a number: "))
if number > 0:
print("That number is positive.")
elif number < 0:
print("That number is negative.")
else:
print("The number is zero. ")
Now lets rewrite the program to calculate a customers monthly Internet bill in Activity 1 by using a chained conditional.
# copy and paste your code here
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
