• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 11 pages
Exam (elaborations)

CSC121 Python Midterm Exam Questions With Complete Solutions

Document preview thumbnail
Preview 2 out of 11 pages

CSC121 Python Midterm Exam Questions With Complete Solutions /. algorithm - Answer-A set of steps designed to generate the desired output /.A complete algorithm typically includes - Answer-A. input steps B. processing steps C. output steps /.processing steps - Answer-Steps that perform calculations and logical processing are called /.an input item - Answer-A program asks the user to enter the unit price of a chair and the quantity he is buying. It calculates and displays the total price. The unit price is /.an output item - Answer-A program asks the user to enter the unit price of a chair and the quantity he is buying. It calculates and displays the total price. The total price is /.missing output step - Answer-The following algorithm is designed to calculate and display the area of a rectangle: Step 1: Input length and width Step 2: Calculate area = length * width Anything wrong with this algorithm? /.missing input step - Answer-Hotdog is $3 each and soda is $0.75 each in a hotdog stand. The following algorithm is designed to calculate the total price for a customer's order: Step 1: Calculate total price = number of hotdogs * 3 + number of sodas * 0.75 Step 2: Display total price Anything wrong with this algorithm? /.incomplete processing step - Answer-Students in a course need to take an exam and complete a project. When the course grade is calculated, the exam is 70% while the prject is 30%. The following algorithm is designed to calculate course grade Step 1: Input exam score and project score Step 2: Calcuate exam score * 0.7 + project score * 0.3 Step 3: Display course grade Anything wrong with this algorithm? /.incorrect processing step - Answer-A music store is having a clearance sale. All CDs are 30% off. The following algorithm is desgined to calculate sale price: Step 1: Input original price Step 2: Calcuate sale price = original price * 0.30 Step 3: Display sale price Anything wrong with this algorithm? /.3 - Answer-The following algorithm is designed to calculate the total cost of buying chairs: Step 1: Input unit price Step 2: Input quantity Step 3: Calcuate total price = unit price * quantity Step 4: Display total price How many variables will there be if we execute this algorithm? /.first_exam - Answer-Which of the following Python variable name is valid? /.unitprice unitPrice unit_price - Answer-Which of the following Python variable names are valid? /.store data in computer memory - Answer-In Python, assignment statements are used to /.A. retrieves the value of y B. calculates the total of 5 and the value of y C. stores the result of the calculation in the variable x - Answer-What does the computer do when it executes the following statement: x = y + 5 /.20 - Answer-What is the output of the following Python program? x = 10 x = 20 print(x) /.2 - Answer-What is the output of the following Python program?

Content preview

CSC121 Python Midterm Exam
Questions With Complete Solutions

/. algorithm - Answer-A set of steps designed to generate the desired output

/.A complete algorithm typically includes - Answer-A. input steps
B. processing steps
C. output steps

/.processing steps - Answer-Steps that perform calculations and logical processing are
called

/.an input item - Answer-A program asks the user to enter the unit price of a chair and
the quantity he is buying. It calculates and displays the total price. The unit price is

/.an output item - Answer-A program asks the user to enter the unit price of a chair and
the quantity he is buying. It calculates and displays the total price. The total price is

/.missing output step - Answer-The following algorithm is designed to calculate and
display the area of a rectangle:

Step 1: Input length and width
Step 2: Calculate area = length * width

Anything wrong with this algorithm?

/.missing input step - Answer-Hotdog is $3 each and soda is $0.75 each in a hotdog
stand. The following algorithm is designed to calculate the total price for a customer's
order:

Step 1: Calculate total price = number of hotdogs * 3 + number of sodas * 0.75
Step 2: Display total price

Anything wrong with this algorithm?

/.incomplete processing step - Answer-Students in a course need to take an exam and
complete a project. When the course grade is calculated, the exam is 70% while the
prject is 30%. The following algorithm is designed to calculate course grade

Step 1: Input exam score and project score
Step 2: Calcuate exam score * 0.7 + project score * 0.3
Step 3: Display course grade

, Anything wrong with this algorithm?

/.incorrect processing step - Answer-A music store is having a clearance sale. All CDs
are 30% off. The following algorithm is desgined to calculate sale price:

Step 1: Input original price
Step 2: Calcuate sale price = original price * 0.30
Step 3: Display sale price

Anything wrong with this algorithm?

/.3 - Answer-The following algorithm is designed to calculate the total cost of buying
chairs:

Step 1: Input unit price
Step 2: Input quantity
Step 3: Calcuate total price = unit price * quantity
Step 4: Display total price

How many variables will there be if we execute this algorithm?

/.first_exam - Answer-Which of the following Python variable name is valid?

/.unitprice
unitPrice
unit_price - Answer-Which of the following Python variable names are valid?

/.store data in computer memory - Answer-In Python, assignment statements are used
to

/.A. retrieves the value of y
B. calculates the total of 5 and the value of y
C. stores the result of the calculation in the variable x - Answer-What does the computer
do when it executes the following statement:

x=y+5

/.20 - Answer-What is the output of the following Python program?

x = 10
x = 20
print(x)

/.2 - Answer-What is the output of the following Python program?

Document information

Uploaded on
June 17, 2025
Number of pages
11
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$12.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

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.
Brainariam
3.4
(30)
Sold
160
Followers
7
Items
8386
Last sold
4 weeks ago



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

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions