IDNLearn.com is designed to help you find reliable answers quickly and easily. Join our community to access reliable and comprehensive responses to your questions from experienced professionals.
Sagot :
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;
}
}
We greatly appreciate every question and answer you provide. Keep engaging and finding the best solutions. This community is the perfect place to learn and grow together. Thank you for choosing IDNLearn.com for your queries. We’re committed to providing accurate answers, so visit us again soon.