100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

Computer Science Midterm Exams Questions With Complete Solutions

Rating
-
Sold
-
Pages
16
Uploaded on
02-11-2024
Written in
2024/2025

Computer Science Midterm Exams Questions With Complete Solutions

Institution
Computer Science
Course
Computer Science










Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Computer Science
Course
Computer Science

Document information

Uploaded on
November 2, 2024
Number of pages
16
Written in
2024/2025
Type
Exam (elaborations)
Contains
Unknown

Subjects

Content preview

Computer Science Midterm Exams Questions With
Complete Solutions

A program that Thomas has written is complete. It has been
tested thoroughly, and some outputs were not as expected.
Thomas is now going through the code carefully attempting to
establish the cause of these errors and change the code to
remove them. What is this procedure called? Correct Answer
Debugging

A statistics teacher wishes to create a program on her calculator
that generates a random even integer. The command built in the
calculator to generate a random positive integer is
RANDOM(a,b). This command generates a random integer
between integers a and b (and including a and b). Which of the
following lines of code will ensure that the random integer
generated will be even? Correct Answer RANDOM(a,b) * 2

A student developed a program that outputs the name of a fruit
that begins with a letter, dependent upon the variable
keyPressed, which stores the letter (from A to Z only) a user
types on the keyboard. Below is a section of code from her
program:

Which of the following descriptions below would be a way that
this student might have written the rest of her code so that it
executes as intended? Select two answers. Correct Answer Use
25 nested IF/ELSE blocks where the IF portion is formatted like
the code segment above (changing the letters of the alphabet and
fruits) and the else simply holding the next IF portion until the
last ELSE, which displays a fruit that begins with Z.

,Use 26 IF blocks formatted similarly to the one above (changing
the letters of the alphabet and fruits).

A team of students is collaborating on a program to obtain local
weather data from a website, and predict weather-related school
closings based on their own formulas. They must present their
code to a group of faculty, some of whom have little to no
experience with code. What strategies can the group use while
writing their code, in order to make it more understandable for
the faculty?

Select two answers. Correct Answer Choose meaningful names
for all variables and procedures.

Include comments detailing the purpose and behavior of
variables and procedures.

Consider a robot that is initially facing north in a 5-by-5 grid, as
shown in the diagram below. A program segment has been
written to move the robot to the upper-right corner where it
should face west.

The following program segment is intended to move a robot
from the starting position to the ending position as shown above.
However, the program segment does not work correctly.

Which 2 lines of code in the segment above must be switched in
order for the program to correctly move a robot from the starting
position to the ending position? Select two answers. Correct
Answer Line 7

, Line 5

Consider the code segment below.

Line 1: IF (b ≠ 0)
Line 2: {
Line 3: a ← a/b
Line 4: }
Line 5: ELSE
Line 6: {
Line 7: a ← a*b
Line 8: }

Which of the following changes will NOT affect the results
when the code segment is executed? Correct Answer Changing
line 7 to a ← 0

Consider the following actions which might be performed by a
developer when creating a new piece of software to solve a
problem.

1. Thoroughly testing code with a variety of inputs
2. Designing an algorithm to tackle the central problem the
program hopes to solve
3. Considering what outputs a program solving the problem
might produce and what inputs it may require to do this
4. Writing code in a high-level programming language to
implement an algorithm
In which order in the development cycle would these actions
first appear? Correct Answer 3,2,4,1

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Classroom NURSING
View profile
Follow You need to be logged in order to follow users or courses
Sold
4689
Member since
3 year
Number of followers
3218
Documents
52002
Last sold
1 day ago
NURSING

Assignments, Case Studies, Research, Essay writing service, Questions and Answers, Discussions etc. for students who want to see results twice as fast. I have done papers of various topics and complexities. I am punctual and always submit work on-deadline. I write engaging and informative content on all subjects. Send me your research papers, case studies, psychology papers, etc, and I’ll do them to the best of my abilities. Writing is my passion when it comes to academic work. I’ve got a good sense of structure and enjoy finding interesting ways to deliver information in any given paper. I love impressing clients with my work, and I am very punctual about deadlines. Send me your assignment and I’ll take it to the next level. I strive for my content to be of the highest quality. Your wishes come first— send me your requirements and I’ll make a piece of work with fresh ideas, consistent structure, and following the academic formatting rules. For every student you refer to me with an order that is completed and paid transparently, I will do one assignment for you, free of charge!!!!!!!!!!!!

Read more Read less
4.0

1162 reviews

5
612
4
213
3
190
2
39
1
108

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions