#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;
}
}
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
Comments
Leave a comment