Answer to Question #298698 in C++ for subaashini

Question #298698

is programming example taken out of the textbook by D.S. Malik demonstrates a program that calculates a customer’s bill for a local cable company. There are two types of customers: residential and business. There are two rates for calculating a cable bill: one for residential customers and one for business customers. For residential customers the following rates apply:

  • Bill Processing Fee: $4.50
  • Basic Service Fee: $20.50
  • Premium channels: $7.50 per channels

For business customers the following rates apply:

  • Bill processing fee: $15.00
  • Basic Service Fee: $75.00 for first 10 channels, $5.00 for each additional connection
  • Premium channels: $50.00 per channel for any number of connections

write the flowchart and pseucode for question

1
Expert's answer
2022-02-16T15:02:15-0500




function main()
    output "Enter account number (an integer): "
    input accountNumber
    output "Enter customer type: R or r (Residential), B or b (Business)"
    input customerType
    if customerType = "r" OR customerType = "R" then
        output "Enter the number of premium channels:"
        input numOfPremChannels
        amountDue = 4.50 + 20.50 + numOfPremChannels * 7.50
    else
        if customerType = "b" OR customerType = "B" then
            output "Enter number of basic service connections: "
            input numOfBasicServConn
            output "Enter number of premium channels: "
            input numOfPremChannels
            if numOfBasicServConn <= 10 then
                amountDue = 15.00 + 75.00 + numOfPremChannels * 50.00
            else
                amountDue = 15.00 + 75.00 + (numOfBasicServConn - 10) * 5.00 + numOfPremChannels * 50.00
            end If
        end If
    end If
    output "Account Number: " + accountNumber
    output "Amount Due: $" + amountDue
end function

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog