Find the best solutions to your questions at Westonci.ca, the premier Q&A platform with a community of knowledgeable experts. Find reliable answers to your questions from a wide community of knowledgeable experts on our user-friendly Q&A platform. Connect with a community of professionals ready to help you find accurate solutions to your questions quickly and efficiently.
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 appreciate your time. Please revisit us for more reliable answers to any questions you may have. Thank you for your visit. We're committed to providing you with the best information available. Return anytime for more. Stay curious and keep coming back to Westonci.ca for answers to all your burning questions.