Lab Assignment 067
Lab Assignment 067
• 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.
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 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:
Note: The rollnumber of M.Tech students starts with ‘M’. (e.g. MCS23010)