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

CPSC 2150 Exam Questions Fully Solved Latest Update 2025 Graded A+

Rating
-
Sold
-
Pages
10
Grade
A+
Uploaded on
04-03-2025
Written in
2024/2025

CPSC 2150 Exam Questions Fully Solved Latest Update 2025 Graded A+ A __________ has occurred when the observed output did not match the expected output - Answers failure An ____________________________________________________ is when any further processing will result in the observed output not matching the expected output - Answers erroneous state A _______________________ is the algorithmic cause of of the observed output not matching the expected output. - Answers fault In order to have a complete test case, you need to have ... - Answers A set of specific input values A set of specific output values A _____________________________ leads to a ____________________________ which leads to a _______________________________________ - Answers fault, erroneous state, failure A successful test case shows us... - Answers that a fault exists a failure Testing is used to prove that your code has no faults. - Answers False Which type of testing allows you to look at the code while developing test cases? - Answers Whitebox testing What type of testing can you use while following Test Driven Development - Answers Blackbox testing The best practice of breaking our system into smaller components to test individually is known as.... - Answers Unit testing What is the result of u o u - Answers <1, 4, 1, 4> What is the result of u o t - Answers <1, 4, 5, 3, 8> What is the result of Reverse(s) - Answers <3, 2, 7, 5, 3> What is the result of Prt_Btwn(1, 4, s) Note: Prt_Btwn(n, m, string) n is included, m is excluded, positioning starts at 0. - Answers <5, 7, 2> What is the result of |t| where t = <5, 3, 8> - Answers 3 What is the result of Occurs_ct(3, s) where s = <3, 5, 7, 2, 3> - Answers 2 How would you use the above strings and our string notation to get the string <1, 4, 4, 1>? - Answers u o Reverse(u) How would you use the above strings and our string notation to get the string <1, 2, 3, 4>? - Answers Prt_Btwn(0, 1, u) o Prt_Btwn(3, |s|, s) o Prt_Btwn(1, |u|, u) How would you use our string notation to get the first value out of an unknown string v? - Answers Prt_Btwn(0,1,v) How would you use our string notation to get the last value out of an unknown string v? - Answers correct answers: Prt_Btwn(|v|-1,|v|,v) Prt_Btwn(0, 1, Reverse(v)) Prt_Btwn(|v| - 1, |v|, v) Prt_Btwn(0,1,Reverse(v)) You are developing a program that will use a lot of Lists. Right now you want them all to be ArrayLists, but you know that in the future there may be a better implementation of the List interface. You want to be able to change all of your Lists from ArrayLists to that new implementation easily if a new implementation is released in the future. What design pattern should you use? - Answers The Factory Method Pattern You are developing a program that needs to monitor several nodes across a large network. If something happens to any individual node, that should trigger a response from your program. What design pattern should you use? - Answers The Observer Pattern You are developing a program in Java. You have created an interface with multiple implementations. Some of the methods of your interface don't need direct access to the private data, so you code those as default methods in your interface, and don't override them in the implementations. Other methods do need private data, so they are abstract in interface and provided in each implementation. What design pattern are you using? - Answers The Template Hook Pattern Which of the following is an example of an architectural pattern, not a design pattern? - Answers Model View Controller You are developing a program that will use a Graphical User Interface. To do so you have a class called Screen that will represent your Screen, and a class called Widget that will represent a widget on the screen that the user can interact with. You will have multiple Widgets on your screen, and you do not know which Widget your user will interact with next. You decide to use the Observer Pattern to solve this problem. Which class(es) will be the Observer? - Answers Screen You are developing a program that will use a Graphical User Interface. To do so you have a class called Screen that will represent your Screen, and a class called Widget that will represent a widget on the screen that the user can interact with. You will have multiple Widgets on your screen, and you do not know which Widget your user will interact with next. You decide to use the Observer Pattern to solve this problem.

Show more Read less
Institution
CPSC 2150
Course
CPSC 2150









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

Written for

Institution
CPSC 2150
Course
CPSC 2150

Document information

Uploaded on
March 4, 2025
Number of pages
10
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

CPSC 2150 Exam Questions Fully Solved Latest Update 2025 Graded A+

A __________ has occurred when the observed output did not match the expected output - Answers
failure

An ____________________________________________________ is when any further processing will
result in the observed output not matching the expected output - Answers erroneous state

A _______________________ is the algorithmic cause of of the observed output not matching the
expected output. - Answers fault

In order to have a complete test case, you need to have ... - Answers A set of specific input values

A set of specific output values

A _____________________________ leads to a ____________________________ which leads to a
_______________________________________ - Answers fault, erroneous state, failure

A successful test case shows us... - Answers that a fault exists

a failure

Testing is used to prove that your code has no faults. - Answers False

Which type of testing allows you to look at the code while developing test cases? - Answers Whitebox
testing

What type of testing can you use while following Test Driven Development - Answers Blackbox testing

The best practice of breaking our system into smaller components to test individually is known as.... -
Answers Unit testing

What is the result of

u o u - Answers <1, 4, 1, 4>

What is the result of

u o t - Answers <1, 4, 5, 3, 8>

What is the result of

Reverse(s) - Answers <3, 2, 7, 5, 3>

What is the result of

Prt_Btwn(1, 4, s)

, Note: Prt_Btwn(n, m, string)

n is included, m is excluded, positioning starts at 0. - Answers <5, 7, 2>

What is the result of

|t| where t = <5, 3, 8> - Answers 3

What is the result of

Occurs_ct(3, s) where s = <3, 5, 7, 2, 3> - Answers 2

How would you use the above strings and our string notation to get the string <1, 4, 4, 1>? - Answers u o
Reverse(u)

How would you use the above strings and our string notation to get the string <1, 2, 3, 4>? - Answers
Prt_Btwn(0, 1, u) o Prt_Btwn(3, |s|, s) o Prt_Btwn(1, |u|, u)

How would you use our string notation to get the first value out of an unknown string v? - Answers
Prt_Btwn(0,1,v)

How would you use our string notation to get the last value out of an unknown string v? - Answers
correct answers:

Prt_Btwn(|v|-1,|v|,v)

Prt_Btwn(0, 1, Reverse(v))

Prt_Btwn(|v| - 1, |v|, v)

Prt_Btwn(0,1,Reverse(v))

You are developing a program that will use a lot of Lists. Right now you want them all to be ArrayLists,
but you know that in the future there may be a better implementation of the List interface. You want to
be able to change all of your Lists from ArrayLists to that new implementation easily if a new
implementation is released in the future. What design pattern should you use? - Answers The Factory
Method Pattern

You are developing a program that needs to monitor several nodes across a large network. If something
happens to any individual node, that should trigger a response from your program. What design pattern
should you use? - Answers The Observer Pattern

You are developing a program in Java. You have created an interface with multiple implementations.
Some of the methods of your interface don't need direct access to the private data, so you code those as
default methods in your interface, and don't override them in the implementations. Other methods do
need private data, so they are abstract in interface and provided in each implementation. What design
pattern are you using? - Answers The Template Hook Pattern

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
357
Member since
1 year
Number of followers
16
Documents
29315
Last sold
1 day ago
Tutor Joshua

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

3.6

55 reviews

5
19
4
14
3
12
2
0
1
10

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