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
after placing her insertion point after grandma's kitchen, order the steps Danica needs to follow to insert and format the regis
KengaRu [80]

Answer:

step 4

step 5

step 3

step 2

Explanation:

8 0
3 years ago
Read 2 more answers
An update anomaly can occur if A. an instance of the same data is stored in two or more places in the database. B. a data elemen
zalisa [80]

Answer:

A. an instance of the same data is stored in two or more places in the database.

Explanation:

Giving that Update Anomalies usually occur when the designated user person in keeping records or record master stored a particular data in more than one in a database. This is what is called duplication of data and is termed an irregularity on the part of the record keeper.

Hence, the correct answer to the question is " A. an instance of the same data is stored in two or more places in the database."

5 0
3 years ago
Write a program that accepts a positive integer N as command-line argument, and outputs True if N is the square of some integer,
Ann [662]

Answer:

In Python:

N = int(input("Positive integer: "))

if N > 0:

   flag = False

   for i in range(1,N+1):

       if i * i == N:

           flag = True

           break

   print(str(flag))

else:

   print("Positive integer only")

   

Explanation:

N = int(input("Positive integer: "))

If the number is positive

if N > 0:

This initializes a boolean variable to false

   flag = False

This iterates from 1 to the input integer

   for i in range(1,N+1):

This checks if th number is a square of some integer

       if i * i == N:

If yes, flag is set to true

           flag = True

The loop is exited

           break

This prints either true or false, depending on the result of the loop

   print(str(flag))

If otherwise, that the number is not positive

<em>else:</em>

<em>    print("Positive integer only")</em>

3 0
3 years ago
Analyze the following code. Is count &lt; 100 always true, always false, or sometimes true or sometimes false at Point A, Point
GaryK [48]

Answer:

Point A: Always True

Point B: Sometimes false

Point C: Always False

Explanation:

In the given code snippet. Point A is the first statement within the While loop the statement System.out.println("Welcome to Java!"); will only be executed if the while condition evaluates to true.

At Point B, The statement count++ increases the value of the counter at every iteration, while it will be true for most occasions, at the last increament, this statement will be false that is at count=100, The condition will be false at this point just before program execution breaks out of the loop

Point C is outside of the loop, this happens when the given condition is no longer true.

8 0
3 years ago
What responds to both visual appeal and functional needs? (1 point) A.) applied art B.) performance art C.) fine art D.) visual
d1i1m1o1n [39]

Answer:

a

Explanation:

6 0
3 years ago
Other questions:
  • Which of the following characteristics relates to authentication header (AH)? It is a document that defines or describes compute
    11·1 answer
  • If you print a document with red green or blue underlines will they show up on printed pages
    14·1 answer
  • What do developers do to support software products? explain to users which development process model was used to make the produc
    8·1 answer
  • A flat-panel detector is exposed with nothing between the x-ray tube and detector. 5 images were acquired on 5 different days us
    6·1 answer
  • Students who respond promptly to e-mails are following which netiquette rule?
    13·2 answers
  • Insert a row above the selected row (in between row 1 and row 2).
    15·2 answers
  • To implement the various placement algorithms discussed for dynamic partitioning (see Section 7.2 ), a list of the free blocks o
    11·1 answer
  • What does Al stand for?
    10·1 answer
  • WHICH PROGRAMMING LANGUAGES ARE THE BEST FOR PROGRAMMING?
    14·1 answer
  • When you create a new database using --------- , the database includes prebuilt tables and forms which you can populate with dat
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!