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
Alinara [238K]
3 years ago
15

Write a program that asks the user to enter two integer numbers X and Y. The program halves each number between X and Y then pri

nts the values on the screen. For example: If X=5 and Y=7, the program prints the following values 5/2=2.5, 6/2=3.0 and 7/2=3.5 Sample run 1: Enter X and Y: 5 7 2.5 3 3.5 Sample run 2: Enter X and Y: 15 10 5.0 5.5 6.0 6.5 7.0 7.5

Computers and Technology
1 answer:
QveST [7]3 years ago
5 0

Answer:

`I wrote a quick script in Python, to get you started a little basic and doesn't cover much but it works

Explanation:

starting off x = input(...) and y = input(...) is simply grabbing the input from the users then I make a base array vals defined like:

vals = []

to store the calculated results

rx = int(x) and ry = int(y), are simply converting the x, y which are strings into a int type, so I can use them on this line:

for i in range(rx, (ry + 1)):

I added the + 1 to ry because the range ends at the number before Y, example:

for i in range(5, 8):

 print(i) -> 5,6,7

with all of that I simply ran an iteration <em>for loop</em> and calculated and store the results into vals presented here:

vals.append(i / 2)

If there's any confusion leave a comment I'll try my best to help out

You might be interested in
When you collaborate or meet with a person or group online, it is called
stiks02 [169]
It is called social networking.
3 0
3 years ago
Read 2 more answers
&gt;&gt;&gt; import math &gt;&gt;&gt; print(math.Pi) 3.141592653589793 &gt;&gt;&gt; def print_volume(): print ("What is the radi
kvasek [131]
I have no clue what this is asking...
8 0
3 years ago
ABC company have lots of computer running window 7. But they are not thinking to upgrade a higher version of window. One of the
Alexxx [7]

First threat

  • It's malware
  • Because chrome OS is not much secure as compare to windows 11 (Prime opponent)

2nd threat

  • It's speed
  • Chrome OS is litreally very slow .
  • On comparing to windows edition it lacks in multiple factor so you work per unit tike decreases

Third threat

  • You may be able to use Android apps but windows is made for Computers
  • In several factors like ads,cleanness chrome OS will create problems
5 0
2 years ago
Is it possible for a PowerPoint user to add notes to slides and see the added comments
Arturiano [62]

Answer:

I am not for sure on this, but yes I think it is possible for the PowerPoint user to add notes to slides and see the added comments. If it isn't possible I know for a fact on Google slides it is possible.

:

hope this helps! :)

7 0
3 years ago
Which of the following is a subsystem of computers providing access to the Internet and offering multimedia and linking capabili
lbvjy [14]
Answer is option C that is w.w.w.
6 0
3 years ago
Other questions:
  • Templates allow for the quick creation of _____.
    7·1 answer
  • Controlled intersections use some form of which of the following:
    7·1 answer
  • Need help with just #8
    12·1 answer
  • Which command displays the contents of the NVRAM?
    13·1 answer
  • Given that Apache and Internet Information Services (IIS) are the two most popular web application servers for Linux and Microso
    10·1 answer
  • Inserting and deleting text is a basic editing task in word processing.<br><br> True or false
    6·2 answers
  • Identify the angle.
    12·1 answer
  • Ha Yoon sees funny quotes on top of images frequently in her social media feed. One day, she has an idea for one of her own. Whi
    11·1 answer
  • Does anyone know this? Can someone please help me? I’ll give brainliest!!
    7·1 answer
  • What influences my school my church and my leader on my society​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!