Question

Part 1: A mobile phone service provider has three different data plans for its customers: Package...

Part 1: A mobile phone service provider has three different data plans for its customers: Package A: For $39.99 per month 4 gigabytes are provided. Additional data costs $10 per gigabyte. Package B: For $59.99 per month, 8 gigabytes are provided. Additional data costs $5 per gigabyte. Package C: For $69.99 per month, unlimited data is provided. Write a program that calculates a customer's monthly bill. It should ask which package the customer has purchased and how many gigabytes were used. It should then display the total amount due. INPUT VALIDATION: Be sure the user only selects packages A, B or C. Modify the program in Part 1 so it also displays how much package A customers would have saved if they purchased packages B or C and how much money Package B customers would have saved if they purchased Package C. If there would be no savings, no message should be printed.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

thanks for the question, here is a program with screenshot. I have tested for multiple test data and its working fine.

Here is the code with screenshot of a sample output

====================================================================================

packageA=(39.99,4,10)
packageB=(59.99,8,5)
packageC=69.99,

user_package=input('Enter package you are using \n[A] - Package A\n[B] - Package B\n[C] - Package C\n')
data_usage=float(input('How much gigabyes data was used: '))
if user_package in 'ABC':
    cost_C=cost_B=cost_A=0.0
    if data_usage>packageA[1]:
        cost_A=packageA[0]+(data_usage-packageA[1])*packageA[2]
    else:
        cost_A=packageA[0]
    if data_usage>packageB[1]:
        cost_B=packageB[0]+(data_usage-packageB[1])*packageB[2]
    else:
        cost_B=packageB[0]
    cost_C=packageC[0]
    if user_package=='A':
        print('Your monthly bill - PackageA ${0:.2f}'.format(round(cost_A,2)))
        if cost_B<cost_A:
            print('If you have used PackageB you would have saved: ${0:.2f}'.format(cost_A-cost_B))
        if cost_C<cost_A:
            print('If you have used PackageC you would have saved: ${0:.2f}'.format(cost_A-cost_C))
    elif user_package=='B':
        print('Your monthly bill PackageB ${0:.2f}'.format(round(cost_B,2)))
        if cost_A<cost_B:
            print('If you have used PackageB you would have saved: ${0:.2f}'.format(cost_B-cost_A))
        if cost_C<cost_B:
            print('If you have used PackageC you would have saved: ${0:.2f}'.format(cost_B-cost_C))
    elif user_package=='C':
        print('Your monthly bill PackageC ${0:.2f}'.format(round(cost_C,2)))
        if cost_A<cost_C:
            print('If you have used PackageA you would have saved: ${0:.2f}'.format(cost_C-cost_A))
        if cost_B<cost_C:
            print('If you have used PackageB you would have saved: ${0:2f}'.format(cost_C-cost_B))

else:
    print('You have entered an invalid package')

========================================================================================

unbtled-e2434PycharmPrcjects.urbtiled]- MobilePhonepy-Pycharm Commurrty Ldbon 403 user_p,ckage-1zput4 Enter package了on are u

thanks !!

Add a comment
Know the answer?
Add Answer to:
Part 1: A mobile phone service provider has three different data plans for its customers: Package...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • In PYTHON code: Examples of output are as follows: If the user entered Package A and...

    In PYTHON code: Examples of output are as follows: If the user entered Package A and 30 GB of data, then you should get the following output: Mobile Service Provider Enter your mobile phone package (A, B or C): A How many gigabytes data did you use? 30 Your total cost for Package A is 299.99 If you had chosen Package C you would have saved $ 230.00 If you had chosen Package B you would have saved $ 130.00...

  • write in C++ Problem 1: Mobile Service Provider A cell phone service provider has three different...

    write in C++ Problem 1: Mobile Service Provider A cell phone service provider has three different subscription packages for its customers. Package A: For $39.99 per month 450 minutes are provided. Additional minutes are $0.45 per minute. Package B: For $59.99 per month 900 minutes are provided. Additional minutes are $0.40 per minute. Package C: For $69.99 per month unlimited minutes provided. Write a program that calculates a customer’s monthly bill. It should ask which package the customer has purchased...

  • Problem: Mobile Service Provider A mobile service provider has three different subscription packages for its customers:...

    Problem: Mobile Service Provider A mobile service provider has three different subscription packages for its customers: • Package A: For $50 per month, 5 GB data are provided. Additional data is $15 per GB. • Package B: For $65 per month, 10 data are provided. Additional data is $10 per GB. • Package C: For $75 per month unlimited data provided. Text messaging and voice services are included in all of the company's data packages. The Mobile Service Company offers...

  • An Internet service provider has three different subscription packages for its customers: Package A: For $15...

    An Internet service provider has three different subscription packages for its customers: Package A: For $15 per month with 50 hours of access provided. Additional hours are $2.00 per hour over 50 hours. Assume usage is recorded in one-hour increments. Package B: For $20 per month with 100 hours of access provided. Additional hours are $1.50 per hour over 100 hours. Package C: For $25 per month with 150 hours access is provided.    Additional hours are $1.00 per hour...

  • Java Programming Problem description with its major requirements labeled from A to I. A mobile phone...

    Java Programming Problem description with its major requirements labeled from A to I. A mobile phone service provider has three different subscription packages for its customers: Package A: For $39.99 per month 450 minutes are provided. Additional minutes are $0.45 per minute. Package B: For $59.99 per month 900 minutes are provided. Additional minutes are $0.40 per minute. Package C: For $69.99 per month unlimited minutes are provided. Design a class MobileCharges that calculates a customer’s monthly bill. It should...

  • write in java and you must use methods.... Part I     Internet Service Provider An Internet service...

    write in java and you must use methods.... Part I     Internet Service Provider An Internet service provider has three different subscription packages for its customers: Package A: For $9.95 per month 10 hours of access are provided. Additional hours are $2.00 per hour. Package B: For $13.95 per month 20 hours of access are provided. Additional hours are $1.00 per hour. Package C: For $19.95 per month unlimited access is provided. Write a program that calculates a customer’s monthly bill....

  • An Internet service provider offers four subscription packages to its customers, plus a discount for nonprofit...

    An Internet service provider offers four subscription packages to its customers, plus a discount for nonprofit organizations: Package A: 10 hours of access for $12.95 per month. Additional hours are $4.00 per hour. Package B: 20 hours of access for $14.95 per month. Additional hours are $2.00 per hour. Package C: 30 hours of access for $20 per month. Additional hours are $1.00 per hour. Package D: Unlimited access for $35.95 per month. A nonprofit organizations will get 20% discount...

  • Internet Service Provider

    Package A = $9.95 per month 10 hrs access provided. Additional hrs are $2 per hour.Package B= $13.95 per month 20 hrs access provided. Additional hrs are $1 per hour.Package C = $19.95 per month unlimited access provided.Write a program that calculates a customer's monthly bill to display the letter of the packaged purchased and the number of hours used. Finally display the totalcharges.

  • Please can someone help me with making this program in JAVA implementing classes. Also, include loops...

    Please can someone help me with making this program in JAVA implementing classes. Also, include loops and selection structures. A mobile service provider has three different subscription packages for its customers: Package A: For $50 per month, 5 GB data are provided. Additional data is $15 per GB. Package B: For $65 per month, 10 data are provided. Additional data is $10 per GB. Package C: For $75 per month unlimited data provided. Text messaging and voice services are included...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT