1. Mr. Abdi began his trip from Woliso to Finfinne; he filled his car's tank with gas and reset its trip

meter to zero. After travelling 50 KM, Mr. Abdi stopped at a gas station to refuel; the gas tank required
10 gallons. Create an algorithm that Mr. Abdi can use to display his car's gas mileage-the number of
Kilometers his car can be driven per gallon of gas-at anytime during the trip.
direction
a. Your algorithm should be written both in pseudocode and flow chart.
b. You have to show each and necessary steps considered to solve each problem

Pseudocode:

1. Set car's trip meter to zero
2. Fill gas tank
3. Set gas mileage variable to zero
4. While trip meter is less than total distance traveled:
a. Get amount of gas used since last fill up
b. Calculate gas mileage by dividing distance traveled by gas used
c. Display gas mileage
d. Fill gas tank
e. Update trip meter to reflect new distance traveled
5. End program

Flowchart:
(Start) --> Set trip meter to zero --> Fill gas tank --> Set gas mileage to zero
--> While trip meter < total distance traveled -->
--> Get gas used --> Calculate gas mileage --> Display gas mileage
--> Fill gas tank --> Update trip meter --> End program

Note: This algorithm assumes that Mr. Abdi will continue to stop and refuel at regular intervals during the trip.