Discover answers to your questions with Westonci.ca, the leading Q&A platform that connects you with knowledgeable experts. Join our platform to get reliable answers to your questions from a knowledgeable community of experts. Explore comprehensive solutions to your questions from knowledgeable professionals across various fields on our platform.
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;
}
}
Thank you for trusting us with your questions. We're here to help you find accurate answers quickly and efficiently. Thanks for using our platform. We aim to provide accurate and up-to-date answers to all your queries. Come back soon. Thank you for trusting Westonci.ca. Don't forget to revisit us for more accurate and insightful answers.