Asked by ignatius
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. 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 charges.
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. 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 charges.
Answers
Answered by
Alex
What specific part are you having trouble with? The packages? File I/O? What language?
Answered by
MathMate
pseudocode:
x=input package name, x=1 for A, etc.
n=input number of hours
...
cost=0
if x=1 then
cost=9.95+min(0,2*(n-10))
else if x=2 then
cost=13.95+min(0,1*(n-20))
else if x=3 then
cost=19.95
else
print "incorrect package"
endif
print x, n, cost
x=input package name, x=1 for A, etc.
n=input number of hours
...
cost=0
if x=1 then
cost=9.95+min(0,2*(n-10))
else if x=2 then
cost=13.95+min(0,1*(n-20))
else if x=3 then
cost=19.95
else
print "incorrect package"
endif
print x, n, cost
Answered by
simran
HLOO
Can i get code ?
Can i get code ?
There are no AI answers yet. The ability to request AI answers is coming soon!
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.