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

UNIT - 1 Application

Uploaded by

kasithangamcse92
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)
26 views6 pages

UNIT - 1 Application

Uploaded by

kasithangamcse92
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/ 6

UNIT – 1

APPLICATION

Case study develop a system to manage student records, including personal information,
academic performance and attendance. Enrich with appropriate algorithm, , neat flow chart,
pseudo code

### **Case Study: Developing a Student Records Management System in C**

#### **1. System Requirements**

**User Roles**:
- **Administrator**: Manages student records, including adding, updating, deleting, and
viewing records.
- **Teacher**: Updates academic performance and attendance.
- **Student**: Views personal academic performance and attendance.

**Data Components**:
- **Personal Information**: Name, Student ID, Date of Birth, Contact Information, Address.
- **Academic Performance**: Courses, Grades, GPA.
- **Attendance**: Dates, Presence/Absence, Percentage.

#### **2. System Architecture**

**Frontend**: Command-line interface (CLI) for administrators, teachers, and students.

**Backend**:
- **Data Structures**: Arrays and structures to store and manage student records.
- **Logic Layer**: Functions to handle data processing, including algorithms for GPA
calculation and attendance tracking.

#### **3. Algorithms**

**GPA Calculation**:
- **Input**: Array of courses with grades.
- **Output**: GPA.
- **Formula**: \( GPA = \frac{\sum (Grade \times Credit Hours)}{\sum Credit Hours} \)

**Attendance Percentage Calculation**:


- **Input**: Total classes, number of attended classes.
- **Output**: Attendance percentage.
- **Formula**: \( Attendance\% = \frac{Attended Classes}{Total Classes} \times 100 \)

#### **4. Flowchart**

**Flowchart Description**:

1. **Start**: The system begins operation.


2. **Login**: User selects role (Administrator, Teacher, Student).
3. **Role-Based Actions**:
- **Administrator**: Manages student records (Add, Update, Delete, View).
- **Teacher**: Updates academic performance and attendance.
- **Student**: Views academic performance and attendance.
4. **GPA and Attendance Calculation**: Based on data input, GPA and attendance
percentages are calculated.
5. **Store Data**: Data is stored in appropriate data structures.
6. **End**: The system completes the operation.

```plaintext
+----------------------------------+
| Start |
+----------------------------------+
|
v
+----------------------------------+
| Login: Select Role |
+----------------------------------+
|
v
+----------------------------------+ +----------------------------------+ +-------------------
---------------+
| Admin Actions | | Teacher Actions | | Student Actions
|
| - Add/Update/View/Delete Student |<----------| - Update Grades & Attendance |<----------|
- View Performance & Attendance |
| Records | | | | |
+----------------------------------+ +----------------------------------+ +-------------------
---------------+
| | |
v v v
+----------------------------------+ +----------------------------------+ +-------------------
---------------+
| Calculate GPA & Attendance | | Store Data in Data Structures | | End
|
+----------------------------------+ +----------------------------------+ +-------------------
---------------+
|
v
+----------------------------------+
| Store Data in Data Structures |
+----------------------------------+
|
v
+----------------------------------+
| End |
+----------------------------------+
```

#### **5. Pseudocode**


