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
Your team at amazon is overseeing the design of a new high-efficiency data center at hq2. a power grid need to be generated for
elixir [45]

Answer:

void print2(int row) {

for (int i = 0; i < row; i++) {

 char ch = 'a';

 char print = ch;

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

  cout << print++;

 }

 cout << endl;

}

}

int count_digits(int num) {

int count = 0;

int temp = num;

while (temp != 0) {

 temp = temp / 10;

 count++;

}

return (num % count);

}

Explanation:

3 0
2 years ago
You want to make it possible for your smartphone to share its internet access wirelessly with your friends device which of the f
IrinaVladis [17]

Answer:WiFi or hotspots

Explanation:you will have to turn on your WiFi or hotspots on your smart phone and allow your friend to also turn his WiFi or hotspot after you will search for your WiFi and connect there he can use the internet

6 0
3 years ago
List four significant differences between a file-processing system and a database management system (DBMS).
melisa1 [442]

Answer is given below

Explanation:

differences between a file-processing system and a database management system is given below

file-processing system

  • File system is a software that manages and organizes the files in a storage medium within a computer.
  • It doesn’t provide backup and recovery of data if it is lost.
  • There is less data consistency in file system.
  • File systems provide less security in comparison to DBMS.
  • It is less complex as compared to DBMS.

database management system

  • DBMS is a software for managing the database
  • It provides backup and recovery of data even if it is lost.
  • DBMS has more security mechanisms as compared to file system
  • It has more complexity in handling as compared to file system.
  • There is more data consistency because of the process of normalization.
7 0
3 years ago
Develop a CPP program to test is an array conforms heap ordered binary tree. This program read data from cin (console) and gives
mafiozo [28]

Answer:

Following are the code to this question:

#include<iostream>//import header file

using namespace std;

int main()//defining main method

{

int ar[7];//defining 1_D array that stores value      

int i,x=0,l1=1,j; //defining integer variable

for(i=0;i<7;i++)//defining for loop for input value from user ends  

{

cout<<"Enter a Number: ";//print message

cin>>ar[i];//input value in array

if(l1<=2 && i>0)//using if block that checks the array values  

{

x++;//increment the value of x by 1  

}

if(l1>2 && i>0)//using if block that checks the array values  

{

l1=l1-2;//using l1 variable that decrases the l1 value by 2  

}

j=i-x;//using j variable that holds the index of the root of the subtree

if(i>0 && ar[j]>ar[i])// use if block that checks heap condition  

{

l1++; //increment the value of l1 variable

}

if(i>0 && ar[j]<ar[i])// using the if block that violate the heap rule  

{

cout<<ar[i]<<" "<<"Violate the heap";//print message with value

break;//using break keyword  

}

}

return 0;

}

Output:

1)

Enter a Number: -15

Enter a Number: -5

-5 Violate the heap

2)

Enter a Number: 45

Enter a Number: 0

Enter a Number: 55

55 Violate the heap

Explanation:

  • In the above-given C++ language code, an array "ar" and other integer variables " i,x,l1, j" is declared, in which "i" variable used in the loop for input values from the user end.
  • In this loop two, if block is defined, that checks the array values and in the first, if the block it will increment the value of x, and in the second if the block, it will decrease the l1 value by 2.
  • In the next step, j variable is used that is the index of the root of the subtree. In the next step, another if block is used, that checks heap condition, that increment the value of l1 variable. In the, if block it violate the heap rule and print its values.
5 0
3 years ago
This standard library function returns a random floating-point number in the range of 0.0 up to 1.0 (but not including 1.0).
natulia [17]

Answer:

The answer would be A: Random

Explanation:

The random() function returns a generated random number (a pseudorandom number)

5 0
2 years ago
Other questions:
  • If there are no differences between the amino acid sequences in the cytochrome c protein of humans and chimpanzees why aren't we
    15·1 answer
  • Write an application named EnterUppercaseLetters that asks the user to type an uppercase letter from the keyboard. If the charac
    5·1 answer
  • 20 points
    6·2 answers
  • In preparing his persuasive presentation, Reza should most likely focus on clearly presenting his
    6·2 answers
  • Given an initialized String variable outfile, write a statement that declares a PrintWriter reference variable named output and
    12·1 answer
  • Which of the following is an example of a trade journal?
    7·2 answers
  • What do you hope will be in/added GTA 6?
    13·1 answer
  • Who invented the first mechanical computer? in what year was it invented?.
    11·1 answer
  • Which era marked a switch from agricultural practices to industrial practices?
    6·1 answer
  • What feature should you enable to prevent the sidhistory attribute from being used to falsely gain administrative privileges in
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!