final_overview_Fall2023
.pdf
keyboard_arrow_up
School
Rensselaer Polytechnic Institute *
*We aren’t endorsed by this school
Course
1100
Subject
Computer Science
Date
Feb 20, 2024
Type
Pages
8
Uploaded by ConstableWaterBuffalo22878
Computer Science 1 — CSci 1100
Fall Semester, 2023
Final Exam Overview and Practice Questions
Overview
The final exam will be held
Thursday, December 14, 2023
from 6:30 pm - 8:30 pm. Note that this will
be a
two-hour exam
.
Most students will take the exam from 6:30 pm - 8:30 pm (120 minutes). Room assignments will be posted
on Submitty by Wednesday night, December 13. For most students these assignments
will be different
from previous exams.
Students who provided with an accommodation letter indicating the need for extra time or a quiet location
will be given extra time beyond the 2 hour base. Shianne Hulbert will send you a reminder for your time
and location. Use whatever information she sends you. It overrides any assignments given you on Submitty.
If you show up at your Submitty location or time, you will be allowed to take the exam, but you will lose
the accommodations.
Students MUST:
– Go to their assigned rooms.
– Bring their IDs to the exam.
– Sit in the correct room/section.
– Put away all calculators, phones, etc. and take off/out all headphones and earbuds
Failing to do one of these may result in a
20 point
penalty on the exam score. Failure to do all can cost
up to
80 points
.
During the exam, if you are doubtful/confused about a problem, simply state your assumptions and/or
interpretation as comments right before your code and write your solution accordingly.
During the exam you are not allowed to take any breaks (including bathroom breaks).
Exam coverage is the entire semester, except for the following:
–
JSON data format,
–
Images,
You do not need to know the intricacies of
tkinter
GUI formatting, but you should understand the GUI
code structure we outlined (Lecture Notes and Class Code), be able to trace through event driven code
and write small methods that are invoked by the GUI. Consider the lecture exercises for Lecture 22 and
the modifications you made to the BallDraw class during Lab 11 for practice.
Please review lecture notes, class exercises, labs, homework, practice programs, and tests, working through
problems on your own before looking at the solutions.
You are expected to abide by the following Honor code when appearing for this exam:
“On my honor, I have neither given nor received any aid on this exam.”
As part of our regular class time on Thursday December 7th, we will answer questions about the course
material,
so bring your questions!
There are often study events held on campus, for example UPE often holds tutoring sessions.
I do not
know of any specific events right now, but we will post anything we learn to the Submitty discussion forum.
Please monitor the channel if you are looking for help.
What follows are a few additional practice problems. These are by no means comprehensive, so rework
problems from earlier in the semester. All the material from tests 1, 2, and 3 are also fair game. This is a
comprehensive final exam.
We have separately provided Spring 2017’s final exam.
Questions
The following are the questions and solutions to some practice problems. Please be aware that there may be
more than one way to solve a problem and so your answer may be correct despite being different from ours.
1. Write a version of
merge
that does all of the work inside the
while
loop and does not use the
extend
.
2. Using what you learned from writing the solution to the previous problem, write a function to merge three
sorted lists. For example
print(three_way_merge( [2, 3, 4, 4, 4, 5], [1, 5, 6,
9], [ 6, 9, 13]))
Should output
[1, 2, 3, 4, 4, 4, 5, 5, 6, 6, 9, 9, 13]
3. Given a list of test scores, where the maximum score is 100, write code that prints the number of scores
that are in the range 0-9, 10-19, 20-29, ... 80-89, 90-100. Try to think of several ways to do this. Outline
test cases you should add.
For example, given the list of scores
scores = [ 12, 90, 100, 52, 56, 76, 92, 83, 39, 77, 73, 70, 80 ]
The output should be something like
[0,9]: 0
[10,19]: 1
[20,29]: 0
[30,39]: 1
[40,49]: 0
[50,59]: 2
[60,69]: 0
[70,79]: 4
[80,89]: 2
[90,100]: 3
4. Given a list of floating point values containing at least 10 values, how do you find the 10 values that are
closest to each other? In other words, find the smallest interval that contains 10 values. By definition the
minimum and maximum of this interval will be values in the original list. These two values and the 8 in
between constitute the desired answer. This is a bit of a challenging variation on earlier problems from the
semester. Start by outlining your approach. Outline the test cases. For example, given the list
values = [ 1.2, 5.3, 1.1, 8.7, 9.5, 11.1, 2.5, 3, 12.2, 8.8, 6.9, 7.4,\
0.1, 7.7, 9.3, 10.1, 17, 1.1 ]
The list of the closest 10 should be
[6.9, 7.4, 7.7, 8.7, 8.8, 9.3, 9.5, 10.1, 11.1, 12.2]
5. Consider the following recursive function:
def mystery( L, v ):
if v < len(L):
x = L[v]
mystery( L, x )
print(x)
else:
print(v)
2
(a) Show the output from the call:
mystery( [2, 5, 4, 7, 1], 0 )
(b) Write a Python call to the function
mystery
containing a list and an index that causes the recursion
to never stop (until the stack overflows). Do this with as short a list as you possibly can.
(c) Write a Python call to the function
mystery
that causes the program to crash (without the problem
of infinite recursion):
6. You are given the following function definition with doctest comments embedded.
def f(x, y, z = 0, w = False):
'''
>>> f([1,2,3], [4,6,8,5,11], 3, True)
True
>>> f([1,2,3,4,5], [0,2,6], -1, True)
False
>>> f([1,2,3,4,5], [2,3,4])
False
>>> f([5,4,5,8], [6,7,8,9,10,12], 2, True)
False
'''
count = 0
for item in x:
if w and (item+z in y):
count += 1
if count == len(x):
return True
elif count == len(y):
return False
When the lines below are executed, indicate whether the tests above will pass or fail and, for the failures,
indicate what is returned by
f
.
import doctest
doctest.testmod()
7. You are given a dictionary called
clubs
where each key is the name of a club (a string), and each value is
the set of id strings for the students in the club. Write a segment of Python code that creates a set of all
student ids (if any) that are in all the clubs in the dictionary.
8. Write a function called
framed
that takes a string storing a name and creates output with a framed,
centered greeting. For example, if the name string is
'Tim'
the output should be
**********
* Hello! *
*
Tim
*
**********
and if the name string is
'Anderson'
the output should be
************
*
Hello!
*
* Anderson *
************
9. Consider a file called
addresses.txt
that contains a name and an address on each line of the file. The
parts of each name and address are separated by a
'|'
. For example,
3
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
Row trigger that gives the sum total before insert or update
arrow_forward
Due to class time restrictions, the lecturer is unable to respond to all the students' queries.
arrow_forward
Section: FactThyroid function is measured using a factor called TSH, which stands for thyroid-stimulatinghormone. A TSH test is a blood test that measures this hormone. TSH normal values are 0.5 to 5.0mIU/L. If TSH is over 5.0 thyroid is underactive. On the other hand, if TSH is less than 0.5 thyroid isoveractive.
arrow_forward
The expression =IF(A1 > 8, 12*A1, 7*A1) is used in a spreadsheet.Find the result if A1 is 5 Find the result if A1 is 9.
arrow_forward
Students: Johnson, Williams, Matt, Jones, Eric, Lili, John and Jason, whose grades are listed below.
Each column is the grades each student received. There are 8 students with 10 grades each.
Johnson: 79, 92, 85, 0, 100, 64, 72, 99, 90, 86
Williams: 80, 75 93, 94, 0, 90, 89, 88, 87, 86
Matt: 82, 67, 72, 74, 89, 0, 70, 89, 100, 76
Jones: 85, 84, 82.5, 82, 84, 80, 80.5, 90, 96, 85
Eric: 90, 91, 87, 85.5, 86.5, 0, 90, 90, 91, 92
Lili: 60, 75, 81, 70, 80, 81, 94, 67.5, 99, 98
John: 79,0, 74, 96, 88.5, 88, 0, 100, 86, 83
Jason: 89, 90, 90, 85, 85, 90, 91, 88, 100, 79
Write user-defined functions or build-in functions (e.g., sum, mean, max, min, etc.) to calculate:
The Average Grade of each student; this average should be a vector.
The average of the class; this average is a scalar vector.
The highest grade among the Average Grade of Each Student
The lowest grade among the Average Grade of Each Student
Show a table with each student's name, average grade and letter score using A, B, C, D, F…
arrow_forward
Alreej College
Computer
Application
Student Name Student_ID
Math
En
Ahmed Omar
Huda
20f20
45
10
35
20f21
50
45
45
Muhmmed
20f22
20f23
20f24
20f25
46
20
50
Amira
50
35
50
Huda Ahemd
20
50
33
Noora Ali
33
45
46
Figure-1
1) Prepare and format your MS-Excel Document as shown above.
2) The total number of student marks for each Module during the semester needs to be calculated.
Explain how you will do it. Your answer should include cell references to indicate the cells where the
calculations will be done, the cells that will be required for the calculations, and the formula to be
used. Use Microsoft Excel to test your explanations.
3) Explain how you will calculate the Average for each students. Your answer should include cell
references to indicate the cells where the calculations will be done, the cells that will be required for
the calculations, and the formula to
be used. Use Microsoft Excel to test your
explanations.
arrow_forward
what are some summer activities kids can do in a small park, please list as many as possible (more than 10). Example will be face paint and having an ice cream truck present in the park
arrow_forward
Question: True or False
1) the data in an excel table can be sorted into both, ascending and descending order.
reqiured:
please answer this question by giving the correct answer by stating whether this statement is true or false
arrow_forward
Type Reduction in cell M1
The amount is 50% of sick days above 10, whenever sick days exceed 10.
For all other records, the amount is 0
Create the criteria area, starting in cell P8
Enter formula(s) to complete column M, using an IF Statement.
arrow_forward
Syntax for the subplot command is subplot(p, n, m)
Select one:
True
O False
arrow_forward
Number of mappers can be configured in the job config
Select one:
O True
False
Return to: General +)
arrow_forward
A constraint is a limit that is placed on the
data.
Select one:
True
False
arrow_forward
Computer Science
A study conducted by Netflix’s consumer relations department has revealed that customers are more likely to review horror and thriller movies during certain months of the year. To discourage seasonal variations in these movie ratings, Netflix has called for your help to analyze horror and thriller movie rating counts over the past 15 years. Your query should display each month of the year (name of the month not the number) and the total number of ratings given during that month. A third column titled “Promotion Recommendation” determines whether a promotion should be applied to increase the number of ratings given during that month. If a month has less than 2200 ratings the final column should display ‘10% discount promotion’, if between 2201 and 4500 then display ‘5% discount promotion’, and if more than 4500 ratings then output ‘No Promotion’. Order your results by months. Do not hardcode the current date.
ORALCE CODE PLEASE.
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:9780357392676
Author:FREUND, Steven
Publisher:CENGAGE L
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Cengage Learning
Related Questions
- Row trigger that gives the sum total before insert or updatearrow_forwardDue to class time restrictions, the lecturer is unable to respond to all the students' queries.arrow_forwardSection: FactThyroid function is measured using a factor called TSH, which stands for thyroid-stimulatinghormone. A TSH test is a blood test that measures this hormone. TSH normal values are 0.5 to 5.0mIU/L. If TSH is over 5.0 thyroid is underactive. On the other hand, if TSH is less than 0.5 thyroid isoveractive.arrow_forward
- The expression =IF(A1 > 8, 12*A1, 7*A1) is used in a spreadsheet.Find the result if A1 is 5 Find the result if A1 is 9.arrow_forwardStudents: Johnson, Williams, Matt, Jones, Eric, Lili, John and Jason, whose grades are listed below. Each column is the grades each student received. There are 8 students with 10 grades each. Johnson: 79, 92, 85, 0, 100, 64, 72, 99, 90, 86 Williams: 80, 75 93, 94, 0, 90, 89, 88, 87, 86 Matt: 82, 67, 72, 74, 89, 0, 70, 89, 100, 76 Jones: 85, 84, 82.5, 82, 84, 80, 80.5, 90, 96, 85 Eric: 90, 91, 87, 85.5, 86.5, 0, 90, 90, 91, 92 Lili: 60, 75, 81, 70, 80, 81, 94, 67.5, 99, 98 John: 79,0, 74, 96, 88.5, 88, 0, 100, 86, 83 Jason: 89, 90, 90, 85, 85, 90, 91, 88, 100, 79 Write user-defined functions or build-in functions (e.g., sum, mean, max, min, etc.) to calculate: The Average Grade of each student; this average should be a vector. The average of the class; this average is a scalar vector. The highest grade among the Average Grade of Each Student The lowest grade among the Average Grade of Each Student Show a table with each student's name, average grade and letter score using A, B, C, D, F…arrow_forwardAlreej College Computer Application Student Name Student_ID Math En Ahmed Omar Huda 20f20 45 10 35 20f21 50 45 45 Muhmmed 20f22 20f23 20f24 20f25 46 20 50 Amira 50 35 50 Huda Ahemd 20 50 33 Noora Ali 33 45 46 Figure-1 1) Prepare and format your MS-Excel Document as shown above. 2) The total number of student marks for each Module during the semester needs to be calculated. Explain how you will do it. Your answer should include cell references to indicate the cells where the calculations will be done, the cells that will be required for the calculations, and the formula to be used. Use Microsoft Excel to test your explanations. 3) Explain how you will calculate the Average for each students. Your answer should include cell references to indicate the cells where the calculations will be done, the cells that will be required for the calculations, and the formula to be used. Use Microsoft Excel to test your explanations.arrow_forward
- what are some summer activities kids can do in a small park, please list as many as possible (more than 10). Example will be face paint and having an ice cream truck present in the parkarrow_forwardQuestion: True or False 1) the data in an excel table can be sorted into both, ascending and descending order. reqiured: please answer this question by giving the correct answer by stating whether this statement is true or falsearrow_forwardType Reduction in cell M1 The amount is 50% of sick days above 10, whenever sick days exceed 10. For all other records, the amount is 0 Create the criteria area, starting in cell P8 Enter formula(s) to complete column M, using an IF Statement.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Np Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:CengageProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
- COMPREHENSIVE MICROSOFT OFFICE 365 EXCEComputer ScienceISBN:9780357392676Author:FREUND, StevenPublisher:CENGAGE LNew Perspectives on HTML5, CSS3, and JavaScriptComputer ScienceISBN:9781305503922Author:Patrick M. CareyPublisher:Cengage Learning
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:9780357392676
Author:FREUND, Steven
Publisher:CENGAGE L
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Cengage Learning