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]
3 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]3 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
Online banking tools allow you to pay bills from your computer. <br> a. True<br> b. False
Vaselesa [24]
On your online bank you can add bills from your computer. 
5 0
3 years ago
Read 2 more answers
The computer program that Josh is working on presents him with a sentence in which a word has been underlined. Josh has to indic
Phantasy [73]

Answer:

Drill and Practice

Explanation:

<em>Drill and Practice</em> is a type of Computer-based Instruction (CBI) program. In <em>Drill and Practice</em>, answered questions are given immediate feedback. These problems or exercises are structured and answered on the program to provide instant feedback to the person taking the test.

<em>For instance</em>, when going through an evaluation test but you are required to provide the correct answer before moving on. Once a question is answered, the program will indicate whether correct or wrong, if the question is correct, move to the next question but if wrong you start again. This is a typical example of Drill and practice.

This is exactly what is seen in our scenario in the question.

4 0
3 years ago
Write a program that repeatedly prompts a user for integer numbers until the user enters 'done'. Once 'done' is entered, print o
bearhunter [10]

A program that repeatedly prompts a user for integer numbers :

biggest = none

smallest = none

while True:

input = raw_input(“Enter a number:”)

if(input == “done” break

try:

 number = float(inp)

 except ValueError:

 print “Please enter only numbers”

else

 if smallest is None:

  smallest = number;

  biggest = number;

elif number < smallest:

 smallest = number

elif num > largest:

 largest = number

Print “Greatest is “, biggest

Print “Smallest is”, smallest

In this program an input is obtained, if it is equal to the word “done”, then the program stops b printing greatest and smallest number in the given input.

If invalid inputs are given then user is prompted to enter valid number. Otherwise the value of smallest and greatest are calculated according to the input using if-else construct.

6 0
3 years ago
name instances in the past where social media has kept you informed about the latest news around the country​
Luba_88 [7]
BLM movement and protests,
The election, school shootings, and the pandemic
3 0
2 years ago
Read 2 more answers
Which of the following is an antivirus software?
kotegsom [21]

Answer:

McAfee

Explanation:

An antivirus is a standalone software that protects other software. On the other hand, a Firewall is capable of preserving both software and hardware on the network.

4 0
2 years ago
Other questions:
  • Which icon will automatically adjust the amount of space between letters from very tight to very loose in style? Hyphenation, Te
    6·2 answers
  • Which element of a business document provides additional information but is not a part of the body of the text?
    13·2 answers
  • The control programs managing computer hardware and software perform the _________ function to control and prioritize tasks perf
    8·1 answer
  • ________ are used to translate each source code instruction into the appropriate machine language instruction.
    11·1 answer
  • Name the different type of vegetation found in India ?​
    8·2 answers
  • Question 4 of 20
    5·1 answer
  • 27. If X and Y are int type variables,
    14·1 answer
  • Recently, Walmart offered a wireless data contract based on bandwidth used, with a minimum monthly charge of $42 for up to 5 gig
    15·1 answer
  • MEOWWWWWRARRARARARARRA
    5·1 answer
  • To determine what to study one Should first
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!