```c
#include <stdio.h>
#include <string.h>

#define MAX_STUDENTS 100


#define MAX_COURSES 5

// Structure Definitions
typedef struct {
char course_name[50];
int grade;
int credit_hours;
} Course;

typedef struct {
char name[50];
char student_id[15];
char dob[15];
char contact_info[50];
char address[100];
Course courses[MAX_COURSES];
int num_courses;
int total_classes;
int attended_classes;
} Student;

// Global Array to Store Student Records


Student students[MAX_STUDENTS];
int student_count = 0;

// Function to Add a New Student


void add_student() {
if (student_count >= MAX_STUDENTS) {
printf("Cannot add more students. Database full.\n");
return;
}
Student s;
printf("Enter student name: ");
scanf(" %[^\n]%*c", s.name);
printf("Enter student ID: ");
scanf(" %s", s.student_id);
printf("Enter date of birth: ");
scanf(" %s", s.dob);
printf("Enter contact information: ");
scanf(" %[^\n]%*c", s.contact_info);
printf("Enter address: ");
scanf(" %[^\n]%*c", s.address);
s.num_courses = 0;
s.total_classes = 0;
s.attended_classes = 0;
students[student_count++] = s;
printf("Student added successfully.\n");
}

// Function to Update a Student's Academic Performance


void update_grades() {
char student_id[15];
printf("Enter student ID to update grades: ");
scanf(" %s", student_id);

for (int i = 0; i < student_count; i++) {


if (strcmp(students[i].student_id, student_id) == 0) {
printf("Enter number of courses: ");
scanf("%d", &students[i].num_courses);
for (int j = 0; j < students[i].num_courses; j++) {
printf("Enter course name: ");
scanf(" %[^\n]%*c", students[i].courses[j].course_name);
printf("Enter grade: ");
scanf("%d", &students[i].courses[j].grade);
printf("Enter credit hours: ");
scanf("%d", &students[i].courses[j].credit_hours);
}
printf("Grades updated successfully.\n");
return;
}
}
printf("Student not found.\n");
}

// Function to Update Attendance


void update_attendance() {
char student_id[15];
printf("Enter student ID to update attendance: ");
scanf(" %s", student_id);

for (int i = 0; i < student_count; i++) {


if (strcmp(students[i].student_id, student_id) == 0) {
printf("Enter total number of classes: ");
scanf("%d", &students[i].total_classes);
printf("Enter number of classes attended: ");
scanf("%d", &students[i].attended_classes);
printf("Attendance updated successfully.\n");
return;
}
}
printf("Student not found.\n");
}

// Function to Calculate GPA


float calculate_gpa(Student s) {
int total_points = 0;
int total_credit_hours = 0;
for (int i = 0; i < s.num_courses; i++) {
total_points += s.courses[i].grade * s.courses[i].credit_hours;
total_credit_hours += s.courses[i].credit_hours;
}
return (float)total_points / total_credit_hours;
}

// Function to Calculate Attendance Percentage


float calculate_attendance(Student s) {
return ((float)s.attended_classes / s.total_classes) * 100;
}

// Function to View Student Record


void view_student() {
char student_id[15];
printf("Enter student ID to view record: ");
scanf(" %s", student_id);

for (int i = 0; i < student_count; i++) {


if (strcmp(students[i].student_id, student_id) == 0) {
printf("Name: %s\n", students[i].name);
printf("Student ID: %s\n", students[i].student_id);
printf("Date of Birth: %s\n", students[i].dob);
printf("Contact Info: %s\n", students[i].contact_info);
printf("Address: %s\n", students[i].address);
printf("GPA: %.2f\n", calculate_gpa(students[i]));
printf("Attendance: %.2f%%\n", calculate_attendance(students[i]));
return;
}
}
printf("Student not found.\n");
}

// Main Function
int main() {
int choice;
do {
printf("1. Add Student\n");
printf("2. Update Grades\n");
printf("3. Update Attendance\n");
printf("4. View Student\n");
printf("5. Exit\n");
printf("Enter your choice: ");
scanf("%d", &choice);

switch(choice) {
case 1:
add_student();
break;
case 2:
update_grades();
break;
case 3:
update_attendance();
break;
case 4:
view_student();
break;
case 5:
printf("Exiting the system...\n");
break;
default:
printf("Invalid choice. Try again.\n");
}
} while(choice != 5);

return 0;
}
```

#### **6. Conclusion**

This student records management system in C allows administrators to manage student


records, teachers to update academic performance and attendance, and students to view their
records. The pseudocode and C implementation provide a structured approach to managing
student data, with algorithms for GPA and attendance calculations, making the system robust
and efficient. The flowchart visually represents the flow of data and user interactions within
the system.

You might also like