Introduction to Computer Science
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
COMP 1405/1005 Introduction to Computer Science
Practice Questions for Quiz 1
You are NOT permitted to post this document online.
You are NOT permitted to share this document with anyone.
This document was designed to help you prepare for the first of your quizzes in COMP 1405/1005.
Before proceeding any further
The actual quiz is 1.0 hours in duration and will be available to you (as a Brightspace activity) over
a 48-hour period. You are advised to complete the quiz as early as possible, to reduce the likelihood
of technical complications. In the event of a technical issue student
number, and a brief description of the issue, and then complete the quiz if you are able to do so.
For this quiz, we will use the "honour system", meaning that you must complete the quiz individually,
without collaboration or unauthorized aids. You may use the virtual machine to test any of your
programs if you wish, but the questions have been designed such that this should not be necessary. You
are not permitted to communicate with anyone, use the internet for any reason, or refer to your
notes during the quiz.
Question 1: "Geometric Solid Calculation"
For this question you will design and implement a program that starts by asking the user for the
radius of the outer surface, the radius of the inner surface, and the height of a hollow cylinder. The
values that the user provides can be either integers or floating-point values, and your program must
then compute the volume and display the result. To compute the volume of a hollow cylinder, you
start by computing the square of the radius of the outer surface and then subtract from that the
square of the radius of the inner surface. You then multiply this result by the height of the cylinder,
and then multiply that result by pi.
The result must be displayed on the terminal to a precision of 4 decimal places, and you must use
an "f-string" (i.e., a formatted string literal) to accomplish this - you are not permitted to use any
rounding functions. (n.b., f-strings were not discussed in class but were part of one of your many
mandatory reading assignments)
Do not import any libraries and use a value of 3.14159 for pi.
With this question, I am attempting to assess…
if you understand data types and can prepare user input for processing
if you can translate a series of instructions using the "pipeline" design pattern
if you know how to use the arithmetic operators in Python
if you can use f-strings (which appeared in a mandatory reading assignment)
COMP 1405/1005 (Winter 2023) − "Introduction to Computer Science I"
Practice Questions for Quiz 1
Question 2: "Logical Evaluation"
For this question you must evaluate the result of this circuit if inputs A, B, C, F, and G each have a
value of False, and inputs D, E, and H each have a value of True.
For this question you must evaluate the result of this circuit if inputs D and E each have a value of
False, and inputs A, B, C, F, G, and H each have a value of True.
n.b., You will encounter five (not two) such questions during the actual quiz.
With this question, I am attempting to assess…
if you can recognize the circuit schematic symbols for AND, OR, and NOT
if you can evaluate logic operations (i.e., conjunction, disjunction, and negation)
if you know how to perform a "reduction" (i.e., evaluate a complex expression)
COMP 1405/1005 (Winter 2023) − "Introduction to Computer Science I"
Practice Questions for Quiz 1
Question 3: "Guessing Game"