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
svet-max [94.6K]
3 years ago
5

Provide trace tables for these loops. a. int i = 0; int j = 10; int n = 0; while (i < j) { i++; j--; n++; } b. int i = 0; int

j = 0; int n = 0; while (i < 10) { i++; n = n + i + j; j++; } c. int i = 10; int j = 0; int n = 0; while (i > 0) { i--; j++; n = n + i - j; } d. int i = 0; int j = 10; int n = 0; while (i != j) { i = i + 2; j = j - 2; n++; }
Computers and Technology
1 answer:
Eduardwww [97]3 years ago
3 0

Answer:

Following  show the trace table.

Explanation:

a)

int i = 0; int j = 10; int n = 0;

while (i < j) { i++; j--; n++;

}

i                  j             n

1                  9           1

2                 8           2                                              

3                 7            3

4                 6            4  

5                5             5                                                

b)                  

int i = 0; int j = 0; int n = 0;

while (i < 10) { i++; n = n + i + j; j++;

}

i                j             n          

1               1             2

2              2            4

3              3            9      

4              4            16

5              5            25

6              6           36

7               7           49

8               8           64

9               9           81

10             10          100

c)

int i = 10; int j = 0; int n = 0;

while (i > 0) { i--; j++; n = n + i - j; }

i              j           n

9            1           8

8           2           14  

7            3           18

6            4          20

5            5           18

4            6           14

3           7            8

2           8            0

1            9           -10

d)

int i = 0; int j = 10; int n = 0; while (i != j) { i = i + 2; j = j - 2; n++; }

i                 j                n

2                8               1

4                6               2

6                4               3

8                2               4

10              0                5

12             -2                6

14             -4                 7

...               ...                ...

...               ...               ...    

...              ...                ...

You might be interested in
How many answers do you need to be able to write messages on here??
Kipish [7]

1,000

Hope this helps!



~Courtney

3 0
3 years ago
Which activity uses a feature of a word processor?
Anvisha [2.4K]
The activity that uses a feature of a word processor is the last given answer. Recreating the same document multiple times to print multiple copies. Although some word processors have all the features stated above now a days. Word processors are helpful in composing, editing and printing text documents.
3 0
3 years ago
Read 2 more answers
How to turn off life360 without parents knowing on iphone
taurus [48]

Answer: Launch AnyGo. Once you download the AnyGo latest version, you can double click on the setup and install it on your PC.

Connect iPhone to the PC. Now take your iPhone and connect to the PC that you installed, AnyGo. ...

Check the current location. ...

Find the destination. ...

Teleport to the location. ...

6 0
3 years ago
By default, Outlook displays messages in the Content pane grouped by the
goldfiish [28.3K]

Answer:

By default, Outlook orders messages in the Content pane grouped by dates the messages were received and sorted with the oldest message at the top of the list.

Explanation:

8 0
2 years ago
Which new jobs will be in demand in the next 20 years
s2008m [1.1K]
The answer is Data Jobs, Data Analysis, Solution Architecture, Software Engineering and Product Managers, there is many more but there's just a few. Hope I helped! :)
3 0
3 years ago
Other questions:
  • Write a static method, getBigWords, that gets a single String parameter and returns an array whose elements are the words in the
    15·1 answer
  • Universal Containers has implemented a strict software architecture for their custom Apex code. One of the requirements is that
    14·1 answer
  • Which task manager tab provides details about how a program uses system resources?
    14·1 answer
  • Samantha plans an investigation in which she will study a population of animals. Which of these answers best describes the focus
    8·1 answer
  • The ____ button resets slide placeholders to their default position, size, and text formatting.
    11·1 answer
  • What steps should Jeremy take to get himself motivated to study for the test?
    12·2 answers
  • _________ is critical to Amazon's success.<br><br> SCM<br><br> JIT<br><br> ERP<br><br> VMI
    9·1 answer
  • Which is a false statement considering copyright law?
    13·2 answers
  • How many countries don't uses the metric system?​
    12·2 answers
  • Victoria has a .... of playing with her hair when she gets nervous​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!