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
2 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]2 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
Whenever I ask a question I loose points I just asked a question before and I had 56 points now I have 12 now I'll probably have
lilavasa [31]
Just try to answer some questions as well, then you can keep a nice balance.
ps. Only answer the questions you know. 
5 0
2 years ago
I need help here thanks forever who helps
lubasha [3.4K]

Answer:

the horse, the man, and the cactus

Explanation:

The horse is running

The man got slung off the horse, so its in motion

The cactus is flying everywhere from the horse.

3 0
1 year ago
6.4 Predicting Prices of Used Cars. The file ToyotaCorolla.csv contains data on used cars (Toyota Corolla) on sale during late s
Brums [2.3K]

Answer:

Compare the predictions in terms of the predictors that were used, the magnitude of the difference between the two predictions, and the advantages and disadvantages of the two methods.

Our predictions for the two models were very simmilar. A difference of $32.78 (less than 1% of the total price of the car) is statistically insignificant in this case. Our binned model returned a whole number while the full model returned a more “accurate” price, but ultimately it is a wash. Both models had comparable accuracy, but the full regression seemed to be better trained. If we wanted to use the binned model I would suggest creating smaller bin ranges to prevent underfitting the model. However, when considering the the overall accuracy range and the car sale market both models would be

Explanation:

8 0
3 years ago
Which menu would most likely allow you to choose a font A.file B.Edit C.format D.insert​
Ksivusya [100]

Answer:

D

Explanation:

7 0
2 years ago
Aniyah is setting up a group of computers in her office that will share several devices. Which type of operating system should s
jenyasd209 [6]

Answer:

B

Explanation:

the software needs to share thus should be networked

8 0
1 year ago
Other questions:
  • Why are resources limited? Why can't we get everything all the time?
    12·1 answer
  • In three to five sentences, describe how good e-mail work habits increase workplace efficiency and productivity.
    12·1 answer
  • Which group of commands all appear on the Standard toolbar?
    9·2 answers
  • Describe any four rights of users of information systems.
    8·1 answer
  • What is NOT a good habit when presenting to an audience?
    5·2 answers
  • Driver’s License Exam The local driver’s license office has asked you to create an application that grades the written portion o
    9·1 answer
  • Do people answer questions more on this site or be on social more ??? no right or wrong answer your opinion
    6·1 answer
  • What is the purpose of application software
    12·1 answer
  • The sameNumber method checks to see if the number of words in the phrase, numwords, is the same number of words contained in the
    5·1 answer
  • What is modern? explain​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!