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
tatiyna
3 years ago
12

MyProgramming Lab

Computers and Technology
1 answer:
AleksAgata [21]3 years ago
4 0

Answer:

The program in Python is as follows:

#1

d = int(input("distance: "))

n = int(input("n: "))

arith_prog = []

for i in range(1,n+1,d):

   arith_prog.append(i)

print(arith_prog)

#2

d = int(input("distance: "))

m = int(input("m: "))

n = int(input("n: "))

arith_prog = []

for i in range(m,n+1,d):

   arith_prog.append(i)

print(arith_prog)

#3

r = int(input("ratio: "))

n = int(input("n: "))

geom_prog = []

m = 1

count = 0

while(m<n):

   m = r**count

   geom_prog.append(m)

   count+=1

print(geom_prog)

Explanation:

#Program 1 begins here

This gets input for distance

d = int(input("distance: "))

This gets input for n

n = int(input("n: "))

This initializes the list, arith_prog

arith_prog = []

This iterates from 1 to n (inclusive) with an increment of d

for i in range(1,n+1,d):

This appends the elements of the progression to the list

   arith_prog.append(i)

This prints the list

print(arith_prog)

#Program 2 begins here

This gets input for distance

d = int(input("distance: "))

This gets input for m

m = int(input("m: "))

This gets input for n

n = int(input("n: "))

This initializes the list, arith_prog

arith_prog = []

This iterates from m to n (inclusive) with an increment of d

for i in range(m,n+1,d):

This appends the elements of the progression to the list

   arith_prog.append(i)

This prints the list

print(arith_prog)

#Program 3 begins here

This gets input for ratio

r = int(input("ratio: "))

This gets input for n

n = int(input("n: "))

This initializes the list, geom_prog

geom_prog = []

This initializes the element of the progression to 1

m = 1

Initialize count to 0

count = 0

This is repeated until the progression element is n

while(m<n):

Generate progression element

   m = r**count

Append element to list

   geom_prog.append(m)

Increase count by 1

   count+=1

This prints the list

print(geom_prog)

You might be interested in
The problem of using IP numbers for addressing hosts in the Internet are resolved using
Contact [7]
Hello <span>Vignesh121 </span><span>

Answer: The problem of using IP numbers for addressing hosts in the Internet are resolved using </span>splitting IP addresses into four octets.


Hope this helps
-Chris
8 0
4 years ago
What are the advantages of cloud computing over computing on premises?
Verdich [7]

Answer:

answer my question

Explanation:

<h3>open my account. i need help.</h3>
3 0
2 years ago
What happens when you press the Enter key at the end of a line of bulleted text?
sladkih [1.3K]

i think the  answer is d

6 0
4 years ago
Read 2 more answers
An air-conditioning system's automatic controller might directly control the
yaroslaw [1]
Control the temperature of the system and as well as how long the system will run
5 0
3 years ago
Read 2 more answers
How does a cloud-first strategy differ from other approaches to cloud?
Irina18 [472]

Cloud-first strategy differ from other approaches as It keeps all the services performed by legacy systems while moving to the Cloud in a staggered approach.

<h3>What is a cloud first strategy?</h3>

The change of cloud computing has brought about  “cloud-first” strategy.

This  is known to be a way to computing that tells that a firm should look first to cloud solutions when creating new processes or taking in old processes before taking in non-cloud-based solutions.

Note that Cloud-first strategy differ from other approaches as It keeps all the services performed by legacy systems while moving to the Cloud in a staggered approach.

See options below

it enables an organization to completely move to the cloud without infrastructure or support requirement

it keeps all the services performed by legacy systems while moving to the cloud in a staggered approach.

it partners technology with multiple other disciplines for comprehensive business transformation.

it uses artificial intelligence to automate all business processes and completely eliminate human error.

Learn more about cloud from

brainly.com/question/19057393

#SPJ1

6 0
2 years ago
Other questions:
  • Which type of attack modifies the fields that contain the different characteristics of the data that is being transmitted?
    7·1 answer
  • A router is a device that addresses a packet on a network to the next router along the line. Under which layer of the OSI model
    5·1 answer
  • ____ allows you to control how objects enter, move on and exit slides
    13·2 answers
  • The computer output for integer programs in the textbook does not include reduced costs, dual values, or sensitivity ranges beca
    14·1 answer
  • Question 2 (2 points)
    6·1 answer
  • Pseudocode is a good choice to communicate a____of a process
    10·1 answer
  • What means the data is still saved even if you turn the computer off or unplug it?​
    5·1 answer
  • 2. The Warren Commission investigated the assassination of President _______________________ in 1964.
    6·1 answer
  • Javed’s teacher tells him she would like to see him improve his speaking skills in the next debate by including a rhetorical app
    9·1 answer
  • Match each type of video camera to its features:
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!