Showing posts with label Rental Options. Show all posts
Showing posts with label Rental Options. Show all posts

Thursday, March 19, 2015

Rental Options

Algorithm
Step 1 : Start
Step 2 : Read vehicle
Step 3 : If vehicle = "car" then
Print "Rental is Rs. 20/km"
Step 3.1 : else if vehicle = "van" then
Print "Rental is Rs. 10/km"
Step 3.2 : else if vehicle = "jeep" then
Print "Rental is Rs. 5/km"
Step 3.3 : else if vehicle = "bicycle" then
Print "Rental is Rs. 0.2/km"
Step 3.4 : else
Print "Vehicle not available"
Step 4 : Stop

Program (rental.sh)
# String matching
echo "Two/Four wheeler rental"
echo -n "Enter the required vehicle : "
read vehicle