Hello guys... I wanna write a program that calculates a customer’s bill for the electric company. But there are two types of customers: residential and commercial. There are two rates for calculating an electric bill.

Resident rates – Bill processing fee = $12.50
Service fee = $30.50
Alternative energy fee = $7.50

commercial rates - Bill processing fee = $20.00
Service fee = $150.00
Alternative energy fee = $80.00

The program should ask for an account number and customer code. Assume that R or r is for residential and C or c stands for commercial
And my input should include customer account number, customer code, ask for alternative energy. Service fees are included in the billing.

Recommended Answers

All 2 Replies

So, I am guessing you learned about structs and classes? If so then
go ahead and make a Residential and Commercial class. In fact you can
use some inheritance, and polymorphism here, but I guess we can keep it simple.

commented: Yes, I think it needs a queue, a finite state machine and some template programming too. +2
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.