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
suter [353]
2 years ago
10

a. The two programs perform the same function. Describe it. b. Which version performs better, and why

Computers and Technology
1 answer:
Ulleksa [173]2 years ago
3 0

Programs are series of instructions interpreted by a computer

  • The description of the program is to compute the square of the difference between corresponding elements of two arrays
  • The better version of the program is program A.

<h3>How to describe the programs</h3>

From the programs, we have the following highlights

  • The program iterates from 1 to n - 1
  • The iteration calculates the difference between corresponding elements of the arrays
  • The difference is then squared

Hence, the description of the program is to compute the square of the difference between corresponding elements of two arrays

<h3>The better version</h3>

The better version of the program is program A.

This is so, because the program uses fewer instructions for the same task as program B

Read more about programs at:

brainly.com/question/16397886

You might be interested in
Can anyone answer this ​
Ivenika [448]

Answer:

I dont see the question

Explanation:

7 0
3 years ago
How do you go about inserting additional worksheets into a workbook?
kicyunya [14]
The correct answer is D. All of the methods listed above are ways of inserting new sheets into a workbook.
6 0
3 years ago
Use the arr field and mystery () method below.
kolezko [41]

Answer:

The sum of all positive even values in arr

Explanation:

We have an array named arr holding int values

Inside the method mystery:

Two variables s1 and s2 are initialized as 0

A for loop is created iterating through the arr array. Inside the loop:

num is set to the ith position of the arr (num will hold the each value in arr)

Then, we have an if statement that checks if num is greater than 0 (if it is positive number) and if num mod 2 is equal to 0 (if it is an even number). If these conditions are satisfied, num will be added to the s1 (cumulative sum). If num is less than 0 (if it is a negative number), num will be added to the s2 (cumulative sum).

When the loop is done, the value of s1 and s2 is printed.

As you can see, s1 holds the sum of positive even values in the arr

7 0
3 years ago
Define the Artist class with a constructor to initialize an artist's information and a print_info() method. The constructor shou
nika2105 [10]

Answer:

class Artist():

   def __init__(self, artist_name=None, artist_birth_year=0, artist_death_year=0):

       self.artist_name = artist_name

       self.artist_birth_year = artist_birth_year

       self.artist_death_year = artist_death_year

   def display_artist(self):

       if self.artist_death_year == -1:

           print('{}, born {}'.format(self.artist_name, self.artist_birth_year))

       else:

           print('{} ({}-{})'.format(self.artist_name, self.artist_birth_year, self.artist_death_year))

class Artwork():

   def __init__(self, artwork_title=None, artwork_year_created=0, artist=Artist()):

       self.artwork_title = artwork_title

       self.artwork_year_created = artwork_year_created

       self.artist = artist

   def display_artist(self):

       print('artwork_title: {}'.format(self.artwork_title))

       print('Artist: ', end='')

       self.artist.display_artist()

def main():

   user_artist_name = input('Enter the name of artist: ')

   user_birth_year = int(input('Enter birth year: '))

   user_death_year = int(input('Enter death year: '))

   user_title = input('Enter master piece title: ')

   user_year_created = int(input('Enter year created: '))

   user_artist = Artist(user_artist_name, user_birth_year, user_death_year)

   new_artwork = Artwork(user_title, user_year_created, user_artist)

   new_artwork.display_artist()

if __name__ == "__main__":

   main()

Explanation:  

  • Inside the constructor of Artist class, initialize the essential properties.
  • Create the display_artist function that checks whether artist_death_year is equal to -1 and then displays an appropriate message according to the condition.
  • Apply the similar steps as above for the Artwork class.
  • Inside the main method, get the information from user and finally call the display_artist function to print the results on screen.
8 0
3 years ago
Write a class of complex numbers consisting of:
Gnom [1K]

Answer:

hi sorry for not knowing the answer

but please follow have a great day,night, or afternoon

3 0
3 years ago
Other questions:
  • Jason is creating a web page for his school's basketball team. He just finished creating his storyboard. Which tool should he us
    7·1 answer
  • Binary is best interpreted by a computer because?
    8·2 answers
  • Which element in the PowerPoint application is not available in the Microsoft Word application?
    12·2 answers
  • A typical analog cell phone has a frequency of 850 mhz; a digital phone a frequency of 1950 mhz. compared to the signal from an
    7·1 answer
  • Suppose x and y are int variables and ch is a char variable. Consider the following input: 5 28 36 What value (if any) is assign
    11·1 answer
  • Graphic design includes typefaces, page layouts, corporate logos, and product packaging. Which modern graphic designer is best k
    14·2 answers
  • The famous study entitled ""Protection Analysis: Final Report"" focused on a project undertaken by ARPA to understand and detect
    14·1 answer
  • 20.
    8·1 answer
  • Dragging a mouse over text is called
    9·1 answer
  • I need some help-
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!