Question

Carleton

University

Specification for Assignment 02

Your submission for this assignment must include your full name and your nine-digit student

number as a comment at the top of the source file you submit. All source code files must be written

using the Python 3 programming language.

Do not compress your submission into a "zip" file.

Submissions that crash (i.e., terminate with an error) on execution will receive a mark of 0.

COMP 1405/1005 (Winter 2023) – "Introduction to Computer Science I"

For this assignment you will demonstrate that you can use type conversion functions and arithmetic

operations as part of a program that observes the "pipeline" design pattern. You will do so by creating

a program that takes input from the user (using a command-line argument to receive one values and

a call to the input function to receive the other) and then performs a complex series of operations that

was assigned specifically to your student number.

In order to complete this task, you will need to:

receive your assigned instructions via email

know how to use a command-line argument¹

read about the conversion functions and arithmetic operators

evaluate your instructions (by hand) for several inputs (to design test cases for yourself)

Your submission for this assignment:

must be a source code file with filename²

'comp1405_w23_#########_assignment_02.py'

must NOT import anything other that 'sys' (which is required for command-line arguments)

must use both a command-line argument³ and a single call to the 'input' function

must store the result in a variable, updating and printing that variable after each operation

must print the final result to the screen using "triangle brackets" (e.g., )

can assume that the user will always enter a positive integer at any opportunity for input

1 You may wish to refer to "live_demo_05_echo_utility.py", as that demo exhibited the use of a command-line argument.

2 You must replace the number signs in the filename with your official nine-digit student identification number.

3

Such arguments are provided on the command-line, before the program is executed, regardless of where they are used