This program should calcuLate users amount of watts consumed based on their appliances and the aprroximate number of hours each appliance is used in a day, week or month.
The basic requirements are as follows:
Give user option of selecting predefined home appliances or entering their own and corresponding watts per appliance
List home appliances and various consumption rates
Allow user to specify number of hours each appliance is used.
Calculate total watts consumed for the day, week or month
Using current tariff rates and calculation techniques, display expected charges the user will pay

Recommended Answers

All 6 Replies

Every appliance has a watt rating listed on it somewhere. Watts tells how fast the electricity is being used, that is, at what rate. It's like a faucet that's running water, the "watts" would be the number of gallons coming out of the tap per minute. Turning the facuet on full blast would be a lot of "watts" and having the faucet on only a trickle would be a small number of "watts". Each appliance has a watt rating which tells how fast it's gobbling up energy.

You are charged for the total quanity of energy that you used, like how many gallons total or how many watts total. To calculate the total amount, you have to know the rate at which it was used and for how long. If the rate was 2 gallons per minute and the long was 10 minutes then the total amount you would be charged for would be 20 gallons. At .5 cent per gallon that would be 10 cents.

The same for electrical energy. You are billed by the total "quanity" used. Water is sold by the gallon, electricty is sold by the watt-hour. If an appliance was using electricity at the rate of 100 watts then after one hour that would be 100 watt hours. And a watt hour costs so much. If the appliance was using energy at a faster rate, like 1,000 watts, then for an hour that would equal 1,000 watt hours. That could also be called one kilowatt hour (kwh). Actually, electricity is sold in units of kilowatt hours (instead of the much smaller watt hour) and one kwh typically costs roughly around 11 cents each. So to run a 100 watt bulb for an hour would accumulate a quanity of 1/10th of a kwh and would cost 1.1 cents. An appilance that consummed power at the rate of 1 watt for 1,000 hours would be the same quanity of energy as 1,000 watts being used for an hour. Both would cost 11 cents.

So, cost = quanity x rate, which is to say cost = (watts x how long) x rate (somewhere around 11 cents per kwh). Example: 250watts x 6hours = 1.5kwh. Cost = 1.5 x .11 cents = 16.5 cents.

i want the codes please

We don't give codes. You initially wanted help anyway. So make an attempt, post a specific problem with the code(that you have done), and we will help you for sure :)

I HAVE THIS CODES BUT I WANT IT TO CALCULTE THE TOTAL ITEMS I SELECTED AT END. SO AT THE END I WANT THE USER TO KNOW THE ITEM HE SELECTED AND WHAT HE/SHE IS EXPECTED TO PAY. I AM A BEGINNER PLEASE HELP ME

#include <iostream>
using namespace std;


int main()
{
char item;
double HourUse, Total_perDay, Total_perWeek,Total_perMonth;



cout << "Enter a code for item type: T, F, or B: ";
cin  >> item;
cout << endl;

cout << "Enter the hours used per day: ",
cin >> HourUse,
cout << endl;



switch (item)
{
    case 'T':
        if (item='T'){
            (Total_perDay=(HourUse*0.50)),
            (Total_perWeek= Total_perDay*7),
            (Total_perMonth= Total_perDay*30),

            cout << "Amount due per day is: " <<Total_perDay<< endl;
            cout << "Amount due per week is: " <<Total_perWeek<< endl;
            cout << "Amount due per month is: " <<Total_perMonth<< endl;
        }
        break;

            case 'F':
        if (item='F'){
            (Total_perDay=(HourUse*1.00)),
            (Total_perWeek= Total_perDay*7),
            (Total_perMonth= Total_perDay*30),

            cout << "Amount due per day is: " <<Total_perDay<< endl;
            cout << "Amount due per week is: " <<Total_perWeek<< endl;
            cout << "Amount due per month is: " <<Total_perMonth<< endl;

        }

        break;

        case 'B':
        if (item='B'){
            (Total_perDay=(HourUse*0.25)),
            (Total_perWeek= Total_perDay*7),
            (Total_perMonth= Total_perDay*30),

            cout << "Amount due per day is: " <<Total_perDay<< endl;
            cout << "Amount due per week is: " <<Total_perWeek<< endl;
            cout << "Amount due per month is: " <<Total_perMonth<< endl;

        }
        break;

    default:
        cout << "INVALID CODE!\n";
        cout<<endl;
        cout<<endl;



}


cout << "Enter next code for item type: T, F, or B: ";
cin  >> item;
cout << endl;

cout << "Enter the hours used per day: ",
cin >> HourUse,
cout << endl;

switch (item)
{
    case 'T':
        if (item='T'){
            (Total_perDay=(HourUse*0.50)),
            (Total_perWeek= Total_perDay*7),
            (Total_perMonth= Total_perDay*30),

            cout << "Amount due per day is: " <<Total_perDay<< endl;
            cout << "Amount due per week is: " <<Total_perWeek<< endl;
            cout << "Amount due per month is: " <<Total_perMonth<< endl;
        }
        break;

            case 'F':
        if (item='F'){
            (Total_perDay=(HourUse*1.00)),
            (Total_perWeek= Total_perDay*7),
            (Total_perMonth= Total_perDay*30),

            cout << "Amount due per day is: " <<Total_perDay<< endl;
            cout << "Amount due per week is: " <<Total_perWeek<< endl;
            cout << "Amount due per month is: " <<Total_perMonth<< endl;

        }

        break;

        case 'B':
        if (item='B'){
            (Total_perDay=(HourUse*0.25)),
            (Total_perWeek= Total_perDay*7),
            (Total_perMonth= Total_perDay*30),

            cout << "Amount due per day is: " <<Total_perDay<< endl;
            cout << "Amount due per week is: " <<Total_perWeek<< endl;
            cout << "Amount due per month is: " <<Total_perMonth<< endl;

        }
        break;

    default:
        cout << "INVALID CODE!\n";

}





return 0;
}

So I would assume the user would want to know the total bill at the end of the month. So you are suppose to add all the totalTotal_perMonth. Create a variable to store the total. And add the Total_perMonth to the Total in each case.

Please help me to write a psedocode about this question

The unit for electricity usage is kWh.For domestic usage,the monthly rate is 21.8 cent/unit for the first 200 unit,25.8 cents/unit for the next 800 units and 27.8 cents/unit for each additional units.given the amount of electricity units (in kWh) used by a customer,calculate the amount of money needs to be paid by the customer to TNB .a bill statement needs to be printed out

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.