0% found this document useful (0 votes)
10 views

Functions Assignment

The assignment focuses on understanding and implementing functions in programming through the creation of a Student Grade Management System. Students are required to develop a program that calculates and displays various grade statistics while utilizing functions for input, calculations, and output. Deliverables include a flowchart or pseudocode, the program source code, and a detailed explanation of function roles and parameter-passing methods.

Uploaded by

sunailayub01
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Functions Assignment

The assignment focuses on understanding and implementing functions in programming through the creation of a Student Grade Management System. Students are required to develop a program that calculates and displays various grade statistics while utilizing functions for input, calculations, and output. Deliverables include a flowchart or pseudocode, the program source code, and a detailed explanation of function roles and parameter-passing methods.

Uploaded by

sunailayub01
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Submitted by Sunail Ayub

Department Computer Science

Registration no 2021-KIU-Bs5509

Submitted to Sir Mazhar Ali Shah

Assigment 03
Assignment: Understanding and Implementing Functions in Programming

Objective
To develop students' understanding of functions in programming, including the concepts of
function definition, function calls, and parameter passing (by value and by reference). This
assignment encourages critical thinking and practical implementation while fostering a
deep understanding of problem-solving with functions.

Assignment Details

Problem Statement
Create a Student Grade Management System that calculates and displays the average grade,
highest grade, lowest grade, and grade distribution (number of students scoring within
specific ranges) for a class of students. Use functions to perform the following tasks:

- Input the grades of students.

- Calculate the average grade.

- Find the highest and lowest grades.

- Calculate the grade distribution (e.g., number of students scoring A, B, C, etc.).

- Display the results.

Requirements

Design Phase
- Create a flowchart or pseudocode to outline the logic of your program.

- Identify and describe the purpose of each function.

- Decide whether to use function call by value or function call by reference for each function
and provide a justification.

Implementation Phase
- Write the program in any programming language taught in class (e.g., Python, C++, Java).

- Use meaningful names for functions and variables.


- Include comments explaining the purpose of each function and the reasoning for using a
specific parameter-passing method.

Constraints
- Assume a class size of up to 50 students.

- Grades should be entered as integers between 0 and 100.

- The program should handle invalid inputs gracefully (e.g., prompting the user to re-enter a
valid grade).

Deliverables
- Flowchart or pseudocode for the program design.

- The program source code.

- A detailed explanation (200-300 words) of:

- The role of each function.

- The reasoning behind choosing call by value or call by reference for each function.

- A brief reflection on how functions made the program modular and easier to implement.

Grading Criteria
- Completeness and correctness of the flowchart/pseudocode (20%).

- Proper use of functions (definition, calling, parameter passing) (30%).

- Functionality of the program (25%).

- Code readability, comments, and modularity (15%).

- Explanation of decisions on parameter passing and reflection (10%).

Example Function Suggestions


- Input Grades: Collect grades and pass them by reference to a list/array.

- Calculate Average: Pass grades by reference and return the average by value.

- Find Min/Max: Pass grades by reference to find the highest and lowest grades.

- Grade Distribution: Pass grades by reference and calculate the counts for each grade range.

- Display Results: Use call by value for results to display them without modification.

Learning Outcomes
- Understand how to design programs using modular components (functions).
- Differentiate between call by value and call by reference and apply them effectively.

- Solve real-world problems by designing and implementing structured, function-based


solutions.

You might also like