Question

In PYTHON code:

Mobile Service Provider A mobile phone service provider has three different data plans for its customers: Details Package Nam

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

Three more examples are given to show other cases:

Mobile Service Provider

Enter your mobile phone package (A, B or C): B
How many gigabytes data did you use? 3
Your total cost for Package B is 59.99
If you had chosen Package A you would have saved $ 20.00

And,

Mobile Service Provider

Enter your mobile phone package (A, B or C): B
How many gigabytes data did you use? 30
Your total cost for Package B is 169.99
If you had chosen Package C you would have saved $ 100.00

And,

Mobile Service Provider

Enter your mobile phone package (A, B or C): B
How many gigabytes data did you use? 6
Your total cost for Package B is 59.99
You made an optimal choice in Package B!!!

When the user enters Package C, there is no need to ask for the data usage. Package C has unlimited data included.

If the user enters an invalid package name, you should get the the following output:

Mobile Service Provider

Enter your mobile phone package (A, B or C): j
You entered an invalid package name. Good bye!
0 0
Add a comment Improve this question Transcribed image text
Answer #1

import sys
print("Mobile Service Provider")
userinput = input("Enter your mobile phone package (A, B or C):")
if userinput not in ["A","B","C"]:
sys.exit("You entered an invalid package name. Good bye!")

gigabyte=int(input("How many gigabytes data did you use?"))
totalcostA=0.0
totalcostB=0.0
totalcostC=0.0
totalcostA=39.99
if gigabyte >4:
totalcostA=39.99+(10*(gigabyte-4))

totalcostB=59.99
if gigabyte >8:
totalcostB=59.99+(5*(gigabyte-8))

totalcostC=69.99
if userinput == "A":
totalcostA=39.99
if gigabyte >4:
totalcostA=39.99+(10*(gigabyte-4))
if userinput == "B":
totalcostB=59.99
if gigabyte >8:
totalcostB=59.99+(5*(gigabyte-8))

if userinput == "C":
totalcostC=69.99

if userinput == "B":
if totalcostC < totalcostA:
if totalcostB <= totalcostC:
print("You made an optimal choice in Package B!!!")
else:
print('If you had chosen Package C you would have saved ${:.2f}'.format(totalcostB-totalcostC))
else:
if totalcostB <= totalcostA:
print("You made an optimal choice in Package B!!!")
else:
print('If you had chosen Package A you would have saved ${:.2f}'.format(totalcostB-totalcostA))


if userinput == "C":
if totalcostA < totalcostB:
if totalcostC <= totalcostA:
print("You made an optimal choice in Package C!!!")
else:
print('If you had chosen Package A you would have saved ${:.2f}'.format(totalcostC-totalcostA))
else:
if totalcostC < totalcostB:
print("You made an optimal choice in Package C!!!")
else:
print('If you had chosen Package B you would have saved ${:.2f}'.format(totalcostC-totalcostB))

if userinput == "A":
if totalcostC < totalcostB:
if totalcostA <= totalcostC:
print("You made an optimal choice in Package A!!!")
else:
print('If you had chosen Package C you would have saved ${:.2f}'.format(totalcostA-totalcostC))
else:
if totalcostA <= totalcostB:
print("You made an optimal choice in Package A!!!")
else:
print('If you had chosen Package B you would have saved ${:.2f}'.format(totalcostA-totalcostB))


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

output:

akshay@akshay-Inspiron-3537:~/CODE$ python3 co.py
Mobile Service Provider
Enter your mobile phone package (A, B or C):B
How many gigabytes data did you use?6
You made an optimal choice in Package B!!!

akshay@akshay-Inspiron-3537:~/CODE$ python3 co.py
Mobile Service Provider
Enter your mobile phone package (A, B or C):j
You entered an invalid package name. Good bye!

akshay@akshay-Inspiron-3537:~/CODE$ python3 co.py
Mobile Service Provider
Enter your mobile phone package (A, B or C):B
How many gigabytes data did you use?30
If you had chosen Package C you would have saved $100.00
==============================================================================

Output of all cases is attached.Please feel free to ask questions.

Add a comment
Know the answer?
Add Answer to:
In PYTHON code: Examples of output are as follows: If the user entered Package A and...
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
  • 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...

  • 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 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...

  • 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...

  • 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....

  • Write the code in Python. The output should be exact the same as the given.

    Write the code in Python. The output should be exact the same as the given. Question 1. Study the examples below carefully and write a program for journal subscription Your program should work exactly as the following examples The text in bold indicates user input. Example 1: The user is a student, and the user subscribes to 2 journals Question 1 - Journal of Commodity Markets Journal of Sustainable Mining Journal of Asia-Pacific Biodiversity Student $21 $22 $27 Non-student $50...

  • Assignment 8.3: Phone Chatbot (10 pts) For this programming assignment, we write a basic chatbot program....

    Assignment 8.3: Phone Chatbot (10 pts) For this programming assignment, we write a basic chatbot program. For fun, try having a conversation with an online chatbot here or here. Some sources estimate that 25% of customer services will be handled by Chatbots in 2020, vs. 2% in 2017 (1). The chatbot we are designing must ask you the following questions: What is your name? What is your phone number? What is your phone plan? How many GB of data this...

  • Using Python INST-FS-IAD-PROD.INS LAB1 Lab: Create User Account 2. get-password() #promt the user and create password, check the password fits the requirement USE the EXACT file names! Create a user...

    Using Python INST-FS-IAD-PROD.INS LAB1 Lab: Create User Account 2. get-password() #promt the user and create password, check the password fits the requirement USE the EXACT file names! Create a user login system. Your code should do the following: 3, create-user_name() #use this function to create the user name 1.Create your user database called "UD.txt", this should be in CSV format 4, write-file() #user this function to save the user name and password into "UD.txt" Deliverables: Sample: the data you saved...

  • Making Decisions III CellPhoneService.java + 1 import java.util.Scanner; 2 public class CellphoneService >- Ter Write a...

    Making Decisions III CellPhoneService.java + 1 import java.util.Scanner; 2 public class CellphoneService >- Ter Write a program for Horizon Phones, a provider of cellular phone service. Prompt a user for maximum monthly values for talk minutes used, text messages sent, and gigabytes of data used, and then recommend the best plan for the customer's needs as well as the price of that plan. public static void main (String args[]) // declare variables here // prompt user to enter talk minutes...

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