How could you rewrite the following code to have the arithmetic performed only once, even if the loop executes 1,000 times?while (x < a + b)// loop body

What will be an ideal response?


int sum = a + b;
while(x < sum)
// loop body

Computer Science & Information Technology

You might also like to view...

The ____________________ tool allows you to work with lists of objects such as tables and queries as well as constants, functions, and common operators to help you construct the expression for your calculation.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

StreamWriter method __________ writes a sequence of characters to a file and positions the output cursor to the beginning of the next line in the file.

a) WriteLine b) NewLine c) NextLine d) WriteMoveCursor

Computer Science & Information Technology

IBM initially contracted with ________ to create an operating system for use on their first personal computers

A) Microsoft B) Apple C) Palm D) SUN

Computer Science & Information Technology

_____ begins during systems analysis and identifies the two or three strongest contenders among the vendors.

a. ?Feasibility analysis b. ?Systems investigation c. ?Performance evaluation test d. ?Preliminary evaluation

Computer Science & Information Technology