Question
PLEASE SOLVE BOTH IN PYTHON: Program 1: Design (pseudocode) and implement (source code) a program (name it PhoneBill) that calculates the bill for a cellular
PLEASE SOLVE BOTH IN PYTHON:
Program 1: Design (pseudocode) and implement (source code) a program (name it PhoneBill) that calculates the bill for a cellular telephone company. The company offers two types of service: regular service and premium service. The rates vary depending on the type of service. The rates are computed as follows:
Regular service: $15.00 fee covering first 50 minutes. Charges for over 50 minutes are computed at the rate of $0.50 per minute.
Premium service: $25.00 fee plus:
a. For daytime calls (between 6:00AM to 6:00PM), the first 50 minutes are free; charges for over 50 minutes are computed at the rate of $0.20 per minute.
b. For nighttime calls (between 6:00PM to 6:00AM), the first 100 minutes are free; charges for over 100 minutes are computed at the rate of 0.10 per minute.
The program prompts the user to enter an account number, a service code (of type char), and the number of minutes the service was used. A service code r (or R) means regular service; while code p (or P) means premium service.
If the service is premium (code p or P), the customer may be using the service during both the day and night. Therefore, the program must ask the user to input the number of minutes used during daytime and nighttime in separate prompts.
Document your code and properly label the input prompts and the outputs as shown below.
Sample run 1:
Account Number: 12345 Service type: Regular Total minutes: 50 Amount due: $15.00
Sample run 2:
Account Number: 32145 Service type: Premium Daytime minutes: 40
Nighttime minutes: 200 Amount due: $35.00
Sample run 3:
Account Number: 78654 Service type: Premium Daytime minutes: 60
Nighttime minutes: 120 Amount due: $29.00
Program 2: Design (pseudocode) and implement (source code) a program (name it Circles) to determine if a circle is either completely inside, overlapping with, or completely outside another circler. The program asks the user to enter the center point (X1, Y1) and the radius (R1) for the first circle C1, and the center point (X2, Y2) and the radius (R2) for the second circle C2. The program then determines if the second circle C2 is either completely inside, or overlapping with, or completely outside the first circle C1. Hint: use the sum of R1 and R2 and the distance between the centers to solve the problem. Document your code, properly label the input prompts, and organize the outputs as shown in the following sample runs.
Sample run 1:
Circle 1 center is: (0,0)
Circle 1 radius is: 6
Circle 2 center is: (1,1)
Circle 2 radius is: 1
Judgment: Circle 2 is completely inside circle 1
Sample run 2:
Circle 1 center is: (0,0)
Circle 1 radius is: 2
Circle 2 center is: (7,7)
Circle 2 radius is: 1
Judgment: Circle 2 is completely outside circle 1
Sample run 3:
Circle 1 center is: (0,0)
Circle 1 radius is: 3
Circle 2 center is: (2,2)
Circle 2 radius is: 3
Judgment: Circle 2 is overlapping with circle 1
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started