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
Qu'est-ce qui motive le choix d'une autre?
Monica [59]

Actions are important because they have real-world consequences, but in seeking to understand our own and other people’s actions, it works better to have an understanding of how an action is motivated by the beliefs and values that underlie it.

Explanation:

  • The reason or reasons one has for acting or behaving in a particular way. Motivation is also defined as the general desire or willingness of someone to do something.
  • It is crucial for all of us to realize that motivation is a choice. It is entirely up to us to motivate ourselves to do what it takes to reach our goals.
  • Everything you need is in your mind, and you alone can influence that feeling of motivation
  • People exhibit roughly equal amounts of love and selfishness, and we identify people whose balance is more loving or more selfish and make choices about which we want more of in our own lives.
  • The motivation scale is one way of thinking about how we gain what we want and who is affected by our choices.
  • Your values, priorities, purpose, goals, drive, learning, love, and hope all live in motivation.
8 0
3 years ago
Desktop publishing design tools are represented by A. icons. B. windows. C. trackballs. D. modems.
AnnZ [28]
The best answer is A
Windows are the screens you can maximize and minimize.
Trackballs make the mouse move.
Modems are associated with internet connection.
Those three answers are unrelated leaving icons to be the most reasonable.
3 0
3 years ago
Subratract 11100 from 1011 by using 1's complement method step by step​
tia_tia [17]
10089 is gonna be your anwser
7 0
3 years ago
It is a part of webpage that contains the logo ang branding of the web page​
Novay_Z [31]
The answer is Header/Banner
6 0
3 years ago
Why are the relational operators called relational?
Pie
If you think about it, all "relational operators" are used to test some kind of relationship between two objects or entities. :)
3 0
4 years ago
Read 2 more answers
Other questions:
  • What is print media?
    14·1 answer
  • Which payment type is best if you are trying to sick to a budget?
    15·1 answer
  • Write a Python function called validateCreditCard that takes 8-digit credit card number as the input parameter (string value) an
    8·1 answer
  • Do routers have ip addresses? if so, how many?
    10·1 answer
  • What is a router in computer networks?
    8·1 answer
  • What are the similarities between data mining and data analytics
    11·1 answer
  • What types of character Microsoft Excel understand​
    6·1 answer
  • I need help with excel
    7·1 answer
  • Benchmark test compare similar systems performing in which tasks
    14·1 answer
  • When adopting and implementing a software as a service (saas) platform such as salesforce for your business, which responsibilit
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!