Answer to Question #280558 in Algorithms for Alunsina

Question #280558

#include<iostream>

using namespace std;

int main(){

double speed = 55;

double hours = 4;

double distance = 0;

double i = 0.5;

while(i<=hours){

distance = distance + (speed / 2);

cout<<i<<endl;

cout<<"Distance:  "<<distance<<endl;

i += 0.5;

}

}


1
Expert's answer
2021-12-16T14:31:08-0500
Start
   Declare variable double speed = 55
   Declare variable double hours = 4
   Declare variable double distance = 0
   Declare variable double i = 0.5
   While i<=hours
      Set distance = distance + (speed / 2)
      Display i
      Display "Distance:  ", distance
      Set i =i+ 0.5
   End While
Stop

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