Hi! I was wandering if you\'d be able to help me with Introduction to computing.
ID: 3779470 • Letter: H
Question
Hi! I was wandering if you'd be able to help me with Introduction to computing. Need to answer some multiple choice questions within 25-30 min. If necessary I can make a donation just tell me methods to do it. Please I need help. Thank you! What value will the vanable total have after execution of the code? following code? total total while i 0 a) 24 b) 48 c) 48 d) 24 e) none of these 2) The code between a pair of curly brackets (braces) in a program is a a) function b) class c) branch d) sector e) block Based on the order of operations with c 4 and d 14, which one of the following statements is true? e) both c and dExplanation / Answer
Please follow the data and description :
1)
int i = -4, total = 2;
do {
total *= i;
i++;
} while(i < 0);
System.out.println(total);
The Output is 48.
So the answer is OPTION C (48).
2)
Block: within any class or method, the code between a pair of curly brackets is called a block.
So the answer is OPTION E (Block).
3)
Based on the order of operations for a variables execution the given options c < 4 || d > 16 && c < 7 and the c < 0 || d > 14 && d < 20 are true. So the answer is OPTION E (both c and d).
4)
int e = 3;
while(e <= 5){
cout << ++e << " " << endl;
}
So the result is 4 5 6. It is OPTION D (4 5 6).
5)
After a value is returned from a called function the program control reverts to the calling function.
SO the answer is OPTION B (Calling Function).
6)
The value that is to be returned needs to be typecasted or even converted to the defined datatype to run the code. So this is always done.
So the answer is OPTION C (Always).
7)
An external variable is a variable defined outside any function block. On the other hand, a local (automatic) variable is a variable defined inside a function block.
So teh answer is OPTION B (extern);
8)
for(int i = 1; i <= 3; i++) {
for(int j = 5; j > 2; j = j - 2){
cout << "Hello" << endl;
}
}
OUTPUT :
Hello
Hello
Hello
Hello
Hello
Hello
So the count is 6.
So the answer is OPTION C (6).
9)
If a break statement is omitted in the switch case statement then all the cases will be executed successfully.
So the answer is OPTION B (all).
10)
Given,
x = 2 + y-- = 3
So the value of y needs to be 2 as y-- = 1 and the x = 2 + y-- = 2 + 1 = 3
So teh answer is 2,1 and the OPTION C (2,1).
Hope this is helpful.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.