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

Lab Assignment 067

The document provides instructions for a programming assignment involving storing student data in structures and arrays. It details naming conventions, submission requirements, and two programming problems - one to assign grades based on marks, and another to store either marks or grades based on student type.

Uploaded by

nandeepmtr
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)
12 views

Lab Assignment 067

The document provides instructions for a programming assignment involving storing student data in structures and arrays. It details naming conventions, submission requirements, and two programming problems - one to assign grades based on marks, and another to store either marks or grades based on student type.

Uploaded by

nandeepmtr
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/ 3

National Institute of Technology Calicut

Department of Computer Science and Engineering


B. Tech. (CSE) – First Semester
CS1091E: Programming Laboratory
Problem Set – 8

Submission deadline (on or before):


• 14/11/23, 5:00 PM
Policies for Submission and Evaluation:

• You must submit your programs in the moodle (Eduserver) course page,
on or before the submission deadline. Also, ensure that your programs
compile and execute without errors in the linux platform. During evalu-
ation, failure to execute programs without compilation errors may lead
to zero marks for that program. Detection of ANY malpractice can
lead to awarding an F grade in the course.

Naming Conventions for Individual Program


• P S < P ROBLEM SET N U M BER > < ROLLN O > <
F IRST − N AM E > < P ROGRAM − N U M BER > . <
extension > (For example: P S08 BxxyyyyCS LAXM AN 1.c).
Please make sure that you follow the naming conventions correctly.

Naming Conventions for Submission


• Submit a single ZIP (.zip) file (do not submit in any other archived
formats like .rar, .tar, .gz) containing the source code (.c file). The
name of this file must be P S < P ROBLEM SET N U M BER >
< ROLLN O > < F IRST − N AM E > .zip (For example:
P S08 BxxyyyyCS LAXM AN.zip). DO NOT add any other files (like
temporary files, input files, etc.) except your source code, into the zip
archive.

Standard of Conduct
• Violations of academic integrity will be severely penalized. Each student
is expected to adhere to high standards of ethical conduct, especially those
related to cheating and plagiarism. Any submitted work MUST BE an
individual effort. Any academic dishonesty will result in zero marks in the
corresponding exam or evaluation and will be reported to the department
council for record keeping and for permission to assign F grade in the
course.

General Instructions
• Programs should be written in C language and compiled using C com-
piler in Linux platform. Sample inputs are just indicative. Submit the

1
solutions to questions 1 and 2 as a single .zip file through the
submission link in Eduserver.

QUESTIONS
1. Read the rollnumber (string) and marks (int) of n (1 <= n <= 100 is
an integer) students and assign a character grade to each student based
on the grading criteria given below:

Marks Grade
80 -100 A
60 -79 B
50 -59 P
0 -49 F

The value of n is entered by the user. Use a one dimensional array of


structures, M for storing the rollnumber, marks and grade. Define the
functions whose prototypes are given below:

char marksToGrade(int); //given marks, returns the corresponding grade

void printResult(int); //prints the rollnumber, marks and grade


//of students, given the number of students

void printStudent(struct student); //prints the members in the given struct


//in a single line with a single space
//separation between members

The main() function, after creating the array M (by reading in the marks),
should compute and store the grade for each student by invoking mark-
sToGrade(). Then main() should invoke printResult() which in turn should
invoke printStudent() for each student.

2. Read the rollnumber (string) and marks (int) of n (1 <= n <= 100 is
an integer) students in a particular course. The course is a core course for

2
B.Tech students and a Pass/Fail elective for M.Tech students. For B.Tech
students, the marks are to be stored and for M.Tech students, the marks
are to be converted to a letter grade (P/F) and this grade is to be stored.
The grading criteria is given below:

Marks Grade
50-100 P
0-49 F
The value of n is entered by the user. Use a one dimensional array
of structures, M for storing the rollnumber, and marks or grade (use
union). Define and use the function whose prototype is given below:

void printResult(void); //prints the rollnumber and marks for B.Tech


//students and rollnumber and grade for M.Tech
//students. The details of each student is to be
//printed in separate line with a single space
//separation between the members.

Note: The rollnumber of M.Tech students starts with ‘M’. (e.g. MCS23010)

You might also like