
Patrick B. answered 07/22/21
Math and computer tutor/teacher
#!/bin/bash
echo -e "Please enter the age: "
read age
if [ "$age" -gt 18 ]
then
echo "\$Eligible to vote"
else
echo "\$Not allowed to vote"
fi
Clarissa M.
asked 07/22/21How to prompt the user to enter the age. If the age is greater than 18, then print you are eligible to vote else print you are not eligible to vote.
Patrick B. answered 07/22/21
Math and computer tutor/teacher
#!/bin/bash
echo -e "Please enter the age: "
read age
if [ "$age" -gt 18 ]
then
echo "\$Eligible to vote"
else
echo "\$Not allowed to vote"
fi
Get a free answer to a quick problem.
Most questions answered within 4 hours.
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.