Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

1 CSC 101 Computer Science 1 – Final Exam Fall 2021 Student Name: ________________________________________________ School ID: _____________________ Section Number: ______________ Sections: • H004 Test...

1 answer below »

1
CSC 101 Computer Science 1 – Final Exam
Fall 2021
Student Name: ________________________________________________
School ID: _____________________
Section Number: ______________
Sections:
• H004
Test Breakdown
Concept Knowledge 60 %
Program Analysis 25 %
Program Writing 15 %
Statement on Integrity
This test is closed note, closed book, closed electronic device, and closed partner.
You are permitted a calculator and a writing utensil. Any violation of these
policies will result in an automatic zero and an immediate refe
al to the Honor
Code office.
Last Name:____________________
2
Grade: ________________________________
Concept Knowledge
Match the following definitions and statements to the terms listed on the right. Note that some terms
may be used more than once while others may not be used at all. (1.5 pts each)
Part 1
___________ 1. This is the smallest unit of a computer program. Part 1 Terms
A. Else If
Statement
B. Bit
C. Output
D. Hardware
E. Programming
Statement
F. Process
G. Relational
H. If Statement
I. Software
J. Else Statement
K. Input
L. Comment
M. Token
N. Logical
O. Byte
___________ 2.
This allows us to incorporate a one-way
selection in our program, where a set of
statements get executed when an expression
evaluates to true.
___________ 3.
This is a single line of code in a computer
program.
___________ 4.
This is a type of operator that allows us to
“chain” together other expressions to form
complex logical
elational expressions.
___________ 5.
This allows us to incorporate a two-way
selection in our program, where one set of
statements execute when an expression
evaluates to true while the other set execute
when the expression evaluates to false.
___________ 6.
In this phase of a program’s computation, data is
collected/gathered/generated from an outside
source.
___________ 7. This is the basic unit of measurement of computer data.
___________ 8. This allows us to incorporate a multi way selector in our program.
___________ 9.
This is used to annotate and describe computer code and is ignored when
the program is executed.
___________ 10. This is the physical/tangible components of a computer.
Last Name:____________________
3

Part 2
___________ 11.
This is the phase of a for loop where the
counting variable in initialized/created.
Part 2 Terms
A. Syntax
B. Design
C. Pre-Test
D. Initialization
E. Runtime
F. Post Test
G. Step
H. Develop
I. Argument
J. Flowcharts
K. Prototype
L. Logical
M. Condition
N. Sentinel
O. Pseudocode
P. Parameter
Q. Test
R. Body
___________ 12.
This type of e
or occurs when the operating
system/computer cannot execute a line of code
in a program while the program is executing.
___________ 13.
In this stage of the Waterfall Model, the app is
checked and executed to ensure there are no
e
ors in the program.
___________ 14.
This will make a function one that returns
nothing back to where it’s called.
___________ 15.
This type of variable is one that can be used
throughout the entire program.
___________ 16.
This type of design approach involves creating a
high level/informal description of a program
that does not adhere to any programming
language’s rules.
___________ 17.
A do while loop is called this since the body executes first rather than the
expression.
___________ 18. This is a type of variable that a function uses to store its input.
___________ 19.
This allows us to redefine the scope of a function so that we may define it
elow main.
___________ 20. This type of loop repeats as long as the user needs to enter input.
Last Name:____________________
4

Part 3
___________ 21.
The process of inputting from a file is called
this.
Part 3 Terms
A. Reading
B. Element
C. In Bounds
D. Out of Bounds
E. Looping
F. Substring
G. Erase
H. Pass by Reference
I. Traversing
J. Index
K. Find
L. Pass by Value
M. Writing
___________ 22.
The process of outputting to a file is called
this.
___________ 23.
This is another name for the process of
stepping through an a
ay.
___________ 24.
This is the numerical non-negative position of
an element that is being accessed.
___________ 25.
This type of argument passing results in the
argument’s values being copied to the
function’s parameters.
___________ 26. This is a cutout of a larger string, in a sense.
___________ 27.
This is an issue when you try to access an element that does not exist in the
a
ay by using an invalid index.
___________ 28.
This type of a
ay organizes its elements in a linear fashion, and each
element has one index number that represents its position in the a
ay.
___________ 29.
This function allows a programmer to determine the index location of the
first occu
ence of a given character.
___________ 30. These are the individual components that make up an a
ay.
Last Name:____________________
5

31. Briefly describe 2 reasons why need functions. (7 pts)
32. Briefly explain why it is unfeasible to only use variables in a program to store large amounts of
data, and why a
ays make data organization easier (8 pts).
Last Name:____________________
6

Analysis
33. Read the following code:
const int SIZE = 9;
int a
[SIZE] = { 90, 23, 86, 78, 45, 102, 91, 594, 33 };
int input;
cout
"Give me a number: ";
cin
input;
cout
"\n";
for (int i = 0; i < SIZE; i++)
{
if (a
[i] > input && a
[i] % 2 == 0)
cout
a
[i]
"\n";
}
a. If the user enters “23” as input into this program, indicate the output of the
program. If there is no output, then specify “no output”. (1 pts)
. If the user enters “800” as the input into this program, indicate the output of the
program. If there is no output, then specify “no output”. (1 pts)
c. If the user enters “78” as the input into this program, indicate the output of the
program. If there is no output, then specify “no output”. (1 pts)
d. Describe the purpose of this program. (2 pts)
Last Name:____________________
7

