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

COMPUTER SCIENCE - Algorithms and Comp Thinking Exam Questions and Answers Fully Solved

Rating
-
Sold
-
Pages
6
Grade
A+
Uploaded on
03-08-2025
Written in
2025/2026

COMPUTER SCIENCE - Algorithms and Comp Thinking Exam Questions and Answers Fully Solved Most Appropriate data type for: StudentName, Points, LetterSent (3) - AnswersString Integer Boolean Write an SQL statement to select StudentName field, for all record that have Negative points (3) - AnswersSELECT StudentName FROM conduct WHERE Points < 0 State the wildcard used in SQL to show all fields from a table (1) - Answers* Write an algorithm that will identify whether the data in studentdata array shows if a letter has been sent home or not for a student. Should output "sent" or "not sent" (4) - Answersif studentdata[3] == "TRUE" then: print "sent" else: print "not sent" end if Identify three basic programming constructs (3) - AnswersSequence Iteration Selection Describe what is meant by a variable (2) - AnswersA name for a memory location. Used to store data/value (assigned). That can be changed while program running. And Gate table Or Gate table Not gate table for all values - AnswersAND: 0 0 = 0, 0 1 = 0, 1 0 = 0, 1 1 = 1. OR: 0 0 = 0, 0 1 = 1, 1 0 = 1, 1 1 = 1. NOT: 0 = 1, 1 = 0 Write an algorithm that: inputs title and year of a book, uses the function Librarycode to work out a book code, permanently stores the new book code to text file (6) - Answerstitle = input("enter title") year = input ("enter year") code = librarycode(title, year) myFile = openWrite("") myFLine(code) MyF() Describe one difference between a function and a procedure.(2) - AnswersFunction returns a value Procedure does not return a value Describe two benefits to a programmer of using sub programs. (4) - AnswersBreaks down problem, making it easier to test, each subroutine tested separately Reuse code, quicker to develop, build of existing work Avoid repetition of code, makes program shorter, subprogram called instead of copying/pasting, quicker to develop new programs What does merge sort do? (4) - AnswersList split into individual elements Merge individual elements into sorted lists of size 2 Merge lists of size 2 into sorted lists of 4 Merge lists of 4 into final sorted list Explain one advantage of a merge sort compared to a bubble sort. (2) - AnswersFaster/quicker, for large lists that are more unordered Has a consistent running time, doesnt depend on how ordered original list is Compare the use of ASCII and Extended ASCII to represent characters (2) - AnswersExtended ASCII uses more bits // ASCII uses fewer bits Extended ASCII can represent more characters //

Show more Read less
Institution
COMPUTER SCIENCE - Algorithms
Course
COMPUTER SCIENCE - Algorithms









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

Written for

Institution
COMPUTER SCIENCE - Algorithms
Course
COMPUTER SCIENCE - Algorithms

Document information

Uploaded on
August 3, 2025
Number of pages
6
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

COMPUTER SCIENCE - Algorithms and Comp Thinking Exam Questions and Answers Fully Solved

Most Appropriate data type for: StudentName, Points, LetterSent (3) - AnswersString

Integer

Boolean

Write an SQL statement to select StudentName field, for all record that have Negative points (3) -
AnswersSELECT StudentName

FROM conduct

WHERE Points < 0

State the wildcard used in SQL to show all fields from a table (1) - Answers*

Write an algorithm that will identify whether the data in studentdata array shows if a letter has been
sent home or not for a student. Should output "sent" or "not sent" (4) - Answersif studentdata[3] ==
"TRUE" then:

print "sent"

else:

print "not sent"

end if

Identify three basic programming constructs (3) - AnswersSequence

Iteration

Selection

Describe what is meant by a variable (2) - AnswersA name for a memory location. Used to store
data/value (assigned). That can be changed while program running.

And Gate table

Or Gate table

Not gate table

for all values - AnswersAND: 0 0 = 0, 0 1 = 0, 1 0 = 0, 1 1 = 1.

OR: 0 0 = 0, 0 1 = 1, 1 0 = 1, 1 1 = 1.

NOT: 0 = 1, 1 = 0

, Write an algorithm that: inputs title and year of a book, uses the function Librarycode to work out a
book code, permanently stores the new book code to text file bookcodes.txt (6) - Answerstitle =
input("enter title")

year = input ("enter year")

code = librarycode(title, year)

myFile = openWrite("bookcodes.txt")

myFile.writeLine(code)

MyFile.close()

Describe one difference between a function and a procedure.(2) - AnswersFunction returns a value

Procedure does not return a value

Describe two benefits to a programmer of using sub programs. (4) - AnswersBreaks down problem,
making it easier to test, each subroutine tested separately

Reuse code, quicker to develop, build of existing work

Avoid repetition of code, makes program shorter, subprogram called instead of copying/pasting, quicker
to develop new programs

What does merge sort do? (4) - AnswersList split into individual elements

Merge individual elements into sorted lists of size 2

Merge lists of size 2 into sorted lists of 4

Merge lists of 4 into final sorted list

Explain one advantage of a merge sort compared to a bubble sort. (2) - AnswersFaster/quicker, for large
lists that are more unordered

Has a consistent running time, doesnt depend on how ordered original list is

Compare the use of ASCII and Extended ASCII to represent characters (2) - AnswersExtended ASCII uses
more bits // ASCII uses fewer

bits

Extended ASCII can represent more characters //

ASCII can represent fewer characters

... by example (e.g. extended ASCII can represent

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.
TutorJosh Chamberlain College Of Nursing
View profile
Follow You need to be logged in order to follow users or courses
Sold
332
Member since
1 year
Number of followers
16
Documents
28211
Last sold
1 day ago
Tutor Joshua

Here You will find all Documents and Package Deals Offered By Tutor Joshua.

3.6

53 reviews

5
18
4
14
3
12
2
0
1
9

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