Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hello! I am revising for an exam and struggling in understanding the following q

ID: 3626669 • Letter: H

Question

Hello!
I am revising for an exam and struggling in understanding the following questions.
Could you please help and explain how to do it? this is done by hand no calculators.

Q1. The base ten number 328 is equal to the hexadecimal number (base 16):
a)139 b)148 c)140 d) CA e) none of the above

Q2. In hexademimal (base 16), BF is equal to:
a)base 10 number 156 b)binary number 11011110
c)binary number 10111111 d) floating-point number 01101110 in the format discussed in the class e)none of the above

Q3. How many stars (*) are displayed when the following C++ code segment is executed?
for(int i = 0; i < 5; i += 2)
for(int j = 0; j <= i; j++ )
cout << "*" ;
a)6 b)7 c)9 d) 10 e) none of the above

The answer is c)9. ... the part i dont understand is " i += 2)" because if it was 1 it would be 10. ???

Q4.What gets displayed after the execution of the following program segment in C++?
int i = 0, j = 0;
while ( j <= 10 ) {
j += 3;
i++;
}
cout << i ;

Wouldnt it be greater than 10 as it would stop the loop there.right?

Q5: Consider the following complete program in C++.
#include
using namespace std;
int main( ) {
int a = 2, b = 3, c;
double x = 1, y;
y = b / a * x * b / a;
c = (int) y;
cout << y << ", " << c;
return 0;
}
Which of the following statement is not correct?


a)typecasting promotion takes place in the statement double x = 1, y;
b)the program output is 1.5, 1
c)compiler directive #include is needed because of the use of cout later on in the program
d)the program output is 2.25, 2
e)the statement c = (int) y; is equivalent to c = int(y);

when i do this i get 2.25, and the int wld b 2 ? why is this wrong?

q8.

1:   The disadvantages of main memory are __________.

that it is slower than secondary storage and cannot keep data without power

that it requires human intervention for operation and is limited to sequential-access

that it cannot be accessed by CPU and its capacity is limited

a) and c)

none of the above

what is the disadvantages and advantages?

1:   The disadvantages of main memory are __________.

Explanation / Answer

q(2) (C) q(3) if it was i+=1 it will print 15 stars not 10 ! q(4) j=0 i=0 j=3 i=1 (j
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote