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
Students at a residence hall are reporting internet connectivity issues. The university’s network administrator configured the r
alisha [4.7K]

Answer: D) DHCP snooping

Explanation:

 DHCP stand for the dynamic host configuration protocol and it is basically use as the DHCP server. It provide the IP address to each device in the network and it is used to communicate with the other IP network.

According to the question, the student device basically receive the IP network and it is an unauthorized DHCP server which uses denial of service attack for several purposes.

DHCP snooping is basically use to prevent from such unauthorized device which gives the IP address to the clients. DHCP is the two layer security system technology that is bulit in the operating system.

7 0
3 years ago
Consider the following scenario. As you troubleshoot the problem, what motherboard device would be the first to
prohojiy [21]
Check if the board is getting power, if it isn’t, than you may have a power supply issue.
8 0
3 years ago
What is a sending device? a device on which data, instructions, and information travel a device that accepts the transmission of
DENIUS [597]
<span>What is a sending device? </span>
A sending device is a device that initiates an instruction to transmit data, instructions or information.

8 0
3 years ago
If your vehicle has fuel injection and the engine is cold,
olga nikolaevna [1]
D. Press the accelerator to the floor once and release it.
6 0
3 years ago
What are the design concepts and assumptions behind a class, an object and the relationship between them? What are the roles met
Triss [41]

Answer:

Object-oriented programming (OOP) is a procedural language and based on classes associated with an object. Without classes and object relationship OOP is not possible. According to program's design concept classes provide abstraction and encapsulation with the help of object. Object have states and behaviors like cat has states like name, color and  cat has also behaviors like  wagging the tail, eating, jumping etc. A class forms template or blueprints for these states and behaviors because different cats have different behaviors and states.

Methods provide a way for encapsulation and accessing private class members with public methods and static fields are sometimes best alternative for global variable. We can use static field when it same for all and shared by all objects of that class and it can save memory because we do not have to initialize it for each object

8 0
3 years ago
Other questions:
  • Which software is used to play, create, and modify audio and video files?
    7·2 answers
  • Program for bit stuffing...?
    9·1 answer
  • Im new what are points
    6·2 answers
  • Using this tool to help you to visualize your slides and develop your content
    13·1 answer
  • Neil holds a discussion session with his clients. He recommends the kinds of network topologies the clients should consider, acc
    9·1 answer
  • Suponiendo que el centro de la gravedad de la barra se enchentra a 3 m del punto de apoyo,y su contrapeso, de 4800 N, se encuent
    14·1 answer
  • 52. An assignment statement will:
    11·2 answers
  • What is Ce stands for?
    8·1 answer
  • Please help me ASAP!
    14·2 answers
  • Plz help code practice for python
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!