0% found this document useful (0 votes)
2 views6 pages

C Programming Model Questions

The document outlines a series of programming tasks for developing systems in C for a university result analysis, a digital library borrowing system, an e-commerce order analysis, and a hospital patient monitoring system. Each task includes requirements for data validation, structure definitions, and various functionalities such as displaying records, calculating totals, and identifying top performers. Additionally, it emphasizes the use of pointers and recursion in the implementation of these systems.

Uploaded by

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

C Programming Model Questions

The document outlines a series of programming tasks for developing systems in C for a university result analysis, a digital library borrowing system, an e-commerce order analysis, and a hospital patient monitoring system. Each task includes requirements for data validation, structure definitions, and various functionalities such as displaying records, calculating totals, and identifying top performers. Additionally, it emphasizes the use of pointers and recursion in the implementation of these systems.

Uploaded by

aparnakarthi308
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

C Programming Model Questions

Write the Pseudocode for Part a and C Program for the rest
1.) A university wants to develop a Result Analysis System to evaluate student performance
across multiple subjects and internal assessments. Each student has rollNo, name, marks
stored in a 2D array where rows represent subjects and columns represent assessments. The
system must compute totals, averages, and identify performance metrics efficiently.
a.) Write a pseudocode to perform the following operations:
 Read student details (RollNo, Name, Marks) and store it in Structure
 Read Number of Subjects, Assessments at the beginning
 Validate marks (must be between 0 and 100)
 Ensure number of subjects and assessments are valid (> 0)
 If duplicate entry is found for the same Roll No, remove the duplicate
 Store validated student record in file
b.)Develop a C program to read student details for N students:
Rules:
Structure should be used for storing various students Roll Number ,Student Name , Marks
(stored in a 2D array: subjects x assessments)
Total marks = sum of all elements in 2D array
Average=total/(subjects x assessments)
If average >= 90 Grade - A
If average >=75 Grade - B
Else → Grade → C
Store each student record using structures, and store all records in an array of structures
Also Store the student records in a .txt File
c.)Modify your program to:
Pass the array of structures using pointers to all functions ans access and modify Student data
using pointer and 2D marks using pointer arithmetic to Implement the following functions
using pointers :
 Display all student records
 Find and display the top student
 Display Student with low performance
 Compute class average
d. Write a recursive function to:
Calculate total marks of a student from the 2D array using loops
Implement a menu with following options until the user gives Exit option :
1. Input Student Data
2. Display Student Records (using pointers)
3. Calculate Total Marks
4. Display Top Student
5. Display Class Average
6. Display Students with Low Performance
7. Exit
2.) A digital library wants to automate its borrowing system. Each borrowing record contains
- Borrow ID, User Name, Book title, Days borrowed, fine per day delay. The system must
store, validate, process, and analyze borrowing records efficiently using C programming
concepts.
 Read borrowing details for N users
 Validate:
 Days borrowed must be >=0
 Fine per day must be > 0
 Check for duplicate entries:
 Same Borrow ID→ remove duplicate
 Store only valid records for further processing
Define a Structure Borrow with: borrowID, username, book Title, daysBorrowed, fine
PerDay, totalFine
Use an array of structure to store N records and Input all validated borrowing details
Rules:
Total Fine = daysBorrowed x finePerDay
If daysBorrowed >=10→ apply 5% discount
If daysBorrowed >=20 apply 10% discount
Store each student record using structures, and store all records in an array of structures and
also in .txt file
c. Modify your program to:
Pass the array of structures using pointers to all functions to access and update data using
pointers such as implement the following functions using pointers
 Display all borrowing records
 Find and display user with highest total fine
 Compute and display book-wise total days borrowed
Write a function using loops to:
Calculate total fine for a record
Implement a menu with following options which displays until the user gives Exit option :
1. Input Borrow Records
2. Display all records (using pointers)
3. Calculate total fine (using recursion)
4. Display top user (highest fine)
5. Book-wise summary
6. Filter short borrowings
7. Exit
3.) An e-commerce platform wants to develop an Order Analysis System to evaluate
customer purchasing behaviour. Each customer has a customerID, name and purchase details
stored in a 2D array, where the rows represent product categories and columns represent
items purchased in each category. The system must compute total spending, average
spending, and customer classification, and efficiently analyze purchasing patterns.
a. Write a pseudocode to perform the following operations:
Read customer details:
Customer ID
Customer Name
Number of Categories
Number of items per category
Purchase data (rows→ product categories, columns → items purchased in each category)
Validate:
1. Number of categories > 0
2. Number of items > 0
3. Purchase amount >=0
Check for duplicate entries: If duplicate Customer ID exists → remove duplicate record
Store only validated customer records for further processing
b. Develop a C program to read details for N customers:
Customer ID
Name
Number of categories
Number of items
Rules:
2D array for purchase data
Total spending = sum of all elements in 2D array
Average spending = total/(categories x items)
Classify customers:
Average >= $5000 premium customer
Average >= $2000 regular customer
Else basic customer
Store each student record using structures, and store all records in an array of structures.
c. Modify your program to:
Pass the array of structures using pointers to all functions
Access and modify:
Customer data using structure pointers
2D purchase array using pointer arithmetic
Implement the following functions using pointers
Display all customer records
Find and display highest spending customer
Compute and display overall platform average spending
d. Write a recursive function to:
Calculate total purchase amount for a customer
Constraint:
No loops inside recursive function
Traverse the 2D matrix using recursively
Implement a menu with following options;
1. Input Customer Data
2. Display Customer Records (using pointers)
3. Calculate Total Spending (using recursion)
4. Display Highest Spending Customer
5. Display Overall Average Spending
6. Display Low Spending Customers
7. Exit
4.) A hospital wants to develop a Patient Monitoring System to analyze patient health data.
Each patient has patientID, name, and temperature readings stored in a 2D array, where -
rows represent days and columns represent readings per day. The system must compute total
readings, average temperature, and identify critical patients efficiently.
a. Write a pseudocode to perform the following operations:
Read customer details:
Patient ID
Patient Name
Number of Days
Number of Readings per Day
Temperature readings (2D array)
Validate:
1. Number of days > 0
2. Number of readings > 0
3. Temperature must be between 95°F and 105°F
Check for duplicate entries: If duplicate Paitent ID exists →remove duplicate
Store only validated patient for further processing
b. Develop a C program to read details for N patients:
Patient ID
Name
Number of days
Number of readings
2D temperature array
Rules:
Total temperature = sum of all readings
Average temperature = total/(days x readings)
Classify customers:
Average >= 102°F → Critical
Average >= 99°F → Moderate
Else → Normal
Store each paitent record using structures, and store all records in an array of structures.
c. Modify your program to:
Pass the array of structures using pointers to all functions
Access and modify:
Patient data using structure pointers
2D temperature array using pointer arithmetic
Implement the following functions using pointers
Display all patient records
Identify and display critical patient (highest average)
Compute overall hospital average temperature
e. Write a recursive function to:
Calculate total temperature readings of a patient
Constraint:No loops inside recursive function
averse the 2D matrix using recursive
Implement a menu with following options;
1. Input Patient Data
2. Display Patient Records (using pointers)
3. Calculate Total Temperature (using recursion)
4. Display critical patient
5. Display hospital average temperature
6. Display stable patients
7. Exit

You might also like