can someone write this script with unix
The script should be named final_YourLastname (e.g., a script written by York should be named: final_York). The script should implement car rental reservation activities.
The main menu of the script must prompt users to:
1.Make a Car Reservation
2.Exit System.
When users choose to make a reservation for a car, the script must prompt them to enter the name of a customer and the number of days a customer wishes to rent a car. The script must also prompt customers to enter the size of the car based on the following choices:
S or s Small size
M or m Medium size
F or f Full size
Choosing a small size car will cost customers $15 per day, medium size is $21 per day, and full size is $25 per day.
The total cost of renting a car should be calculated as: (number of days * cost per day).
Print the following details to the screen after your calculations: current date, customer’s name, number of days, cost per day, and the total cost of renting a car.
After each reservation, implement a loop to allow users to make another reservation until they choose to exit the system.
1 answer
#final_YourLastname
echo "Welcome to the Car Rental Reservation System"
while true; do
echo "Please choose an option:"
echo "1. Make a Car Reservation"
echo "2. Exit System"
read -p "Enter your choice: " choice
case $choice in
1)
read -p "Enter customer's name: " name
read -p "Enter number of days: " days
read -p "Enter size of car (S/M/F): " size
case $size in
[Ss])
cost=15
;;
[Mm])
cost=21
;;
[Ff])
cost=25
;;
esac
total=$(($days * $cost))
date=$(date +"%m/%d/%Y")
echo "Current date: $date"
echo "Customer's name: $name"
echo "Number of days: $days"
echo "Cost per day: $cost"
echo "Total cost: $total"
;;
2)
echo "Thank you for using the Car Rental Reservation System"
exit 0
;;
esac
done