final review
.pdf
keyboard_arrow_up
School
York University *
*We aren’t endorsed by this school
Course
1022
Subject
Computer Science
Date
Dec 6, 2023
Type
Pages
21
Uploaded by freecloud19
2020/12/22
Final
Test:
Attempt
review
Dashboard
/
My
courses
/
LE/EECS1022
A
-
Programming_for
Mobile
Computing_(Fall
2020-2021)
/
Tests
/
Final
Test
Started
on
Tuesday,
15
December
2020,
10:29
PM
State
Finished
Completed
on
Tuesday,
15
December
2020,
11:33
PM
Time
taken
1
hour
4
mins
Grade
24.00
out
of
32.00
(75%)
Question
1
Incorrect
Mark
0.00
out
of
1.00
Given
the
following
function
f1,
give
the
best
order
of
growth
of
the
running
time
(i.e.,
The
time
complexity
using
Big-O
notation).
public
int
fl(int[]
a,
int
key)
{
int
lo
=
U,
mid,
hi
=
a.length-!;
while
(lo
<=
hi)
{
mid
=
(lo
+
hi)/Z;
if
(key
<
a[mid])
hi
=
mid
-
1;
else
if
(a[mid]
<
key)
lo
=
mid
+
|;
else
return
mid;
//
success:
find
the
key
return
the
index
of
}
return
-1;
//
failure:
key
is
not
in
the
array:
Select
one;
Oo(1)
O(N)
O(log
N)
O(NlogN)
©
O(N?)
O(
N2
log
N)
Compilation
errors
none
of
the
above
The
correct
answer
is:
O(log
N)
https://eclass.yorku.ca/eclass/mod/quiz/review.php?attempt=863173&cmid=431492
1/21
2020/12/22
Final
Test:
Attempt
review
Question
2
Correct
Mark
1.00
out
of
1.00
In
Java,
which
of
the
following
statements
are
CORRECT.
.
ArrayList
implements
List
interface.
Il.
HashMap
implements
Map
interface
Il
ArrayList
stores
two
objects
key
and
value.
Select
one;
|
only.
Il
only.
Il
only.
|
and
III.
°
land
Il
Il
and
III.
l,
Il
and
Ill.
none
of
the
above
The
correct
answer
is:
|
and
Il.
https://eclass.yorku.ca/eclass/mod/quiz/review.php?attempt=863173&cmid=431492
2/21
2020/12/22
Final
Test:
Attempt
review
Question
3
Correct
Mark
1.00
out
of
1.00
Given
the
following
function
f2,
give
the
best
order
of
growth
of
the
running
time
(i.e.,
The
time
complexity
using
Big-O
notation).
public
int
f2
(int
N)
{
int
x
=
0;
for
(Ant
1=
1;
1
<
N5
i+¢)
{
for(int
j
=0;
j
<
i;
j++)
{
X++;
}
}
return
x;
Select
one;
O(1)
O(N)
O(logN)
O(NlogN)
o
Q(NZ)
v
Runtime
Exception
Compilation
errors
none
of
the
above
The
correct
answer
is:
O(
N2
)
https://eclass.yorku.ca/eclass/mod/quiz/review.php?attempt=863173&cmid=431492
3/21
2020/12/22
Final
Test:
Attempt
review
Question
4
Correct
Mark
1.00
out
of
1.00
Which
of
the
following
statements
are
CORRECT
I.
The
Java
compiler
always
adds
a
default
constructor
to
a
user
defined
class.
II.
Each
instantiated
object
will
have
its
own
copy
of
a
class
variable.
ITI.
A
class
can
have
multiple
constructors.
Select
one;
|
only.
Il
only.
©
1l
only.
|
and
IIl.
|
and
II.
Il
and
Il1.
l,
Il
and
Ill.
none
of
the
above
The
correct
answer
is:
lll
only.
Question
B
Correct
Mark
1.00
out
of
1.00
What
is
the
output
from
the
following
Java
program
fragment?
|
|
try
{
~
foxr
(Int
1.
=
1;
i
<€
3;
a+¥)
¢
|
System.out.print
(i)
;
|
System.out.println(l
/
0);
|
}
}
catch
(Exception
ex)
{
}
e
S
Write
the
answer
without
adding
anything
to
it
(such
as
extra
quotes,
leading
or
trailing
text,
=
signs,
...).
Write
XXX
in
case
of
errors.
Answer:
1
v
The
correct
answer
is:
1
https://eclass.yorku.ca/eclass/mod/quiz/review.php?attempt=863173&cmid=431492
4/21
2020/12/22
Final Test:
Attempt
review
Question
6
Correct
Mark
1.00
out
of
1.00
For
what
value
of
the
parameter
k
would
the
return
of
this
method
be
57
If
there
is
more
than
one
such
value,
write
any
one
of
them
(and
only
one)
as
your
answer.
public
int
methodA(int
k)
{
int
total
=
0;
For
(dnt
1
=
2:52)
if
(i
<=
10)
i++;
if
(i
>
10)
break;
iF
(1
»=
k)
total++;
}
return
total;
}
Write
the
answer
without
adding
anything
to
it
(such
as
extra
quotes,
leading
or
trailing
text,
=
signs,
...).
Write
XXX
in
case
of
errors.
Answer:
6
v
The
correct
answer
is:
6
Question
7
Incorrect
Mark
0.00 out
of
1.00
What
is
the
value
of
String
s4
after
the
following
Java
program
fragment
is
executed?
String
S1
=
"EECS$yokr$universityz";
String
S2
=
"Hi";
String
S3
=
"student”;
String
S4
=
Sl.substring(S1.indexOf("r")+1,
S1.indexOf("z"))
+
S3.substring(@)
+
S2;
Write
the
answer
without
adding
anything
to
it
(such
as
leading
or
trailing
text,
=
signs,
...).
Write
XXX
in
case
of
errors.
Answer:
"S$universitysHi"
x
The
correct
answer
is:
"$universitystudentHi"
https://eclass.yorku.ca/eclass/mod/quiz/review.php?attempt=863173&cmid=431492
5/21
2020/12/22
Final
Test:
Attempt
review
Question
8
Correct
Mark
1.00
out
of
1.00
Which
of
the
following
Java
statements
will
print
true
I.
System.out.println("Hello,
ABC".matches
("ABC"))
;
II.
System.out.println("xyz,
ABC".matches(".*ABC.*"));
ITII.
system.out.println("XYZ,
ABC".matches(".ABC.*"))
;
Select
one:
|
only.
°
1l
only.
v
Il
only.
|
and
III.
|
and
II.
Il
and
Il1.
l,
Il
and
IIl.
none
of
the
above
The
correct
answer
is:
Il
only.
Question
9
Correct
Mark
1.00
out
of
1.00
Which
of
the
following
contains
string(s) that
DO
NOT
match
the
regular
expression
ab*c$?
Select
one:
-
"abc"
"fac"
©
"1223"
v
none
of
the
above
The
correct
answer
is;
"1223"
https://eclass.yorku.ca/eclass/mod/quiz/review.php?attempt=863173&cmid=431492
6/21
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
Write ARM Assembly program to do:
- ISBN Checksum Validator
Use Keil uvision software to write and simulate an ARM assembly program that checks the validity
of a given ISBN by verifying the checksum
Helping Information to solve program :
1. An ISBN consists of nine digits plus a validation digit.
2. The digits are numbered from right to left as d1, d2 .. d10, with d1 being the validation digit.
3. You can define the ISBN number in a 10-byte array in the memory. Each digit is stored in a
byte.
4. To check whether the ISBN is valid or not, the following calculations are performed:
Result = (10 x d10 + 9 x d9 + ... + ix di + ... + 2 x d2) % 11
Calculate d1 11 - Result
If the calculated d1 equal to the d1 in the input ISBN then it is valid
If d1 = 10, it is written 'X'
For example, given the following ISBN:
ISBN = 5123487654
ISBN= 5 1 2 3 487654 d10 d9 d8 d7 d6 d5 d4 d3 d2 d1
Result = x 10 + x 9 + x 8 + x 7 + x 6 + x 5 + x 4 + x 3 + x 2 mod 11
= 216 mod 11
=7
d1 = 11 - Result
= 11 -7
=4
,…
arrow_forward
With the fast and wide spread of COVID-19, universities and schools adopted the remote teaching methods. This also led to replacing the traditional assessing methods such as paper-based exams and lab exams with long homework and reports. Unfortunately, many students thought this is a good opportunity to get high marks by copying elegant thoughtful ideas or even asking or paying people in practice to their reports. All this and even other behaviors are considered plagiarism, and plagiarism is a malpractice in the academia and results in sanctions that students were sometime surprised to receive.
arrow_forward
Please solve these computer science
problems from the given book: 1.2.2
Reference book:
https://files.gitter.im/SamZhngQing Chuan/sam/DA1g/Steven-
Halim-Felix-Halim-Competitive-Programming-3_-The-New-
Lower-Bound-of-Programming-Contests-Lulu.com-2013_pdf
2
Steven Halim
Felix Halim
HANDBOOK FOR ACM ICPC AND IOI CONTESTANTS
2013
arrow_forward
01. Write LADDER and IL programme for below application?
The objective of application 1 is to continuously divert components down one of two chutes. Figure 1 illustrates the application. The requirement is for 10 components to be directed down chute A and 20 components down chute B for packaging purposes. A solenoid-driven flap is used to direct components down either chute A or chute B. When the solenoid is energized components are routed down path B. When the solenoid is de-energized, the flap (via a spring return mechanism) positions itself so that the components are routed down chute A. The photoelectric switch is used to count components travelling along the conveyor.
arrow_forward
“Just half a year ago we launched our new product – the radar detector. The firmware RD-8.1, embedded in this product, seems to be the cause for its success. But, when we began planning the development of a European version of the product, we found out that though the products will be almost similar, our software development department needs to develop new firmware; almost all the design and programming will be new.”
“but” complaint is mentioned above. It reflect items missing from the requirement documents.To which factors do the missing requirements belong? and Can you suggest software quality requirements that could fill the gap?
arrow_forward
URGENT MCQ SOLVE NEEDED (OPERATING SYSTEM)
#NO_EXPLANATION_NEED
arrow_forward
zy Section 1.3 - IT 140: Introduct x
zy Section 1.3 - IT 140: Introduct X
O (158) SNHU IT140 Module Or x
b Answered: Run the program
2 806 S 5th 1/2 St - Google Ma x
Ô https://learn.zybooks.com/zybook/SNHUIT140V3/chapter/1/section/3?content_resource_id=40688398
= zyBooks My library > IT 140: Introduction to Scripting v3 home > 1.3: Input/Output
E zyBooks catalog
? Help/FAQ
8 Jose Roque
Feedback?
CHALLENGE
1.3.3: Enter the output.
АCTIVITY
247772.2002516.gx3zqy7
Start
Type the program's output
Sam is great.
print ('Sam is great.')
1
Check
Next
Feedback?
Basic input
Many useful programs allow a user to enter values, such as typing a number, a name, etc.
12:54 AM
P Type here to search
83°F Haze
7/5/2021
D- D- D " D+
近
arrow_forward
As seen in the screenshot when I am utilizing the code in the answer here in IDLE I am getting an error code. I have not been able to troubleshoot past it. What am i doing wrong?
arrow_forward
What is Angular's AOT?
arrow_forward
ts Ana sayfa
Dersler
Gruplar
Takvim
BAU
J1oddng
BAUGO
BAU Library
CMP3001 (1,2) Operating Sys...
Genel bakış
Planlar
Kaynaklar
Durum ve izleme
Katılımcılar
Midterm
Soru 1
Round Robin CPU Scheduling can be implemented to include priorty for the processes.
Yanıtınız:
True
False
Yanıtı temizle
Gönder
arrow_forward
M5
arrow_forward
DO NOT COPY FROM OTHER WEBSITES
COrrect and detailed answer will be Upvoted else downvoted. Thank you!
arrow_forward
Transcribed Image Text
Kangana Ranaut has recently found how two triangles and a quadrilateral cut out from a large sheet of paper. Being a curious lady, Kangana along with his sister Rangoli began asking question all over the internet. Diljit Dosanjh gave her a thrilling idea He explains if it's possible to combine these triangles by moving, flipping, rotating them, and cover exactly the quadrilateral with no overlap between the two triangles. Both the sisters were tankful for Diljit for explain and asked him to help them code this as they do not know nothing but speaking rubbish. So, given the coordinates of the triangles and the quadrilateral, your task is to answer the question: whether it's possible to combine the triangles to cover exactly the given quadrilateral. Test case consists of ten lines, each containing two integers the coordinates of a point. Initial three lines of the test case description contain the points forming the first triangle. The next three lines describe the…
arrow_forward
A student finishes a Ph.D. working on a problem that has aspects that are directly patentable and solve a major problem in the disk drive industry. His new job could be with Hitachi or Seagate, or some similar firm. He arrives at the new job and discovers that the work done as a student, which is in the patent process, will solve the problem at his new company. If he reveals what he knows to his new employer he will be an immediate hero, but will compromise the patent process at his original institution. This step could have important financial implications for the original institution in the form of royalties.
What are the relevant ethical considerations in this dilemma? The answer could depend on missing information, such as the nature of the contract signed by the student with his institution, if any, and the nature of its intellectual property rules. This information may have an impact on what the correct ethical response is.
arrow_forward
Numbers are given. Fill out the rest. Please show calculations. Which is better.
arrow_forward
C/Users/Khaydhison/Documents/SAD/Architecture%20Take%20Home%20Exam.pdf
(L Page view
A Read aloud
Draw
F Highlight
Erase
on 3
a. As a computer manufacturer you are faced with the challenge of designing quality
machines with very excellent processing speed, which should also be affordable
to all. Discuss a mechanism you would employ to produce a high-quality machine
with good speed but at an affordable cost.
b. Use the Fetch Decode Execution steps to execute the assembly language into
machine instructions and execute the instruction as the computer would. Explain
into detail what happens during the execution of each statement.
%#3
Machine code
0.
001 1 111100
1 010 0 110000
10:21 PM
Ps
4/16/2021
hp
arrow_forward
None
arrow_forward
009.plot genuine part, fanciful part and size.>> n = [0:5]; x = exp ((2+3j)*n)
Task(7): test rate fs = 10000 and plot 0.2 s of the produced waveform.
arrow_forward
In the field of computer science, what is meant by the term "price-performance ratio"? Why is it so difficult to put into practice?
arrow_forward
Computer Science
My topic is: E-Commerce in the time of covid-19 ( please do it in MS Access tool and take a screenshot i need.
Note: please dont copy from the internet or previous questions because there is a plagarism check for this task.
arrow_forward
Comparing (Windows, Linux, Android, Mac OS) in Tirol
arrow_forward
Computer science
Plot?
arrow_forward
input_1input_2input_3input_4input_5input_6input_7input_8input_9input_10output0
Private School Physics Riyadh Male $735 18,180 9.2 9.1 6.0 0.933 9.81
Public School Mathematics Madinah Male $742 2,6216.6 9.57.8 0.95 35.42
Public School Physics Madinah Female $675 17,692 6.1 7.6 7.9 0.92 35.73
Public School Physics Al-Khobar Female $841 17,738 9.99.1 9.4 0.17 41.14
Private School Chemistry Hail Female $596 10,6047.7 6.7 9.6 0.17 37.3
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
Related Questions
- Write ARM Assembly program to do: - ISBN Checksum Validator Use Keil uvision software to write and simulate an ARM assembly program that checks the validity of a given ISBN by verifying the checksum Helping Information to solve program : 1. An ISBN consists of nine digits plus a validation digit. 2. The digits are numbered from right to left as d1, d2 .. d10, with d1 being the validation digit. 3. You can define the ISBN number in a 10-byte array in the memory. Each digit is stored in a byte. 4. To check whether the ISBN is valid or not, the following calculations are performed: Result = (10 x d10 + 9 x d9 + ... + ix di + ... + 2 x d2) % 11 Calculate d1 11 - Result If the calculated d1 equal to the d1 in the input ISBN then it is valid If d1 = 10, it is written 'X' For example, given the following ISBN: ISBN = 5123487654 ISBN= 5 1 2 3 487654 d10 d9 d8 d7 d6 d5 d4 d3 d2 d1 Result = x 10 + x 9 + x 8 + x 7 + x 6 + x 5 + x 4 + x 3 + x 2 mod 11 = 216 mod 11 =7 d1 = 11 - Result = 11 -7 =4 ,…arrow_forwardWith the fast and wide spread of COVID-19, universities and schools adopted the remote teaching methods. This also led to replacing the traditional assessing methods such as paper-based exams and lab exams with long homework and reports. Unfortunately, many students thought this is a good opportunity to get high marks by copying elegant thoughtful ideas or even asking or paying people in practice to their reports. All this and even other behaviors are considered plagiarism, and plagiarism is a malpractice in the academia and results in sanctions that students were sometime surprised to receive.arrow_forwardPlease solve these computer science problems from the given book: 1.2.2 Reference book: https://files.gitter.im/SamZhngQing Chuan/sam/DA1g/Steven- Halim-Felix-Halim-Competitive-Programming-3_-The-New- Lower-Bound-of-Programming-Contests-Lulu.com-2013_pdf 2 Steven Halim Felix Halim HANDBOOK FOR ACM ICPC AND IOI CONTESTANTS 2013arrow_forward
- 01. Write LADDER and IL programme for below application? The objective of application 1 is to continuously divert components down one of two chutes. Figure 1 illustrates the application. The requirement is for 10 components to be directed down chute A and 20 components down chute B for packaging purposes. A solenoid-driven flap is used to direct components down either chute A or chute B. When the solenoid is energized components are routed down path B. When the solenoid is de-energized, the flap (via a spring return mechanism) positions itself so that the components are routed down chute A. The photoelectric switch is used to count components travelling along the conveyor.arrow_forward“Just half a year ago we launched our new product – the radar detector. The firmware RD-8.1, embedded in this product, seems to be the cause for its success. But, when we began planning the development of a European version of the product, we found out that though the products will be almost similar, our software development department needs to develop new firmware; almost all the design and programming will be new.” “but” complaint is mentioned above. It reflect items missing from the requirement documents.To which factors do the missing requirements belong? and Can you suggest software quality requirements that could fill the gap?arrow_forwardURGENT MCQ SOLVE NEEDED (OPERATING SYSTEM) #NO_EXPLANATION_NEEDarrow_forward
- zy Section 1.3 - IT 140: Introduct x zy Section 1.3 - IT 140: Introduct X O (158) SNHU IT140 Module Or x b Answered: Run the program 2 806 S 5th 1/2 St - Google Ma x Ô https://learn.zybooks.com/zybook/SNHUIT140V3/chapter/1/section/3?content_resource_id=40688398 = zyBooks My library > IT 140: Introduction to Scripting v3 home > 1.3: Input/Output E zyBooks catalog ? Help/FAQ 8 Jose Roque Feedback? CHALLENGE 1.3.3: Enter the output. АCTIVITY 247772.2002516.gx3zqy7 Start Type the program's output Sam is great. print ('Sam is great.') 1 Check Next Feedback? Basic input Many useful programs allow a user to enter values, such as typing a number, a name, etc. 12:54 AM P Type here to search 83°F Haze 7/5/2021 D- D- D " D+ 近arrow_forwardAs seen in the screenshot when I am utilizing the code in the answer here in IDLE I am getting an error code. I have not been able to troubleshoot past it. What am i doing wrong?arrow_forwardWhat is Angular's AOT?arrow_forward
- ts Ana sayfa Dersler Gruplar Takvim BAU J1oddng BAUGO BAU Library CMP3001 (1,2) Operating Sys... Genel bakış Planlar Kaynaklar Durum ve izleme Katılımcılar Midterm Soru 1 Round Robin CPU Scheduling can be implemented to include priorty for the processes. Yanıtınız: True False Yanıtı temizle Gönderarrow_forwardM5arrow_forwardDO NOT COPY FROM OTHER WEBSITES COrrect and detailed answer will be Upvoted else downvoted. Thank you!arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Systems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage LearningNp Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:Cengage
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage