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
If you could design your own home, what kinds of labor-saving computer network or data communications devices would you incorpor
Kay [80]

Answer:

Access Points, Home Server, and Virtual Assistant/IOT connected devices

Explanation:

There are three main things that should be implemented/incorporated into your design and these are Access Points, Home Server, and Virtual Assistant/IOT connected devices. Access Points for Ethernet, and HDMI should be located in various important walls near outlets. This would allow you to easily connect your devices without having to run cables around the house. A home server will allow you to easily access your data from multiple devices in your home, and if you connect it to the internet you can access that info from anywhere around the world. Lastly, would be a virtual assistant with IOT connected devices. This would allow you to control various functions of your home with your voice including lights, temperature, and locks.

4 0
3 years ago
______ is the software that prevents people from being able to access your personal information.
AleksandrR [38]

Answer:

The answer is A I hope this helps, if not I apologize.

Explanation:

8 0
3 years ago
Read 2 more answers
Which building-block feature is available in the Text grouping on the Insert tab?
saveliy_v [14]

Answer:

Business information

Explanation:

The building blocks are durable objects for content like corporate material, headings, timetables, and gallery advertising. The user can retrieve and utilize the building blocks at any time. The user can also design, saves, categorize and enter a description of their own building blocks, and tag them with keywords to help them find easily. 

Business information is one of the main features of the building block galleries that is found on the insert tab in text group.

3 0
3 years ago
Who was the first president
Firlakuza [10]
George Washington was the first president of the United States that is your answer
4 0
3 years ago
Read 2 more answers
An _____provider is a business that provides individuals and companies access to the internet for free
boyakko [2]

Answer:A B

access provider Business that provides individuals and companies access to the Internet free or for a fee.

Explanation:

6 0
2 years ago
Read 2 more answers
Other questions:
  • Which of the following is a justification for giving a Page Quality (PQ) rating of Lowest? Select all that apply. True False The
    7·1 answer
  • Safety interlock module operates by monitoring the voltage from the
    7·1 answer
  • Okay so, not really a question but whatever it’s been bothering me.
    9·2 answers
  • A very simple device that connects network components and sends packets of data to all other connected devices is called a _____
    5·1 answer
  • Why is it important to not get distracted while driving?
    13·2 answers
  • Which company operates a public cloud?<br><br> Lotus<br> Acme<br> Google<br> Symantec
    5·2 answers
  • What is the output of the following program? #include using namespace std; class TestClass { private: int val; void showVal() {
    5·1 answer
  • Using a single formatting _______ helps to make reading researched information easier; it lets the reader know what to expect.
    7·1 answer
  • I need a explanation for this 02 question for a test I will have .
    11·1 answer
  • How are the waterfall and agile methods of software development similar?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!