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
Solnce55 [7]
3 years ago
7

Write an if-else statement for the following: If userTickets is less than 5, execute awardPoints = 1. Else, execute awardPoints

= userTickets. Ex: If userTickets is 3, then awardPoints = 1.
var awardPoints = 0;var userTickets = 4; // Code will be tested with values: 4, 5 and 6
Engineering
1 answer:
LiRa [457]3 years ago
5 0

Answer:

Explanation:

#no programing language stated, but using python.

awardPoints = 0

userTickets = 4

userTickets = int(input("Enter the number tickets"))  #this statement gets the user input

If userTickets < 5: #this test the first user input

awardPoints = 1

elif userTickets ==3:

awardPoints = 1

else:

awardPoints = userTickets

print("The awardpoints is ", awardPoints)

You might be interested in
While discussing run-flat tires: Technician A says that some are self-sealing tires and are designed to quickly and permanently
musickatia [10]

Answer:

The correct option is d ( Neither A nor B)

Explanation:

Technician A made 2 mistakes in his statement.Firstly the tire is self supporting not self sealing.

Secondly, this tire does not provide permanent sealing of punctured area option a is incorrect.

This self-supporting tire after being affected with complete air leakage can temporarily bear the load of the car and avoid rolling over a distance of 80 km at a maximum speed of 55 mph. Here is what technician B suggested incorrectly as the tire after being.Here the technician B suggested incorrectly as the tire after being affected with puncture can not travel at any speed so option B is wrong

Since option a and b are incorrect and c is invalid.

4 0
3 years ago
A brittle material is subjected to a tensile stress of 1.65 MPa. If the specific surface energy and modulus of elasticity for th
8090 [49]

Answer:

The maximum length of a surface flaw that is possible without fracture is

2.806 \times 10^{-4} m

Explanation:

The given values are,

σ=1.65 MPa

γs=0.60 J/m2

E= 2.0 GPa

The maximum possible length is calculated as:

\begin{gathered}a=\frac{2 E \gamma_{s}}{\pi \sigma^{2}}=\frac{(2)\left(2 \times 10^{9} \mathrm{~N} / \mathrm{m}^{2}\right)(0.60 \mathrm{~N} / \mathrm{m})}{\pi\left(1.65\times 10^{6} \mathrm{~N} / \mathrm{m}^{2}\right)^{2}} \\=2.806 \times 10^{-4} \mathrm{~m}\end{gathered}

The maximum length of a surface flaw that is possible without fracture is

2.806 \times 10^{-4} m

7 0
3 years ago
A manager has a list of items that have been sorted according to an item ID. Some of them are duplicates. She wants to add a cod
ruslelena [56]

Answer:

The solution code is written in Python:

  1. items = [{"id": 37697, "code": ""},{"id": 37698, "code": ""},{"id": 37699, "code": ""},{"id": 37699, "code": ""}, {"id": 37699, "code": ""},
  2. {"id": 37699, "code": ""},{"id": 37699, "code": ""},{"id": 37699, "code": ""},{"id": 37700, "code": ""} ]
  3. items[0]["code"] = 1
  4. for i in range(1, len(items)):
  5.    if(items[i]["id"] == items[i-1]["id"]):
  6.        items[i]["code"] = items[i-1]["code"] + 1
  7.    else:
  8.        items[i]["code"] = 1
  9. print(items)

Explanation:

Firstly, let's create a list of dictionary objects. Each object holds an id and a code (Line 1-2). Please note all the code is initialized with zero at the first beginning.

Next, we can assign 1 to the <em>code</em> property of items[0] (Line 4).

Next, we traverse through the items list started from the second element (Line 6). We set an if condition to check if the current item's id is equal to the previous item (Line 7). If so, we assign the previous item's code + 1 to the current item's code (Line 8). If not, we assign 1 to the current item's code (Line 10).

At last, we print out the item (Line 12) and we shall get

[{'id': 37697, 'code': 1}, {'id': 37698, 'code': 1}, {'id': 37699, 'code': 1}, {'id': 37699, 'code': 2}, {'id': 37699, 'code': 3}, {'id': 37699, 'code': 4}, {'id': 37699, 'code': 5}, {'id': 37699, 'code': 6}, {'id': 37700, 'code': 1}]

 

6 0
4 years ago
What is a dynamic load? *
alexira [117]
Answer: Bricks in Building
8 0
3 years ago
How many ticks are in a inch?<br><br><br> A: 12<br> B: 10<br> C: 8<br> D: 16
slamgirl [31]

Answer:

16

Explanation:

since each tick is 1/16 of the inch, there will be 16 ticks

4 0
3 years ago
Other questions:
  • A 15-ft A992 W10 x 54 beam-column is part of a braced frame and is subjected to a service dead load of 100 kips and a service li
    13·1 answer
  • Reserve Problem 4.006 Tutorial SI
    14·1 answer
  • The efficiency of an electric motor is 80%. If it supplies 6 kW of rotational output power, calculate the amount of electrical i
    8·1 answer
  • The purpose of government in a command economy is to
    6·1 answer
  • ____________________________________________ help scientists understand processes in the natural world by providing simpler repr
    11·2 answers
  • Mr. Ray deposited $200,000 in the Old and Third National Bank. If the bank pays 8% interest, how much will he have in the accoun
    10·2 answers
  • The nuclear reactions resulting from thermal neutron absorption in boron and cadmium are 10B5 + 1 n0 ï  7Li3 + 4He2 113Cd48 + 1
    9·1 answer
  • Why might there be multiple foremen on one work site?
    11·1 answer
  • What are the causes and solutions of social problems ?what are the causes and solutions of social problems ​
    15·1 answer
  • FD=CD*((P*(V^2)*A)/2)<br><br>Please solve for V
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!