1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Volgvan
3 years ago
15

Write an if-else statement for the following: If user_tickets is less than 5, assign 1 to num_tickets. Else, assign user_tickets

to num_tickets. Sample output with input: 3 Value of num_tickets: 1

Computers and Technology
1 answer:
lesya [120]3 years ago
3 0

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));

You might be interested in
The _______ move the fabric forward in the machine. A. pressure plates B. zipper feet C. hem guides D. feed dogs
Lyrx [107]
The equipment that move the fabric forward are called "Hem guides"
8 0
4 years ago
Alcohol is considered a _____ drug
andreyandreev [35.5K]
Bad.......................
8 0
4 years ago
Read 2 more answers
When you use the tilde operator (~ in a url for the attribute of a server control, it represents the _____ directory of the webs
LuckyWell [14K]
~ usually represents the home directory( or the directory from which each user's repository is immediately accessible.
none of the options are necessarily correct
6 0
3 years ago
An employee clicks on a link in an email from what looks like a fellow employee and is taken to a fraudulent web site which asks
Fittoniya [83]

Answer:

e. Phishing

Explanation:

Phishing is a type of fraudulent or social engineering attack used to lure unsuspecting individuals to click on a link that looks like that of a genuine website and then taken to a fraudulent web site which asks for personal information.

Attackers use it to steal sensitive user data or information.

5 0
4 years ago
Read 2 more answers
The control variable of a counter-controlled loop should be declared as ________ to prevent errors. Group of answer choices int
yanalaym [24]

Answer:

int

Explanation:

<h2><u>Fill in the blanks </u></h2>

The control variable of a counter-controlled loop should be declared as  <u>int </u> to prevent errors. Group of answer choices int double float Any of the above.

7 0
3 years ago
Other questions:
  • Two files named numbers1.txt and numbers2.txt both have an unknown number of lines, each line consisting of a single positive in
    11·1 answer
  • You have implemented a network where hosts are assigned specific roles, such as for file sharing and printing. Other hosts acces
    7·1 answer
  • Does anyone know a NC wise owl password I can use, it's an emergency!! I can't ask my school because they are closed and I need
    12·1 answer
  • Which of the following color palettes for the BackColor and ForeColor properties contains colors that are guaranteed to be displ
    8·1 answer
  • What does cmyk stand for?
    5·2 answers
  • 4.7 code practice question 2 edhesive i cant figure out the code for this problem csn anyone help me?
    5·1 answer
  • A python program for the following output using for loop.
    13·1 answer
  • Note that common tasks are listed toward the top, and less common tasks are listed toward the bottom. According to O*NET, what a
    14·1 answer
  • How does microsoft label mac addresses in the windows utilities that show you the mac address?
    13·1 answer
  • you are investigating the use of website and url content filtering to prevent users from visiting certain websites. which benefi
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!