Answer to Question #264545 in C++ for Alunsina

Question #264545

Draw a flowchart from this algorithm.


Start

Declare variable kilowattHour

Declare variable amountDue

Declare variable i

for i=1 to 100 Step 1

Read kilowattHour from the user

if kilowattHour<=300 then

amountDue=kilowattHour*25.00

else

amountDue=300*25.00+(kilowattHour-300)*30.00

End if

Display amountDue

end for

Stop


1
Expert's answer
2021-11-12T00:08:02-0500



#include<iostream>
using namespace std;
int main()
{
	int kilowarttHour;
	int amountDue;
	int i;
	for(int i=1;i<100;i++){
		cout<<"Enter the kilowartHour: ";
		cin>>kilowarttHour;
		if(kilowarttHour<=300){
			amountDue=kilowarttHour*25;
			cout<<"amountDue"<<amountDue<<endl;
		}
		else{
			amountDue=300*25.00+(kilowarttHour-300)*30.00;
			cout<<amountDue<<endl;
		}
	}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS