Answer:
Please find the answer in the attached image.
Explanation:
I wrote this program using JavaScript programming language.
// A function to check tickets
function tickets(user_tickets){
var num_tickets;
if (user_tickets < 5) {
num_tickets = 1;
return ('num_tickets: '+ num_tickets);
}
else {
num_tickets = user_tickets;
return('num_tickets: '+ num_tickets);
}
}
// Testing the tickets function
// With user_tickets = 3, 5, 8, and 1
console.log(tickets(3));
console.log(tickets(5));
console.log(tickets(8));
console.log(tickets(1));