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

Please help me on this coding problem :)

Computers and Technology
1 answer:
Vesnalui [34]3 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
On the server side, the database environment must be properly configured to respond to clients' requests in the fastest way poss
Paraphin [41]

Answer:

<em>DBMS Performance </em>

Explanation:

Database tuning <em>defines a range of activities that are used to maximize and homogenize a database's output.</em>

This typically coincides with query tuning, but applies to database file layout, DBMS software selection, and database environment setup (operating system, CPU).

Database tuning helps to optimize the use of machine resources in order to carry out work as efficiently and quickly as possible.

Many systems are built to handle their use of system resources, but there is still plenty of space for enhancing their performance by tailoring their server and DBMS settings and configuration.

5 0
3 years ago
Write a Python program that inputs an integer between 0 and 1000 and adds all the digits in the integer. For example, if integer
nignag [31]

I've included my code in the picture below.

5 0
3 years ago
to move from the second cell in the table in the accompanying figure back to the previous cell, press the ____ key(s)
Serhud [2]
I believe the answer is Shift + Tab
8 0
3 years ago
is this statement true or false ? satelite and remote sensing devices have helped cartographers make more accurate maps with spe
Genrish500 [490]

Answer:

Yes this statement is true

Explanation:

Satelites help show a visual to cartographers to make more accurate maps easier.

3 0
3 years ago
The manufacturer doesn't need it the buyer doesn't want it the user doesn't know they're using it
Vikentia [17]
That means that the production vause a loss in supply and demand
6 0
3 years ago
Other questions:
  • Is anyone familiar in drawing flow charts for c++ programming
    14·1 answer
  • What is the order of arrangement of files and folders on a computer?
    15·1 answer
  • What is an efficient way to ensure that the code is working as per the acceptance criteria/business requirements? (1 correct ans
    11·2 answers
  • What is project scope? a. Quantifiable criteria that must be met for the project to be considered a success b. Products, service
    5·1 answer
  • Microsoft's ____ is one of the major web-based development environments.
    12·1 answer
  • For a parking payment app, what option would MOST likely connect a user to a third party/external gateway?
    10·1 answer
  • A person who creates a computer virus is a (1)system analyst (2) techician(3) programmer​
    11·2 answers
  • Declare a typedef struct named jumper_t that will have four parts: character array name that is 16 in length, double array of tr
    12·1 answer
  • WILL GIVE BRAINLIEST! 20 POINTS! PLZ HELP!
    14·2 answers
  • Roles of computer in business areas​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!