• 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 5 pages
Exam (elaborations)

CS 1101 Unit 2 Programming Assignment 2026/2027 | Programming Solutions, Study Guide & Assignment Review

Document preview thumbnail
Preview 2 out of 5 pages

CS 1101 Unit 2 Programming Assignment 2026/2027 | Programming Solutions, Study Guide & Assignment Review

Content preview

*@*^%^#!*&^*&^!()(@*&$*@10/23/2026,
*@*^%^#!*&^*&^!()(@*&$*@10/23/2026,
*@*^%^#!*&^*&^!()(@*&$*@10/23/2026,
4:03:13 AM1
4:03:13
of 5Page
AM1
4:03:13
of1CS
5Page
AM1
1101
of1CS
5Page
–1101
Unit
1CS–
2 Programming
1101
Unit –
2 Programming
UnitAssignment.pdf2026/10/23Page
2 Programming
Assignment.pdf2026/10/23Page
Assignment.pdf2026/10/23Page
1 of 5 1 of 5 1 of 5




CS 1101 – Unit 2 Programming Assignment

CS 1001 - Programming Fundamentals




Part 1: Function to Print Circumference of a Circle


Explanation of the Code

The circumference of a circle is calculated with the formula: Circumference = 2×π×r2×π×r

Where:

● (π = 3.14159 (≅ 3.142) )

● ( r ) is the radius of the circle


The function print_circum takes the radius as an argument, performs the calculation using

Python’s arithmetic operators, and prints the result. Calling the function three times shows it works

for different circle sizes.




Python Code for Part 1

# Function to calculate and print the circumference of a circle
def print_circum(radius):
pi = 3.14159
circumference = 2 * pi * radius
print("The circumference for radius", radius, "is:", circumference)

# Calling the function three times with different radius values
print_circum(3)
print_circum(7.5)
print_circum(10)




pg. 1………..>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<


*@*^%^#!*&^*&^!()(@*&$*@10/23/2026,
*@*^%^#!*&^*&^!()(@*&$*@10/23/2026,
*@*^%^#!*&^*&^!()(@*&$*@10/23/2026,
4:03:13 AM1
4:03:13
of 5Page
AM1
4:03:13
of1CS
5Page
AM1
1101
of1CS
5Page
–1101
Unit
1CS–
2 Programming
1101
Unit –
2 Programming
UnitAssignment.pdf2026/10/23Page
2 Programming
Assignment.pdf2026/10/23Page
Assignment.pdf2026/10/23Page
1 of 5 1 of 5 1 of 5

, *@*^%^#!*&^*&^!()(@*&$*@10/23/2026,
*@*^%^#!*&^*&^!()(@*&$*@10/23/2026,
*@*^%^#!*&^*&^!()(@*&$*@10/23/2026,
4:03:13 AM2
4:03:13
of 5Page
AM2
4:03:13
of2CS
5Page
AM2
1101
of2CS
5Page
–1101
Unit
2CS–
2 Programming
1101
Unit –
2 Programming
UnitAssignment.pdf2026/10/23Page
2 Programming
Assignment.pdf2026/10/23Page
Assignment.pdf2026/10/23Page
2 of 5 2 of 5 2 of 5




Part 2: Catalog and Discount Function


Technical Explanation of the Code


In this task, a company sells three different items. A customer may buy:


● Only one item (no discount)

● A combo of two unique items (10% discount)

● A gift pack containing all three items (25% discount)


The function below:


1. Accepts a list of items purchased.

2. Calculates the price depending on how many unique items are selected.

3. Applies the correct discount using basic operators.

4. Prints the final price.


This demonstrates Python concepts such as functions, parameters, lists, conditional statements,

arithmetic expressions, and string formatting.



pg. 2………..>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<


*@*^%^#!*&^*&^!()(@*&$*@10/23/2026,
*@*^%^#!*&^*&^!()(@*&$*@10/23/2026,
*@*^%^#!*&^*&^!()(@*&$*@10/23/2026,
4:03:13 AM2
4:03:13
of 5Page
AM2
4:03:13
of2CS
5Page
AM2
1101
of2CS
5Page
–1101
Unit
2CS–
2 Programming
1101
Unit –
2 Programming
UnitAssignment.pdf2026/10/23Page
2 Programming
Assignment.pdf2026/10/23Page
Assignment.pdf2026/10/23Page
2 of 5 2 of 5 2 of 5

Document information

Uploaded on
October 26, 2026
Number of pages
5
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$10.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.
aumiran0
4.7
(144)
Sold
1185
Followers
3
Items
654
Last sold
1 week 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