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
A ____ is a theoretical model of computation that includes a (conceptual) tape extending infinitely in both directions.
ololo11 [35]

Turing machine is the theoretical model of computation

5 0
3 years ago
# q7 - create function readFileFirstLast() to meet the conditions below
MAVERICK [17]

Answer:

See explaination

Explanation:

def readFileFirstLast(filename):

# doc string

''' Function accept the filename and opens the fle

and reads all lines and strips new line character and

stores first and last in a string and return that string'''

#eception handle if file not found

try:

#opening the file

f = open(filename)

#reading the first line and striping the ne line

string = f.readline().strip()

#iterating until last line

for line in f:

pass

#concate the last line after strip the new line character to the string

string = string + " " + line.strip()

#return the string

return string

except:

#if file not found

return "File not found"

#taking the file name from user

filename = input("Enter a file name: ")

#printing the doc string in function

print("\ndoc_sting: \n"+ readFileFirstLast.__doc__+"\n")

#printing the returned string by calling the readFileFirstLast()

print("output string :")

print(readFileFirstLast(filename))

3 0
3 years ago
What is the definition of software? Group of answer choices an instruction that causes a single specific action to be performed
zmey [24]

Answer:

The answer is started from the last fourth line i.e., a series of

Explanation:

Software seems to be the set of linked commands which inform the system or smartphone what tasks to do as well as how to execute.

In the simple words, the software is the set of the program that direct the following smartphones and also the systems that how they work and how to perform these works accurately.

So, the following are the reasons that describe the other options that are not appropriate for software.

7 0
3 years ago
Which device on a network performs network address translation?
Alika [10]
Network Address Translation<span> (NAT) is the answer</span>
4 0
3 years ago
Do you think social media should affect presidential elections
Rina8888 [55]

No, not really cuz I think that would be too personal for the president.

5 0
3 years ago
Read 2 more answers
Other questions:
  • ________ are devices used to send data between two networks.
    11·1 answer
  • Select the correct answer.
    6·1 answer
  • Create a structure named planet This structure will contain distance from Earth as an integer Atmosphere, language, people and p
    8·1 answer
  • PowerPoint Presentation on What type of device will she use to display her presentation and explain it to the rest of the childr
    13·2 answers
  • ASAP FAST PLSKara is currently creating a storyboard for her web site. Which step of the web design process is she in? Coding Pl
    9·2 answers
  • To obtain the desired speedup, make sure your new function recursively calls itself no more than once in the body of the method.
    8·1 answer
  • Kyle returns to work the next day and he would like to continue working on the document from yesterday. What should Kyle do?
    7·1 answer
  • (14) Click on the
    7·2 answers
  • What will be the output, if any, when the user clicks the right mouse button?
    5·1 answer
  • Each of the flowchart segments in Figure 3-24 is unstructured. Redraw each segment so that it does the same processes under the
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!