1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
rosijanka [135]
2 years ago
12

. The electric company charges according to the following rate schedule: 9 cents per kilowatt-hour (kwh) for the first 300 kwh 8

cents per kwh for the next 300 kwh (up to 600 kwh) 6 cents per kwh for the next 400 kwh (up to 1,000 kwh) 5 cents per kwh for all electricity used over 1,000 kwh Write a function to compute the total charge for each customer. Write a main function to call the charge calculation function using the following data: Customer Number Kilowatt-hours Used 123 725 205 115 464 600 596 327 … … The program should print a three column chart listing the customer number, the kilowatt hours used, and the charge for each customer. The program should also compute and print the number of customers, the total kilowatt hours used, and the total charges.
Computers and Technology
1 answer:
densk [106]2 years ago
7 0

Answer:

here, hope it helps.

Explanation:

#include<iostream>

using namespace std;

int calculate(int N)

{

int rate=0;

for(int count=1;count<N;count++)

{

if(count<=300)

rate=rate+9;

else if(count<=600)

rate=rate+8;

else if(count<=1000)

rate=rate+6;

else

rate=rate+5;

}

return rate;

}

void main()

{

int costumer[20];

int wats[20];

int rates[20];

int i=0;

cout<<"please enter the information for the costomers below 0 to stop"<<endl;

while (costumer[i-1]!= 0)

{

cout<<"please enter the number of the coustomer "<<endl;

cin>>costumer[i];

if(costumer[i]==0)

break;

cout<<"please enter Kilowatt-hours used for the costumer "<<endl;

cin>>wats[i];

i++;

}

for(int j=0;j<i;j++)

rates[j]=calculate(wats[j]);

for(int j=0;j<i;j++)

{

cout<<" Customer Number Kilowatt-hours used charge"<<endl;

cout<<" "<<costumer[j]<<" "<<wats[j]<<" "<<rates[j]<<endl;

}

}

You might be interested in
NEED HELP RIGHT NOW!!! Which of the following is the definition of a privacy policy? * 5 points - A legal document that an app o
Marina86 [1]

Answer:

A legal document that an app or a website must provide to describe the rules the company and users must obey when they use the app.

6 0
3 years ago
What is the correct process for selecting an entire row in a spreadsheet?
Valentin [98]
A. Click on any cell in the row
7 0
3 years ago
Write a program to input elements of 4*3matrix and prints its elements properly using array ​
Harlamova29_29 [7]

Answer:

Step by step explanation:

7 0
2 years ago
What is network management?
melamori03 [73]
Network management is  a broad range of  functions including activities, methods, procedures and the  use of  tools to administrate,operate,and  reliably maintain computer network system.  <span />
3 0
3 years ago
What is a bitmap ???
leva [86]
<span>a representation in which each item corresponds to one or more bits of information, especially the information used to control the display of a computer screen.
</span><span>represent (an item) as a bitmap.
</span>
4 0
3 years ago
Read 2 more answers
Other questions:
  • What type of device does a computer turn to first when attempting to make contact with a host with a known IP address on another
    6·1 answer
  • How long does it take to wire a house?
    14·2 answers
  • what is hyperlink a)the text contained in hypertext documents b)a service provided by the internet c) the location of web pge on
    12·1 answer
  • A company has an Aruba solution. The company wants to host a guest login portal with this solution, and the login portal must gi
    7·1 answer
  • Essay about evolution of media shaped the values and norms of the society
    11·1 answer
  • A collection of wiress connecting the CPU with main memory that is used to identify particular location is called
    13·1 answer
  • How do programmers recognise patterns, generalise and abstract information
    13·1 answer
  • the ghost adventures team uses a variety of tools and technology in investigations. which one is described as an adjustable freq
    9·1 answer
  • Which of the following best explains how algorithms that run on a computer can be used to solve problems?
    5·1 answer
  • What is the significance of the scientific method?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!