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
slavikrds [6]
3 years ago
14

What is the printout of the call nPrint("a", 4)?

Computers and Technology
1 answer:
satela [25.4K]3 years ago
5 0

Answer:

aaaa

Explanation:

We have a function nPrint which return type is void, it means it returns nothing.

we declare the two parameters, one parameter is string type and the second parameter is an integer type.

Then, it has a while loop that executes the statement again and again until the condition not FALSE.

Let dry run the code:

First, call the function nPrint("a", 4) bypassing the value in the argument.

then, the value receives by the parameters, the message contains "a" and n contain 4. After that, while loop checks the condition 4 > 0, which is TRUE and the program starts executing the statement.

The program prints the message on the screen "a" and then decreases the value of n by 1. So, the value of n becomes 3.

The above process repeats for the value of n = 3, 2, 1

and print the message "aaaa".

then, the condition becomes false and the program terminates the loop.

Therefore, the answer is aaaa

You might be interested in
Program 3.Study the code carefully and write out the line where there is error, debug it and write out the correct code
stich3 [128]

Answer:

Several errors:

  • 0 where ( ) was intended (probably OCR problem)
  • space between As and Double
  • Single quote in stead of double quote in text string
  • $ in stead of & near Math.sqrt
  • missing spaces around "is" for proper formatting

5 0
3 years ago
write a function that takes two integer arrays as input return true if any two of the numbers in the first array input add up to
Afina-wow [57]

Answer:

Explanation:

This program is written in Python. It is a function that takes in two arrays. Then it loops through the first array twice, adding each element with the others and comparing the sum to the values in the second array. If a similar value is found in the second array, the program prints out the value and returns True to the user. Otherwise, it returns False. A test case has been created with two array variables that print out False, the output can be seen in the attached image below.

def sumArray(arr1, arr2):

   for i in range(len(arr1)):

       for x in range(len(arr1)):

           sum = 0

           if i != x:

               sum = arr1[i] + arr1[x]

           if sum in arr2:

               print(str(sum) + "Found in Second Array")

               return True

   return False

arr1 = [1, 9, 10, 44]

arr2 = [2, 4, 8, 14]

print(sumArray(arr1, arr2))

8 0
3 years ago
CIST 1122 Project 2 Instructions
NikAS [45]

Answer:

it is suppost ro be at

least 20 tb

Explanation:

5 0
3 years ago
Which icons allows you to add a style to a chart
ZanzabumX [31]
Click on your chart and go under Table Tools, Design... then you should see the different styles. ;)
5 0
3 years ago
What do the points on this website do?
DanielleElmas [232]

Answer:

They allow you to ask more questions and also your rank goes up or down.

Explanation:

5 0
3 years ago
Read 2 more answers
Other questions:
  • In this type of network, data is certain to reach its destination.
    7·1 answer
  • Which of the following functions and expressions will convert the ASCII character "Z" to its numeric equivalent ASCII code?
    7·1 answer
  • Which type of electronic community displays discussions on different topics in threads?
    8·1 answer
  • Vector testGrades contains NUM_VALS test scores. Write a for loop that sets sumExtra to the total extra credit received. Full cr
    7·1 answer
  • You are almost finished updating a Website. As part of the update, you have converted all pages from HTML 4.0 to HTML5. The proj
    7·1 answer
  • Sarah used a grid to create this layout for a website. Which rule of composition did Sarah use for the grid?
    7·2 answers
  • Write a program that gets three input characters which are user's initials and displays them in a welcoming message. Then gets i
    12·1 answer
  • Choose the best collection for each situation.
    8·1 answer
  • Which of the following items can you locate in a document using the navigation pane? Choose the answer.
    10·1 answer
  • Mechanisms that can be used to rescue accident victims
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!