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
AleksAgata [21]
3 years ago
6

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
Computers and Technology
1 answer:
Genrish500 [490]3 years ago
7 0

Solution :

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
If no other row matches, the router will select the ________ row as its best match. First Last either First or Last, depending o
zzz [600]

Answer:

Last

Explanation:

Routing is a term in engineering which involves the process of selecting a path for traffic in a network or across multiple networks. It is applicable in circuit-switched networks, such as the public switched telephone network (PSTN), and computer networks, such as the Internet. It is mostly used as a term for IP Routing.

Hence, in IP Routing, the first step is comparing the packet's destination IP address to all rows, followed by selecting the nest-match row. However, If no other row matches, the router will select the LAST row as its best match.

6 0
4 years ago
WILL UPVOTE ALL plz
evablogger [386]
Ash is the answer. Hope this helps
4 0
3 years ago
Make a hierarchical directory structure under /root that consists of one directory containing three subdirectories.
Alika [10]
You can make a hierarchical directory structure under /root that consists of one directory containing subdirectories  by using cd and mkdir
the mkdir command created the directories while the cd command changes which directory you're currently in
5 0
3 years ago
Is an applications program is a program designed to perform a specific task for specific users
Vika [28.1K]

Answer:

application software or tailored software

6 0
3 years ago
What is the full form of Computer?<br>​
algol13

Answer:

Computer is just made up of hardware and software components.

Explanation:

Sorry if I didn't get your question well

7 0
2 years ago
Other questions:
  • You '' friend or ''like'' a page o your favorite social media page that advertises a
    10·1 answer
  • Write a function to add two large integers of any length, say up to 200 digits. A suggested approach is as follows: treat each n
    12·1 answer
  • Which of the following is the correct code to link the text "Sunny Days" to the website www.sunnysunshine.com?
    15·1 answer
  • Which function is going to find the lowest value in a range of numbers? MIN MAXAVERAGE COUNT
    5·1 answer
  • Beth would like to run an nmap scan against all of the systems on her organization's private network. These include systems in t
    15·1 answer
  • Please help!<br><br> What is a non-iterative programming structure?
    11·1 answer
  • Which is better? iPhone 11 Pro Max or Samsung Galaxy Note 20 Ultra 5G and why?
    12·2 answers
  • In regard to segmentation, all of the following are examples of a customer's behavior or relationship with a product EXCEPT: a)
    14·1 answer
  • Write a for loop with a range function that prints the following output. Name the target variable number. 0 1 2 3 4 5
    6·1 answer
  • How many times is the body of the loop executed?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!