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.

#!/bin/bash

#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

Here's an example of a script written in Unix shell script:

```bash
#!/bin/bash

while true; do
echo "Main Menu:"
echo "1. Make a Car Reservation"
echo "2. Exit System"

read -p "Enter your choice: " choice

case $choice in
1)
read -p "Enter customer name: " customer_name
read -p "Enter number of days to rent a car: " num_days

while true; do
read -p "Enter car size (S/M/F): " car_size

case $car_size in
[Ss])
cost_per_day=15
break
;;
[Mm])
cost_per_day=21
break
;;
[Ff])
cost_per_day=25
break
;;
*)
echo "Invalid car size choice!"
;;
esac
done

total_cost=$((num_days * cost_per_day))

echo "Current date: $(date)"
echo "Customer name: $customer_name"
echo "Number of days: $num_days"
echo "Cost per day: $cost_per_day"
echo "Total cost of renting a car: $total_cost"
echo
;;
2)
echo "Exiting system..."
exit 0
;;
*)
echo "Invalid choice! Please try again."
;;
esac
done
```

Save the script into a file named `final_YourLastname`, for example `final_Smith`. Make sure the file has executable permission (`chmod +x final_Smith`). Then you can run the script by executing `./final_Smith`. The script will display the main menu and prompt for user input until they choose to exit the system.

Certainly! Here's an example of how you can write the script using a Unix-based shell scripting language such as Bash:

```bash
#!/bin/bash

while true; do
clear # Clear the screen

echo "****** Car Rental Reservation System ******"
echo "1. Make a Car Reservation"
echo "2. Exit System"
read -p "Enter your choice: " choice

case $choice in
1)
clear
read -p "Enter customer name: " name

while true; do
read -p "Enter number of days for car rental: " days
if [[ $days =~ ^[0-9]+$ ]]; then
break
else
echo "Invalid input. Please enter a valid number."
fi
done

clear
echo "Car size options:"
echo "S or s -> Small size"
echo "M or m -> Medium size"
echo "F or f -> Full size"
read -p "Choose a car size: " car_size

case $car_size in
S|s)
cost_per_day=15
;;
M|m)
cost_per_day=21
;;
F|f)
cost_per_day=25
;;
*)
echo "Invalid car size choice. Please choose a valid car size."
continue
;;
esac

total_cost=$((days * cost_per_day))
current_date=$(date +"%Y-%m-%d")

clear
echo "Reservation details:"
echo "Date: $current_date"
echo "Customer Name: $name"
echo "Number of Days: $days"
echo "Cost per Day: $cost_per_day"
echo "Total Cost: $total_cost"

read -p "Press Enter to continue..."
;;

2)
clear
echo "Exiting the system. Goodbye!"
exit 0
;;

*)
echo "Invalid choice. Please choose a valid option."
;;
esac
done
```

To create and run the script, follow these steps:
1. Open a text editor and copy the script into a new file.
2. Save the file with the desired name, for example, `final_York`.
3. Open a terminal and navigate to the directory containing the script file.
4. Make the script executable by running the command: `chmod +x final_York`.
5. Run the script by executing the command: `./final_York`.

The script will display a menu with options to make a car reservation or exit the system. You can then follow the prompts to enter the necessary information for the reservation. After each reservation, it will display the details and give you the option to make another reservation or exit the system.