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

Write an algorithm that read a number from the user “assuming the number entered is always between 1-100”, when the number enter

ed is greater than 50, a variable X is incremented by 1, otherwise, a variable Y is incremented by 1. After that check the value of X and Y, if X is greater than Y then print (Most of your numbers are greater than 50), otherwise print (Most of your numbers are less than or equals to 50), Hint: the program stops when the user entered number 0
Computers and Technology
1 answer:
AveGali [126]4 years ago
6 0

import sys

number = int (input ("Enter a number between 1 to 100 : "))

x = 0

y = 0

if number == 0:

 sys.exit()

if number > 50:

 print("Increment x value")

 x=x+1

else:

 print("Increment y value")

 y=y+1

if x > y:

  print("Most of your numbers are greater than 50")

else

  print("Most of your numbers are less than or equals to 50")

Explanation:

In this algorithm the User is asked to input the number.

If the input number is 0 then the user will exit the algorithm

If the input number is greater than 50 then  X variable is incremented by 1

If the input number is less than 50 then the variable  Y is incremented by 1

Then X and Y values are compared,if the value of x is greater than y then

and print command will print Most of your numbers are greater than 50

If the value of Y is greater than X then print command will print Most of your numbers are less than or equal to 50

You might be interested in
...................You like swamps
maks197457 [2]
Yes hehdhejddusjsjsbsjdjd
6 0
3 years ago
Read 2 more answers
HELP 99PTS If Answered
Alborosie

You will have to do this as we are not you and we do not know local business/websites. Sorry we could not help.

3 0
3 years ago
Read 2 more answers
Which of these is an example of an input?
boyakko [2]

Answer:

typing on a key board

this is the best Ans.

8 0
3 years ago
What is the top anime shows? <3
LenKa [72]

Answer:

This is personally based on my opinion.

My top 10 favorites

Toradora

Darling in the franxx

Lucky Star

My Melody

Death note

Attack on titans

One piece

The Promise neverland

Kaguya-sama: love is war

Black cover

4 0
3 years ago
Read 2 more answers
Remi always works on several projects at a time. He has thousands of files saved on his computer. Yet he always seems to be able
astraxan [27]

Answer

the micmethod <-----made by myself

Explanation:

1. alphabetical order

2.put in empty folder

3.name folder after file put file in hard drive

4.a hard drive is also a usb

5.make hard drive into necklace and wear all the time

6. now u never lose it

4 0
3 years ago
Other questions:
  • The difference between a for loop and a while loop is that a for loop is a loop that happens for a certain number of times. A wh
    14·1 answer
  • :If a process terminates, will its threads also terminate or will they continue to run? Explain your answer.
    14·1 answer
  • Select the correct answer from each drop-down menu.
    6·1 answer
  • What is the lowest layer of the OSI model at which LANs and WANs support the same protocols?
    5·1 answer
  • Why is Linux widespread in academic environments?
    7·1 answer
  • What is a file type and why is it important? Give at least three examples of file
    7·1 answer
  • write a script to check command arguments. Display the argument one by one (use a for loop). If there is no argument provided, r
    6·1 answer
  • A user input is when the user interacts with the program by typing.<br> True<br> False
    11·2 answers
  • The most important hardware device for connecting supercomputers over a wide area
    10·1 answer
  • Taran wants to work in the technology field but is unsure of which career to pursue. He has been told he has strong people skill
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!