100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Comp Sci Principles Semester 1 Final Exam with 100% Correct Solutions $9.99   Add to cart

Exam (elaborations)

Comp Sci Principles Semester 1 Final Exam with 100% Correct Solutions

 1 view  0 purchase
  • Course
  • Comp Sci Principles Semester 1
  • Institution
  • Comp Sci Principles Semester 1

Comp Sci Principles Semester 1 Final Exam with 100% Correct Solutions ...

Preview 4 out of 33  pages

  • October 31, 2024
  • 33
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • Comp Sci Principles Semester 1
  • Comp Sci Principles Semester 1
avatar-seller
Stetson
Comp Sci Principles Semester 1 Final Exam with 100%
Correct Solutions 2024-2025


(open the link for diagrams)

Below is a circuit that involves two logic gates, one identified as an OR gate and the
other identified as an AND gate. Each of the gates takes two inputs and gives just one
output.

https://quizlet.com/cdn-cgi/image/f=auto,fit=cover,h=200,onerror=redirect,w=240/https:
//o.quizlet.com/4lNtWl4tZYCd75mGOO7C-g.png

If input A and input C are both true, which of the following best describes the output of
the AND gate?



A. The output will be true regardless of the value of the input B.



Given the code fragment below,.

https://quizlet.com/cdn-cgi/image/f=auto,fit=cover,h=200,onerror=redirect,w=240/https:
//o.quizlet.com/LIX-1wMPTe1.HQ4IRqTmjw.png

What is displayed as a result of executing the code segment?

C. 100 300 500




Consider the following code segment.

https://quizlet.com/cdn-cgi/image/f=auto,fit=cover,h=200,onerror=redirect,w=240/https:
//o.quizlet.com/9Ssdc5sd7qoq-Wbjb0GVtw.png

Which of the following best describes the behavior of the code segment?

D. The code segment displays the value of 2(5^3) by initializing result to 2 and then
multiplying result by 5 a total of three times.

,The next question is about a robot working its way through a grid of squares. The robot
is a triangle that is originally facing the top of the grid.



Consider the following process.

https://quizlet.com/cdn-cgi/image/f=auto,fit=cover,h=200,onerror=redirect,w=240/https:
//o.quizlet.com/v0TYFKz104tmjgGb..OJCQ.png

Which of the following bits of code would send the robot to the grey square following the
path above represented by the arrows?

C.




The following question includes a simple robot operating in a grid of squares. It is
represented as a triangle within the middle square, oriented towards the top of the grid.



A grayed square shows one possible ending position of the robot after the code
segment is executed. Which of the following illustrates all the possible ending locations
for the robot?

B.




The following grid has a robot which is an triangle and is initially facing to right.



The following code snippet is suppose to move the robot into the gray square.

<MISSING STATEMENT>

{

REPEAT 4 TIMES

{

,MOVE_FORWARD()

ROTATE_RIGHT()

}

ROTATE_LEFT()

MOVE_FORWARD()

ROTATE_RIGHT()

}



Which of the following could be inserted for <MISSING STATEMENT> so that the code
snippet works correctly?

B. REPEAT 2 TIMES




We have a sorted list of numbers containing 200 elements.



Which of the following is closest to the maximum number of list elements that must be
examined when performing a binary search for a particular value in the list?

B. 8




A video game character can face toward one of four directions: north, south, east, and
west. Each direction is stored in memory as a sequence of four bits. A new version of
the game is created in which the character can face toward one of eight directions by
adding northwest, northeast, southwest, and southeast to the original four possibilities.
Which of the following statements is true about how the eight directions must be stored
in memory?

D. The eight directions can be represented using four bits.



Consider the following program.

, Of the following, which best describes what the above program prints out?

B. The program above prints the sum of all even integers from 2 to 20.



For which of the following applications would you most want to use lossy compression
rather than lossless compression?

C. A smartphone can store a certain amount of music files. The goal is to maximize the
number of songs the phone will hold.



A student is creating an algorithm that demonstrates the distance between two
numbers, num1 and num2, on a number line. The table below shows the distances for
several different values.



Which of the following algorithms demonstrates the correct distance for all possible
values of num1 and num2?

B.

Step 1:

Take num2 - num1 and put the result in variable diff.

Step 2:

Take the abs of the value diff and print that value.




From this procedure the argument Let x be an integer .



Which of the following best describes what the procedure does?

C. It prints true if x is less than zero and it prints nothing if otherwise.




ASCII is a character-encoding scheme. It uses 7 bits to represent each character. In

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller Stetson. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $9.99. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

75632 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$9.99
  • (0)
  Add to cart