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
What a true portrait reveal
Snowcat [4.5K]
Is simple likeness. Historically, in fact, artists used self-portraits as a kind of calling card, attesting to their ability to capture a likeness and giving a sense of their capabilities. And, yes, self-portraits are convenient exercises because the model is always available and works for free
5 0
3 years ago
Are lenovo margins expected to be stable in the china operations
lisov135 [29]

Yes

Lenovo Group Limited is the world’s number 3 PC brand. It has gained the operating margins at the perfect levels. Lenovo has attained this steady growth and it expects to maintain or improve its gross margin in China operations now and in the future.

3 0
4 years ago
Read 2 more answers
A website must have a unique address with all the following features
7nadin3 [17]

Answer:

Considering it's just the 'Address' as in the weblink the weblink doesn't need Option E -

Explanation:

5 0
3 years ago
Piers lives in an apartment and has an existing home television connection. He wants to subscribe to a high-speed internet conne
lina2011 [118]

Answer:

D. Wireless Network

Explanation:

A Wireless network has no need for cabling, trunking nor any heavy device installation. a Portable wireless device can solve his problem.

5 0
3 years ago
Nvm, Its B.
denis-greek [22]
B) which ice cream flavor do the most student prefer?
6 0
3 years ago
Other questions:
  • How can cybercriminals harm a person whose personal information they have stolen
    7·1 answer
  • How do you screen shot and copy paste the screenshot from chrome book
    11·2 answers
  • The actual database of Active Directory shared resources is stored on one or more computers designated as:
    6·1 answer
  • Hide Time Remaining A
    11·1 answer
  • Which of the following statements about version control are true? Select 3 options.
    7·2 answers
  • Who first demonstrated the computer mouse ?
    11·1 answer
  • Please help I’ll mark brainliest!
    12·2 answers
  • Test unit 8 edhesive answers ​
    15·1 answer
  • Not every design choice in your game interface requires having a thought process behind it.
    9·2 answers
  • refer to the exhibit. a user pc has successfully transmitted packets to www.cisco. which ip address does the user pc target in o
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!