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
iragen [17]
3 years ago
7

The following section of psudo code inputs a number n, multiplies together 1 x 2 x 3 x ..... x n, calculates input number/sum an

d output result of the calculations.
locate 3 errors and suggest a corrected piece of code.

INPUT n
FOR mult = 1 TO n
sum = 0
sum = sum * mult
result = n / sum
NEXT
PRINT result
Computers and Technology
1 answer:
xenn [34]3 years ago
4 0

Answer:

INPUT n

sum = 1

FOR mult = 1 TO n

sum = sum*mult

NEXT

result = n/sum

PRINT result

Explanation:

sum should not be defined inside the for loop because it will reset to the initial number after every loop iteration which is not what is desired. Sum should not be 0 if it is being multiplied then divided. This will cause an error. Result should be calculated after sum has settled on a final number, after the loop has finished.

You might be interested in
]
loris [4]
B. Which promotes a chemical reaction
5 0
3 years ago
The working window of a presentation is the _____.
stepan [7]
The answer would be slide
8 0
4 years ago
Read 2 more answers
If you want to remove the autocorrect options button from the screen, you can press the ____ key.
Luden [163]

Answer:

ESC

Explanation:

It allows the user to abort, cancel, or close an operation.

3 0
2 years ago
What is a characteristic ofa good cloud-based hosting?
Aliun [14]

Answer:

Explanation:

A good cloud-based hosting has many beneficial characteristics, some of which include on-demand self-service, broad network access, and being very elastic and scalable. These characteristics allow for a large number of users to benefit from the service at any time of the day and at a very fast speed due to the broad network access.

6 0
3 years ago
Write a function called printbackwards() that will work with a c++ string. the function will print any c++ string backwards. you
dangina [55]
Hi!

Well, this isn't exactly a question - but rather just a request. However, I'm going to attempt to try and <em>describe </em>to you how to approach this problem, instead of just writing the code for you and sending you on your way.

So, what's our general base goal here? We want to take a string into a function, and then print it out backwards. Seems simple enough!

Right away, we already have an idea how to set this code up. We need a main method which will call <em>PrintBackwards(), </em>which will have to take a parameter of type string. 

This would look something like <em>PrintBackwards(string baseString). </em>Inside this method, we'd have to do something so we can see each character in this string and then store it in a new string. 

I encourage you to try and tackle this on your own, but I can give you an idea. We can have a new valueless variable called reversedString, which will store our baseString but backwards.

We could try looping through the baseString for each character it possesses, and then keep adding onto our reversedString by doing something like +=. What I mean, is we'd access the very last index of baseString, and then keep appending characters into it. 

So our loop would look something like <em>for(int i = baseString.length; i > 0; i--) {}. 

</em>I haven't used C++ in awhile, so you'll have to find the specific syntax requirements. But with that loop, i represents the index of each character in baseString. It starts with the last index, and keeps going down in reverse.
<em>
</em>Inside our loop, we could do something like reverseString += baseString.index(i); Again, I don't remember the specific syntax - so you'll have to do this on your own.
<em>
</em>Hopefully, this helps! =)<em>
</em>
6 0
3 years ago
Other questions:
  • Add the number <br><br> 10010110+10111101
    12·2 answers
  • Write a program that reads an unspecified number of integers, determines how many positive and negative values have been read, a
    13·2 answers
  • How many water bottles must be collected to win?
    8·2 answers
  • Choose the reasons why Windows Server operating systems are a popular choice for a network because they _____. Select all that a
    12·1 answer
  • Digital dashboards provide the decision makers with a quick overview of key performance indicators and other key operational sta
    13·1 answer
  • Explain the differences between kernel applications of the OS and the applications installed by an organization or user.
    6·1 answer
  • What is jcl language on the mainframe?
    10·1 answer
  • If the code for CAT is ECV what is the code for DOG? *
    9·2 answers
  • Definition of the term social factor and explain why texting while driving can be classified as a social factor causing accident
    6·1 answer
  • What is considered an important ethical consideration when working with families
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!