Description of this paper

CSC 155 Exam MCQs

Description

solution


Question

Question;Question 1 1. Main memory is called ____.read only memoryrandom access memoryread and write memoryrandom read only memory3 points Question 2 1. The ____ is the brain of the computer and the single most expensive piece of hardware in your personal computer.MMROMRAMCPU3 points Question 3 1. The ____ carries out all arithmetic and logical operations.IRALUCUPC3 points Question 4 1. The ____ holds the instruction currently being executed.CUIRPCALU3 points Question 5 1. When the power is switched off, everything in ____ is lost.main memorysecondary storagehard disksfloppy disks3 points Question 6 1. ____ programs perform a specific task.ApplicationSystemOperatingService3 points Question 7 1. The ____ monitors the overall activity of the computer and provides services.Central Processing Unitoperating systemarithmetic logic unitcontrol unit3 points Question 8 1. Which of the following is NOT an output device? monitorprinterCPUsecondary storage3 points Question 9 1. ____ represent information with a sequence of 0s and 1s.Analog signalsApplication programsDigital signalsSystem programs3 points Question 10 1. A sequence of eight bits is called a ____.binary digitbytecharacterdouble3 points Question 11 1. The digit 0 or 1 is called a binary digit, or ____.bitbytecodeUnicodehexcode3 points Question 12 1. The term GB refers to ____.giant bytegigabytegroup bytegreat byte3 points Question 13 1. ____ consists of 65,536 characters.ASCII-8ASCIIUnicodeEBCDIC3 points Question 14 1. A program called a(n) ____ translates instructions written in high-level languages into machine code.assemblerdecodercompilerlinker3 points Question 15 1. A program called a(n) ____ combines the object program with the programs from libraries.assemblerdecoderlinkercompiler3 points Question 16 1. Consider the following C++ program.;#include using namespace std;int main(){cout << "Hello World "return 0,};In the cout statement, the missing semicolon in the code above will be caught by the ____.compilereditorassemblercontrol unit3 points Question 17 1. A program that loads an executable program into main memory is called a(n) ____.compilerloaderlinkerassembler3 points Question 18 1. A step-by-step problem-solving process in which a solution is arrived at in a finite amount of time is called a(n) ____.algorithmlinkeranalysisdesign3 points Question 19 1. To develop a program to solve a problem, you start by ____.analyzing the problemimplementing the solution in C++designing the algorithmentering the solution into a computer system3 points Question 20 1. In C++, the mechanism that allows you to combine data and operations on the data into a single unit is called a(n) ____.objectclassfunctionalgorithm3 points Question 21 1. Which of the following is a legal identifier?program!program_11programprogram 13 points Question 22 1. All of the following are examples of integral data types EXCEPT ____.intchardoubleshort3 points Question 23 1. Which of the following is a valid char value?-129-1281281293 points Question 24 1. The value of the expression 17 % 7 is ____.12343 points Question 25 1. The expression static_cast (9.9) evaluates to ____.9109.99.03 points Question 26 1. The length of the string "computer science" is ____.141516183 points Question 27 1. Suppose that count is an int variable and count = 1. After the statement count++, executes, the value of count is ____.12343 points Question 28 1. Suppose that alpha and beta are int variables. The statement alpha = --beta, is equivalent to the statement(s) ____. alpha = 1 - beta,alpha = beta - 1,beta = beta - 1,alpha = beta,alpha = beta,beta = beta - 1,3 points Question 29 1. Suppose that alpha and beta are int variables. The statement alpha = beta++, is equivalent to the statement(s) ____.alpha = 1 + beta,alpha = alpha + beta,alpha = beta,beta = beta + 1,beta = beta + 1,alpha = beta,3 points Question 30 1. Suppose that alpha and beta are int variables. The statement alpha = ++beta, is equivalent to the statement(s) ____.beta = beta + 1,alpha = beta,alpha = beta,beta = beta + 1,alpha = alpha + beta,alpha = beta + 1,3 points Question 31 1. Choose the output of the following C++ statement:cout << "Sunny " << '\n' << "Day " << endl,Sunny \nDaySunny \nDay endlSunnyDaySunny \nDay3 points Question 32 1. Which of the following is the new line character?\r\n\l\b3 points Question 33 1. Consider the following code.;// Insertion Point 1;using namespace std,const float PI = 3.14;int main(){//Insertion Point 2;float r = 2.0,float area,area = PI * r * r;cout << "Area = " << area alpha,cin >> ch,alpha = 17, ch = ' 'alpha = 1, ch = 7alpha = 17, ch = 'A'alpha = 17, ch = 'a'3 points Question 38 1. Suppose that x is an int variable, y is a double variable, z is an int variable, and the input is;15 76.3 14;Choose the values after the following statement executes;cin >> x >> y >> z,x = 15, y = 76, z = 14x = 15, y = 76, z = 0x = 15, y = 76.3, z = 14x = 15.0, y = 76.3, z = 14.03 points Question 39 1. Suppose that x and y are int variables, ch is a char variable, and the input is;4 2 A 12;Choose the values of x, y, and ch after the following statement executes;cin >> x >> ch >> y,x = 4, ch = 2, y = 12x = 4, ch = A, y = 12x = 4, ch = ' ', y = 2This statement results in input failure3 points Question 40 1. Suppose that ch1, ch2, and ch3 are variables of the type char and the input is;A BC;Choose the value of ch3 after the following statement executes;cin >> ch1 >> ch2 >> ch3,'A''B''C''\n'3 points Question 41 1. Suppose that ch1 and ch2 are char variables, alpha is an int variable, and the input is;A 18;What are the values after the following statement executes?;cin.get(ch1),cin.get(ch2),cin >> alpha,ch1 = 'A', ch2 = ' ', alpha = 18ch1 = 'A', ch2 = '1', alpha = 8ch1 = 'A', ch2 = ' ', alpha = 1ch1 = 'A', ch2 = '\n', alpha = 13 points Question 42 1. Suppose that ch1, ch2, and ch3 are variables of the type char and the input is;A BC;What is the value of ch3 after the following statements execute?;cin.get(ch1),cin.get(ch2),cin.get(ch3),'A''B''C''\n'3 points Question 43 1. When you want to process only partial data, you can use the stream function ____ to discard a portion of the input.clearskipdeleteignore3 points Question 44 1. Suppose that alpha, beta, and gamma are int variables and the input is;100 110 120200 210 220300 310 320;What is the value of gamma after the following statements execute?;cin >> alpha,cin.ignore(100, '\n'),cin >> beta,cin.ignore(100,'\n'),cin >> gamma,1002003003203 points Question 45 1. Suppose that ch1 and ch2 are char variables and the input is;WXYZ;What is the value of ch2 after the following statements execute?;cin.get(ch1),cin.putback(ch1),cin >> ch2,WXYZ3 points Question 46 1. Suppose that ch1 and ch2 are char variables and the input is;WXYZ;What is the value of ch2 after the following statements execute?;cin >> ch1,ch2 = cin.peek(),cin >> ch2,WXYZ3 points Question 47 1. In C++, the dot is an operator called the ____ operator.dot accessmember accessdata accessmember3 points Question 48 1. Suppose that x = 25.67, y = 356.876, and z = 7623.9674. What is the output of the following statements?;cout << fixed << showpoint,cout << setprecision(2),cout << x << ' ' << y << ' ' << z << endl,25.67 356.87 7623.9625.67 356.87 7623.9725.67 356.88 7623.9725.67 356.876 7623.9673 points Question 49 1. Suppose that x = 1565.683, y = 85.78, and z = 123.982. What is the output of the following statements?cout << fixed << showpoint,cout << setprecision(3) << x << ' ',cout << setprecision(4) << y << ' ' << setprecision(2) << z << endl,1565.683 85.8000 123.981565.680 85.8000 123.981565.683 85.7800 123.981565.683 85.780 123.9803 points Question 50 1. What is the output of the following statements?cout << setfill('*'),cout << "12345678901234567890" << endlcout << setw(5) << "18" << setw(7) << "Happy"<< setw(8) << "Sleepy" << endl,12345678901234567890***18 Happy Sleepy12345678901234567890***18**Happy**Sleepy12345678901234567890***18**Happy Sleepy12345678901234567890***18**Happy Sleepy**3 points Question 51 1. What is the output of the above statements?cout << "123456789012345678901234567890" << endlcout << setfill('#') << setw(10) << "Mickey"<< setfill(' ') << setw(10) << "Donald"<< setfill('*') << setw(10) << "Goofy" x >> y, //Line 4;Which of the following statements at Line 3 can be used to open the file progdata.dat and input data from this file into x and y at Line 4?inFile.open("progdata.dat"),inFile(open,"progdata.dat"),open.inFile("progdata.dat"),open(inFile,"progdata.dat"),3 points Question 53 1. In a ____ control structure, the computer executes particular statements depending on some condition(s).loopingrepetitionselectionsequence3 points Question 54 1. What does <= mean?less thangreater thanless than or equal togreater than or equal to3 points Question 55 1. Which of the following is a relational operator?===!&&3 points Question 56 1. Which of the following is the ?not equal to? relational operator?!|!=&3 points Question 57 1. Suppose x is 5 and y is 7. Choose the value of the following expression;(x != 7) && (x y)z = x + y,elsez = y ? x;cout << x << " " << y << " " << z < 8){cout << " ** " << endl,cout << "****" << endl,}else if (9 == 4)cout << "***" << endl,elsecout << "*" << endl,**********3 points Question 62 1. The conditional operator?: takes ____ arguments.twothreefourfive3 points Question 63 1. What is the value of x after the following statements execute?;int x,x = (5 <= 3 && 'A' 0)? x: y,.23463 points Question 65 1. What is the output of the following code?;char lastInitial = 'S;switch (lastInitial){case 'A': cout << "section 1" <> num,for (j = 1, j > num,sum = sum + num,}cout << sum num,for (int j = 1, j > num,}cout << sum << endl,1241251261273 points Question 76 1. Which executes first in a do...while loop?statementloop conditioninitial statementupdate statement3 points Question 77 1. What is the value of x after the following statements execute?;int x = 5,int y = 30;dox = x * 2,while (x < y),51020403 points Question 78 1. What is the output of the following loop?;count = 5,cout << 'St',do{cout << 'o',count--,}while (count <= 5),StStoStopThis is an infinite loop.3 points Question 79 1. Which of the following loops does not have an entry condition?EOF-controlled while loopsentinel-controlled while loopdo...while loopfor loop3 points Question 80 1. Which of the following is a repetition structure in C++?ifswitchwhile...dodo...while3 points Question 81 1. Which of the following is true about a do...while loop?The body of the loop is executed at least once.The logical expression controlling the loop is evaluated before the loop is entered.The body of the loop may not execute at all.It cannot contain a break statement.3 points Question 82 1. Which of the following is not a function of the break statement?To exit early from a loopTo skip the remainder of a switch structureTo eliminate the use of certain bool variables in a loopTo ignore certain values for variables and continue with the next iteration of a loop3 points Question 83 1. Which executes immediately after a continue statement in a while and do-while loop?loop-continue testupdate statementloop conditionthe body of the loop3 points Question 84 1. When a continue statement is executed in a ____, the update statement always executes.while loopfor loopswitch structuredo...while loop3 points Question 85 1. The heading of the function is also called the ____.titlefunction signaturefunction headfunction header3 points Question 86 1. Given the following function prototype: int test(float, char), which of the following statements is valid?cout << test(12, &),cout << test("12.0", '&&');int u = test(5.0, '*'),cout < y)return x + y,elsereturn x ? y,};what is the output of the following statement:?;cout << strange(4, 5) << endl,-119203 points Question 91 1. Given the following function;int next(int x){return (x + 1),};what is the output of the following statement?;cout << next(next(5)) << endl,56783 points Question 92 1. Given the function prototype;float test(int, int, int);which of the following statements is legal?cout << test(7, test(14, 23)),cout << test(test(7, 14), 23),cout << test(14, 23),cout tryMe(x),cout << tryMe(2.0, 3.0),cout << tryMe(tryMe(double, double), double),cout << tryMe(tryMe(float, float), float),3 points Question 94 1. Given the function prototype: double testAlpha(int u, char v, double t), which of the following statements is legal?cout << testAlpha(5, 'A', 2),cout << testAlpha(int 5, char 'A', int 2),cout << testAlpha('5.0', 'A', '2.0'),cout myFunc(y),cout myFunc('2', '3'),cout

 

Paper#37036 | Written in 18-Jul-2015

Price : $47
SiteLock