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
Renée’s job entails using a company laptop to constantly open other peoples’ workbooks, sorting the data, importing a new sheet
nevsk [136]

she should leave and go somewhere else for a mminute to cool and then come backa nd close tabs.

6 0
3 years ago
How many generations of computers languages have there been since the middle of the 20th century
Molodets [167]
<span>There are 4 computer language generations. First is the first generation language or 1GL, second is the second-generation languages or the 2GL, next is the third-generation languages or the 3GL, and the last is fourth-generation languages or the 4GL.</span>
4 0
3 years ago
Read 2 more answers
Declare a char array named line suitable for storing C-strings as large as 50 characters, and write a statement that reads in th
zlopas [31]

Answer:

char line[50];

cin.get(line,50);

Explanation:

The "char" data type stores character data in a fixed-length field.

3 0
3 years ago
What two internetworking devices does xyz schools have to install?
patriot [66]
PC's and LAN spreaders* or internet network extenders.
*if the school uses a LAN network.
7 0
3 years ago
What are the advantages of customer relationship managment​
Delvig [45]

Answer:

Enhances Better Customer Service.

Facilitates discovery of new customers.

Increases customer revenues.

Helps the sales team in closing deals faster.

Enhances effective cross and up-selling of products.

Simplifies the sales and marketing processes.

Makes call centers more efficient.

Enhances customer loyalty.

3 0
3 years ago
Other questions:
  • What are some of the good effects of social media
    7·1 answer
  • Identify the key that would allow you to move to previous column in a row.
    11·1 answer
  • What savings account has the best rate of return on his interest
    12·1 answer
  • When is it most appropriate to quote from an e-mail message in a response?
    9·2 answers
  • Write a declaration for a class named City, which has the members cityName, a string, and position, a Location structure (declar
    10·1 answer
  • Which of the following conditions will maximize the amount of interest you earn
    5·1 answer
  • What is the purpose of a router
    13·2 answers
  • Which pair of devices have the same input motion and different outputs?
    15·1 answer
  • Which approach to bandwidth usage consumes all of the available frequencies on a medium to transmit data
    7·1 answer
  • Your team at amazon is overseeing the design of a new high-efficiency data center at hq2. a power grid need to be generated for
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!