0% found this document useful (0 votes)
9 views4 pages

AP 2324 Spring A1

The document provides guidelines for submitting Assignment 1. It includes two questions - the first asks to create a user registration GUI in Tkinter, the second asks to write functions to perform various tasks using provided data files. It also includes a question to write an algorithm and Python code to calculate student lab mark averages after removing the worst 3 marks.

Uploaded by

giwiwa7538
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views4 pages

AP 2324 Spring A1

The document provides guidelines for submitting Assignment 1. It includes two questions - the first asks to create a user registration GUI in Tkinter, the second asks to write functions to perform various tasks using provided data files. It also includes a question to write an algorithm and Python code to calculate student lab mark averages after removing the worst 3 marks.

Uploaded by

giwiwa7538
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Istanbul Medipol University

Spring 2023-2024
Advanced Programming
Assignment 1
due by Sunday, April 05, 2024 - 23:59

Submission Guidelines

• Make sure your Python code compiles. Any non-compiling code will receive a very low
mark.

• Naming : YourDept StudentNumber InitialName LastName AssignmentNumber.py,


For example, CoE 64123456 MalekMalkawi A1.py (Not following the naming rule means
ZERO). You will submit only one Python file.

• Carefully read the questions and pay special attention to sentences that involve “should”,
“should not”, “do not”, and other underlined/bold font statements.

• If you use code from a resource (website, book, etc.), make sure that you reference those
resources at the top of your source code file in the form of comments. You should give
details of which part of your code is from what resource. Failing to do so may result
in a plagiarism investigation.

• Any similarity in your source codes will have serious consequences for both parties.

• Late Submission Policy: late submissions will NOT be accepted.

1
Question 1 - Graphical User Interface - Tkinter (20 Pts)

Design a tkinter GUI application for user registration. Utilize the provided screenshot of
the GUI layout as a reference to create the application (Figure1,2). Include entry widgets
for the user’s name and age, along with radio buttons for selecting the user’s gender. Add
a submit button to register the user. Upon submitting the form, display the entered user
details.

Figure 1: GUI - Before Submit Figure 2: GUI - After Submit

• (10 Pts) Write a Python code using Tkinter GRID layout that will produce the given
GUI (Figure 1,2) output screen with the related functionality.

• (10 Pts) Write a Python code using Tkinter PACK layout that will produce the given
GUI (Figure 1,2) output screen with the related functionality.

2
Q2: Task-based Functions (57 Pts)

In this question you are going to create a function for each of the following tasks:

• [Task-1] (5 Pts) Set up a new virtual environment named ”asgmt1” and install three
Python packages. Once the packages are installed, generate a requirements.txt.
Please upload the requirements.txt file generated, and in a separate file, provide a
list of all the commands you used.

• [Task-2] (16 Pts) Using the given “udata.json” file, implement a code for each of
the following tasks.

– [Task-2.1] List all the course codes and their corresponding course names.

– [Task-2.3] List all courses offered on Mondays.

– [Task-2.4] Find the number of courses offered on Wednesdays.

– [Task-2.2] Determine the total number of credits for all courses in the Faculty
of Engineering.

• [Task-3] (16 Pts) Using the given “sdata.xlsx” file, implement a code for each of the
following tasks.

– [Task-3.1] How many students are there in the dataset?

– [Task-3.2] What is the most common age among the students?

– [Task-3.3] Calculate the total GPA of all female students.

– [Task-3.4] Who is the oldest student in the dataset? What is their age?

• [Task-4] (10 Pts) Write a Python function that opens a file named ”words.txt”,
calculates the frequency of each letter in the file, and then writes these frequencies
along with the corresponding letters into a new file named ”freq words.txt” in the
format of {frequency: [letter1, letter2, ...]} pairs.

• [Task-5] (10 Pts) Write a Python program that prompts the user to enter two numbers.
Handle the case where the user enters non-numeric input gracefully, displaying an error
message. Then, perform division on the two numbers and handle the ZeroDivisionError
if the second number is zero.

3
Q3: Algorithm and Flowcharts (23 Pts)

Assume that a student inputs his/her lab marks for programming in Python class. The
marks are integers. When the student enters a negative number, it means that he/she is
done with the entering of his/her marks.

In this exercise, we want you to find the average of the marks after the instructor removes
the worst 3 lab marks. If the students enters less than 4 marks, then print the average of
these entered marks. Otherwise, remove the three worst numbers and calculate the average
of the remaining marks. For example, if a student enters

12 98 45 24 56 89 33 -1
The program should output : 72 for the average of 98 45 56 89

and for
12 98 -10
it should print 55 for the average of 12 and 98.

• (13 Pts) Provide the flowchart.

• (10 Pts) Provide the full Python-code.

You might also like