34. Take the following examples and match each to its token type (5 pts):
float ________________________
function_b ________________________
892.31 ________________________
&& ________________________
else ________________________

35. Read the following code (5 pts):
a. What is the return type of this function(1 pt)
. What are the parameters of this function? What are their data types? (1 pt)
c. What type of argument passing does this function implement? (1 pt)
d. Briefly describe how this function works. (2 pts)
void swap(int &a, int &b)
{
int temp = a;
a = b;
b = temp;
}
Last Name:____________________
8

36. Take the following code:
Code A Code B

int x;

cout
"Enter your grade: ";
cin
x;

cout
"You received a grade of ";

if (x < 60)
cout
"F";

else if (x < 70)
cout
"D";

else if (x < 80)
cout
"C";

else if (x < 90)
cout
"B";

else
cout
"A";

cout
"\n";


int x;

cout
"Enter your grade: ";
cin
x;

cout
"You received a grade of ";

if (x < 60)
cout
"F";
if (x < 70)
cout
"D";
if (x < 80)
cout
"C";
if (x < 90)
cout
"B";
else
cout
"A";

cout
"\n";
a. Specify the final output of Code A if x were the following values: [45, 90, 78, 64] (1 pt)
. Specify the final output of Code B if x were the following values: [45, 90, 78, 64] (1 pt)
c. When you compare the output of Code A to Code B, do you notice a difference? If so,
describe the difference and why the difference occu
ed. (3 pts)
Last Name:____________________
9

37. The following program has a total of 5 e
ors in it. List the line number of each e
or and
determine whether the e
or is a syntax or logical e
or. (5 pts)
Line 01: const int SIZE = 5;
Line 02: int a
[SIZE] = {89, 104, 90, 83, 200};
Line 03:
Line 04: int sum_evens = 0;
Line 05: sum_odds = 0;
Line 06:
Line 07: cout
"Enter the numbers for your list: ";
Line 08:
Line 09: for (int i = 0; i > SIZE; i++)
Line 10: {
Line 11: cin
a
[k];
Line 12: }
Line 13:
Line 14: for (int i = 0; i < SIZE; i++)
Line 15: {
Answered Same Day Dec 06, 2021

Solution

Kshitij answered on Dec 07 2021
114 Votes
CSC 101 Computer Science 1 – Final Exam
Fall 2021
    Student Name:
         
    
School ID:
    
    
    
Section Number:
    
    
    
    Sections:
· H004
Test Breakdown
    Concept Knowledge
    60 %
    Program Analysis
    25 %
    Program Writing
    15 %
Statement on Integrity
This test is closed note, closed book, closed electronic device, and closed partner. You are permitted a calculator and a writing utensil. Any violation of these policies will result in an automatic zero and an immediate refe
al to the Honor Code office.
(
1
)
Grade:     
Concept Knowledge
Match the following definitions and statements to the terms listed on the right. Note that some terms may be used more than once while others may not be used at all. (1.5 pts each)
Part 1
     O    
    1.
    This is the smallest unit of a computer program.
    Part 1 Terms
A. Else If Statement
B. Bit
C. Output
D. Hardware
E. Programming Statement
F. Process
G. Relational
H. If Statement
I. Software
J. Else Statement
K. Input
L. Comment
M. Token
N. Logical
O. Byte
    
H    
    
2.
    This allows us to incorporate a one-way selection in our program, where a set of statements get executed when an expression evaluates to true.
    
     E    
    3.
    This is a single line of code in a computer program.
    
    
G    
    
4.
    This is a type of operator that allows us to “chain” together other expressions to form complex logical
elational expressions.
    
    
J    
    
5.
    This allows us to incorporate a two-way selection in our program, where one set of statements execute when an expression evaluates to true while the other set execute when the expression evaluates to false.
    
    
    
    
6.
    
In this phase of a program’s computation, data is collected/gathered/generated from an outside source.
    
     B    
    7.
    This is the basic unit of measurement of computer data.
         
    8.
    This allows us to incorporate a multi way selector in our program.
    
L    
    
9.
    This is used to annotate and describe computer code and is ignored when the program is executed.
     D    
    10.
    This is the physical/tangible components of a computer.
(
Last

Name:

)
(
3
)
Part 2
    
D    
    
11.
    
This is the phase of a for loop where the counting variable in initialized/created.
    Part 2 Terms
A. Syntax
B. Design
    
E    
    
12.
    This type of e
or occurs when the operating system/computer cannot execute a line of code in a program while the program is executing.
    C. Pre-Test
D. Initialization
E. Runtime
F. Post Test
G. Step
H. Develop
I. Argument
J. Flowcharts
K. Prototype
L. Logical
M. Condition
N. Sentinel
O. Pseudocode
P. Paramete
Q. Test
R. Body
    
K    
    
13.
    In this stage of the Waterfall Model, the app is checked and executed to ensure there are no e
ors in the program.
    
    
    
    
14.
    
This will make a function one that returns nothing back to where it’s called.
    
    
    
    
15.
    This type of variable is one that can be used throughout the entire program.
    
    
O    
    
16.
    
This type of design approach involves creating a high level/informal description of a program that does not adhere to any programming
language’s rules.
    
     F    
    17.
    A do while loop is called this since the body executes first rather than the expression.
     P    
    18.
    This is a type of variable that a function uses to store its input.
    
D    
    
19.
    This allows us to redefine the scope of a function so that we may define it below main.
     C    
    20.
    This type of loop repeats as long as the user needs to...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here