Given the following declaration:
int j;int sum;double sale[10][7];
which of the following correctly finds the sum of the elements of the fifth row of sale?
A. sum = 0;
for(j = 0; j < 7; j++) sum = sum + sale[5][j];
B. sum = 0;
for(j = 0; j < 7; j++) sum = sum + sale[4][j];
C. sum = 0;
for(j = 0; j < 10; j++) sum = sum + sale[5][j];
D. sum = 0;
for(j = 0; j < 10; j++)
sum = sum + sale[4][j];
Answer: B
You might also like to view...
What is the purpose of the function prototype?
A. Declares variables that need to be used. B. Provides the compiler with function information. C. Allows the function to be called. D. You don’t always need a prototype.
In JavaScript, a single condition can be negated with the keyword Nor.
Answer the following statement true (T) or false (F)
import javax.swing.*;public class JFrameLook{ public static void main(String[] args) { ----Code here---- JFrame myFrame = new JFrame("Look and Feel"); myFrame.setSize(300, 120); myFrame.setVisible(true); }}In the indicated line above, write the statement to set the JFrame's look and feel using the setDefaultLookAndFeelDecorated() method.
What will be an ideal response?
The structure's form consists of the actual data stored in the symbolic names.
Answer the following statement true (T) or false (F)