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
Neko [114]
2 years ago
6

Please help me on this coding problem :)

Computers and Technology
1 answer:
Vesnalui [34]2 years ago
4 0

Answer:

a=4 , b=1

Explanation:

I'm not a computer science major at all but I think I can help you with this code.

Our program wants us to add 2 to a get new a value while also subtracting 1 from b value to obtain new b value. We we want to for for as long b is not 0 and a/b is nonnegative.

One round we get:

New a=0+2=2

New b=3-1=2

Let's see if we can go another round:

New a=2+2=4

New b=2-1=1

We can't go another round because b would be negative while a is positive which would make a/b negative. So our loop stops at this 2nd round.

a=4 , b=1

Other notes:

2nd choice makes no sense because a is always going to increase because of the addition on a and b was going to decrease because of the subtraction on it.

Third choice makes no sense because a/b doesn't even exist.

Fourth choice a/b is negative not nonnegative.

You might be interested in
Midday is a good time to take a portrait outside.<br> true or false?
Over [174]

Answer:

B: False

Explanation:

edg2020

4 0
2 years ago
How much will your assignment be docked if you turn it in late?
o-na [289]
We don’t know ms.Fredrick, you’re on your own here
7 0
3 years ago
Read 2 more answers
How do you determine latitude using an astrolabe?
miv72 [106K]
This was really useful in determining one's location during the times when technology wasn't that advanced yet. First is that it depends as to what time of the day is it being used. If used at day, most probably at high noon, the altitude of the sun would be measured and recorded and/or remembered. Most of the times, the latitude is determined during the day since it is much easier. At night, a star of known declination will be substituted to the sun. Most of the times, the North Star is used. Then, an almanac will be utilized to determine the declination of the Sun or the star, depending on which was used. After which, the formula is applied, which is latitude = 90 degrees - measured altitude +declination.
3 0
3 years ago
A(n) _____ is a simple database program whose records have no relationship to one another.
almond37 [142]
"flat file"

A simple database program whose records have no relationship to one another<span>single</span>
7 0
3 years ago
F he continues to make monthly payments of $100, and makes no new purchases, how many more payments will he have to make before
castortr0y [4]

What is the interest rate?

Divide the total amount due by 100.

8 0
3 years ago
Other questions:
  • Which statement is true regarding the Quick Access toolbar?
    11·2 answers
  • An icon in a document preset that looks like the play button on a YT video, what type of document is the preset meant to be used
    13·2 answers
  • What do you click on to minimize all open windows? the Show Desktop icon the Start menu the system tray the taskbar
    15·2 answers
  • Pls help! ive been looking everywhere online but I couldn't find the answer to this:
    5·1 answer
  • The need to strike a<br>- among work, life, family, and other responsibilities is<br>universal.​
    15·1 answer
  • How can we style the images and layouts of our pages?
    8·1 answer
  • Es costoso construir un robot
    6·1 answer
  • 17. What are the basic modes of operation of 8255?Write the features of mode 0 in 8255?
    8·1 answer
  • A form of segmentation that is based on user usage rate, user status, purchase occasion, and benefits sought is _________.
    13·1 answer
  • What are some of the most common obstacles in video games?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!