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
Vera_Pavlovna [14]
4 years ago
12

.Write an if-else statement for the following:

Computers and Technology
2 answers:
bija089 [108]4 years ago
8 0

Answer:

Solution part of the question:

if(userTickets>5)  //compare the value of userTickets with 5.

       awardPoints = 10; // assign the 10 value to the award point

       else

       awardPoints=userTickets;// assign the userticket value to the awardpoint.

Output:

For the input 4 the output is 4.

For the input 5 the output is 5.

For the input 6 the output is 10.

For the input 7 the output is 10.

Explanation:

All the other part of the program is given on the question so here only if-else statement is given on the answer part. Which is pasted at the place of "/* Your solution goes here */" and the user can get the right answer.

  • In the "if" statement the value of "userTickets" variable is get compared by 5 and if it is greater than 5 than variable "awardpoint" assigns the '10' value.
  • Otherwise, with the help of "else" statement "userticket" variables value (which is the input value for the program) assign to the "awardpoint" variable.
TiliK225 [7]4 years ago
4 0

Answer:if (userTickets < 7 ) {

        awardPoints = 1;

     }

     else {

        awardPoints = userTickets;

     }

Explanation:

You might be interested in
In 1971, Intel created and marketed the first microprocessor chip, called the Intel 4004. What was significant about this invent
PilotLPTM [1.2K]
The answer is D

<span>D) It allowed computers to be smaller because the chip allowed for the creation of computer components with varying capabilities.</span>
7 0
3 years ago
How do I change my keyboard's debounce time?
Zanzabum

in the control board type:

HKEY_CURRENT_USER\Control Panel\Accessibility\Keyboard Response\BounceTime

3 0
3 years ago
Read 2 more answers
What steps can be used to password-protect a worksheet?
muminat

Answer:

Review

Changes

Protect sheet

Explanation:

I did it

8 0
3 years ago
Write a program whose input is two integers. Output the first integer and subsequent increments of 5 as long as the value is les
adell [148]

Answer:

Following are the code to the given question:

For code 1:

start = int(input())#defining a start variable that takes input from the user end

end = int(input())#defining a end variable that takes input from the user end

if start > end:#use if that checks start value greater than end value

   print("Second integer can't be less than the first.")#print message

else:#defining else block

   while start <= end:#defining a while loop that checks start value less than equal to end value

       print(start, end=' ')#print input value

       start += 5#incrementing the start value by 5

   print()#use print for space

For code 2:

while True:#defining a while loop that runs when its true

   data = input()#defining a data variable that inputs values

   if data == 'Done' or data == 'done' or data == 'd':#defining if block that checks data value

       break#use break keyword

   rev = ''#defining a string variable rev

   for ch in data:#defining a for loop that adds value in string variable  

       rev = ch + rev#adding value in rev variable

   print(rev)#print rev value

Explanation:

In the first code two-variable "first and end" is declared that takes input from the user end. After inputting the value if a block is used that checks start value greater than end value and use the print method that prints message.

In the else block a while loop is declared that checks start value less than equal to end value and inside the loop it prints input value and increments the start value by 5.

In the second code, a while loop runs when it's true and defines a data variable that inputs values. In the if block is used that checks data value and use break keyword.

In the next step, "rev" as a string variable is declared that uses the for loop that adds value in its variable and prints its values.

3 0
3 years ago
Write the line that declares a two-dimensional array of strings named chessboard. that is, how would i declare a two-dimension a
matrenka [14]

Answer:

String chessboard[][]=new String[6][6];

Explanation:

This is the declaration of a string 2-D array in java.

String is the data type of the variable.

chessboard is the name of the variable.

6 is the size of the 2-D array.

new is the keyword for allocating  space to array.

3 0
4 years ago
Other questions:
  • Which of the following is the rarest and most valuable mineral ore among the native elements?
    13·1 answer
  • What is safe mode?
    9·1 answer
  • Taken together, the physical and data link layers are called the ____________________. Internet layer Hardware layer Internetwor
    15·1 answer
  • Which of the following is NOT contained on the Slide Show toolbar?
    11·2 answers
  • Optimizing a PC’s performance often involves utilities that can defragment disks, clean a system’s Registry, scan for malware, r
    14·1 answer
  • having your online class there's a lot of hazards and risk you may encounter while using gadget PC or Laptop whar do you usually
    14·1 answer
  • How is primary storage different from secondary storage? Select the TWO correct statements. The CPU can only read and write data
    12·2 answers
  • GRAND THEFT AUTO 5 LOLLL
    15·2 answers
  • A computer's capability of distinguishing spoken words is called?
    9·1 answer
  • What were the names of Henry VIII's six wives?
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!