M1-Assignment-Problem Statement

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Report Card Generator App

Hey! Welcome to your first assignment. Hope you have had a great learning experience so far
with us and now are pretty confident and comfortable to write programs in C language.

This assignment is meant to test your programming concepts based on what you have learned in
this module (Module 1). Don’t worry! You don’t have to build anything fancy, a simple and clean
executable program will work and that is all we need you to do at this moment :)

Problem Statement
Your task is to write a C program to generate the report card of a student based on his marks
secured in the final examination.

Desired Output
------------------------------------------------------------------------
Jawahar Navodaya Vidyalaya
Annual Report Card

Name: Sriyank Siddhartha


Standard: 10
Section: A

Marks Secured out of 100


Mathematics: 93
English: 74
Hindi: 85
Science: 97
Social Science: 81

Total marks secured: 430


Grade: B
------------------------------------------------------------------------
Approach
Using the following approach you need to first write an algorithm and define the required steps
to create the app. For writing algorithms, you can use a sheet of paper or any text editing software
such as Microsoft Word.

1. Write a code for user input (use appropriate data type as applicable)
- Student name
- Standard (Class)
- Section
- Marks secured in
● Mathematics
● English
● Hindi
● Science
● Social Science
2. While taking user input, take care of clearing the input buffer stream after scanf() statements
(as applicable) by using the following statement:
- while ((getchar()) != '\n');
3. Once you get the marks secured for all the subjects, calculate the total marks secured.
4. Now based on the total marks secured, you need to assign a grade to the student.
- Grade A
- Total marks secured between 450-500
- Grade B
- Total marks secured between 400-449
- Grade C
- Total marks secured between 350-399
- Grade D
- Total marks secured between 300-349
- Grade E
- Total marks secured between 200-299
- Grade F
- Total marks secured below 200 but greater than equal to 0
4. Follow good coding practices to make your code clean.
Additional Tasks
- You may print a decorated welcome message.
- While accepting user input use user-friendly messages to improve user experience.
- You may use the usleep() function as per the need.
- If the total marks secured exceeds 500 or is found to be below 0, then your program should
terminate and the report card should not be generated.

Note: You can Google how to terminate (exit) the C program.

Hints
- To draw a dashed line use symbol hyphen (-) in the print statements.
- Use escape characters such as ‘\t’, ‘\n’ wherever needed.

Submission
After completing the assignment, upload the zip file containing the algorithm and source code
file from the progress report. If you have written algorithm on a paper then upload a photo of it or
if you have written algorithm in an editor then upload the digital file itself.

Solution
You can download the solution to the assignment from the progress report once you have
uploaded the solution. You may compare your program with the provided solution and can
execute the same in the Eclipse IDE.

You might also like