You are on page 1of 16

LIST OF CONTENTS

INTRODUCTION

• SCOPE

IN-SCOPE
OUT OF SCOPE

• OVERVIEW

• USE CASE SCENERIOS

• TEST CASES

• OUTPUT
. College attendance

Introduction:

Purpose:

• This project covers the significance of student


attendance in the college.

• It elevates the interest of the student on the


subject and the college.

• Attendance proves thhe interest of particular


student to improve his/her eligibility,efficiency
along with knowledge and hardwork which may
result in percentage of marks obtained during
exams.

• If we take in to consideration particular student


details of concerned class or section, we tally the
attendance percentage of each students with
number of working days of the college for each
month.

• Attendance proves the capability of a student


who proves their best by attending the classes
and concentrating on subject.
• Attendances are taken for every lecture and these
are fed into the college information system.

• Lecturers and faculty directors will have access


to a complete record of student attendance.

• Students who have deep concentration towards


their education and career do give importance to
their attendance which shows their interest
towards studies.

• How can you say that mere attendance makes a


part of students life ?? its just by showing the
importance of attendance.

• These records are regularly checked to identify


students whose attendance is becoming a
problem.
Scope:
What is scope?
What does it explain?
How do we express its importance?

 The three questions regarding scope derive the


importance and regularity of attendance of a
particular student.

 Elevating the importance of attendance is the


scope of the topic.

 The scope itself expresses the nature and its


importance of the subject concerned to its project
showing the essence of the topic.

 This project gives report on a student attendance


for each month.

 It contains the information about the student


name (last name, first name) ,ID number,
number of days present, total number of working
days and percentage which will be updated for
every month.
In scope:

 There is no limit for the number of students we


consider.

 Only number of days present is considered in this


project but not the number of days absent.

 A new student can be added in between to the list


of students.

Out of scope:
 We can’t exit the project directly in between.

 This project does not include deletion of a


particular student’s data after it is included.
Overview

“Overview is the conclusion of the overall topic


which evaluates the prominence of the student’s
attendance”

This project contains four different options


each having its own eminence. “Overview is the
conclusion of the overall topic which evaluates the
prominence of the student’s attendance”. It is a
combined structure of introduction, scope, in scope
and out scope covering student’s attendance focusing
with prominence of attendance which moulds student
with discipline and progressive development with a
conduct of best student.

 Attendance is calculated in percentage for each


month with total number of working days and
number of days present of a particular student in
that month.

 It produces the list which includes days attended


and total number of days present and it produces a
listing of percentage at the end of the list.
 We enter student details and store them in a
particular file and then the file is opened in read
mode to display those details.

 Attendance of all the students are also entered


along with the details and by choosing the
option “view the attendance”, attendance of
all the students can be viewed at a time.
Use case scenarios:
Some of the important use cases of this project are as
follows

1) Enter the attendance:

 This is the most important segment of the


student’s attendance that covers maximum
and detailed information of the student.

 As the user selects this option the output


screen with the name of the student(last
name, first name),ID number, total number
of working days, and number of days
present will be asked and information is
stored in the file.

2) Add new student information:

As the user selects this option ID number,


name and attendance will be asked and
these details will be added to the student
details file.
3) View the attendance:

Student attendance can be viewed one at


a time or all togeather.it displays the final output of
the project with ID number, name, total number of
working days, number of days present and the
percentage.

4) Exit:
If the user wants to exit from the project he/she will
use this option.

After completing 1 option would you like to


continue will be displayed and waits for the users
choice.
Code:
#include <stdio.h>
#include <iostream>
#include<conio.h>
struct stdtdata
{
int stnum;
char lastname[12];
char firstname[10];
float balance;
float total;
};
int enterchoice(void);
void updaterecord();
void newrecord(FILE *fptr);
void read();

void mainmenu()
{
printf("\t\t\t\t WELCOME\n");
printf("\t\t GLAD THAT YOU ARE READY TO USE OUR
SOFTWARE\n\n");
printf("\t\t\t MAIN MENU \t\t\t\n");
printf("\t\t\t 1) Enter the attendance:\n");
printf("\t\t\t 2) Add new student information: \n");
printf("\t\t\t 3) View the attendance\n");
printf("\t\t\t 4) EXIT\n");
printf("enter choice:");
}
int program()
{
FILE *cfptr;
int choice=0;
char opt='n';
while(choice<5)
{
choice = enterchoice();
switch(choice)
{
case 1:
updaterecord();
break;
case 2:
cfptr=fopen("student.dat","ab+");
newrecord(cfptr);
fclose(cfptr);
break;
case 3:
read();
break;
case 4:
printf("EXIT");
break;
default:
printf("\nInvalid choice\n");
mainmenu();
program();
}
return 0;
}
}
int main(void)
{
mainmenu();
program();
}
void updaterecord()
{
int stdnt;
char opt='y';
double transaction;
double trans;
struct stdtdata student = {0,"","",0.0,0.0};
FILE *fptr;
while (opt=='y')
{
fptr=fopen("student.dat","rb+");
printf("Enter student no.to be updated: ");
scanf("%d", &stdnt);
fseek(fptr, (stdnt - 1) * sizeof(struct stdtdata),SEEK_SET);
fread(&student , sizeof(struct stdtdata),1,fptr);
if(student .stnum ==0)
{
printf("given student id does not have any
information.\n\n", stdnt);
}
else
{
printf("%5d%5s%5s%15f%15f\n\n", student.stnum,
student.lastname, student .firstname, student .total,student .balance);

printf("Enter attendance :");


scanf("%lf", &trans);
student .balance=trans;
fseek(fptr, (stdnt -1) * sizeof(struct stdtdata),
SEEK_SET);
fwrite(&student , sizeof(struct stdtdata),1,fptr);
}
fclose(fptr);
printf("do u want to update another record?if yes press y or else
n\n");
scanf("%s",&opt);
if ( opt=='y')
{
updaterecord();
}
else if (opt=='n')
{
mainmenu();
program();
}
else
{
printf("invalid choice press y or n:");
scanf("%s",&opt);
}
}
}
void newrecord(FILE *fptr)
{
char opt;
FILE *cfptr;
struct stdtdata student = {0,"","",0.0};
int stdntnum;
printf("Enter new student number (1-100):");
scanf("%d", &stdntnum);
fseek(fptr, (stdntnum -1) * sizeof( struct stdtdata), SEEK_SET);
fread(&student , sizeof(struct stdtdata), 1, fptr);
if(student .stnum !=0)
{
printf("given student id already contains information.\n\n");
mainmenu();
program();
}

else
{
printf("Enter lastname, firstname, attendance:\n");
scanf("%s%s%f",student .lastname, student .firstname,
&student .balance);
student .stnum = stdntnum;
fseek(fptr, (student .stnum -1) * sizeof(struct stdtdata),
SEEK_SET);
fwrite(&student , sizeof(struct stdtdata), 1, fptr);
printf("do u want to update another new record?if yes press y or
else n\n");
scanf("%s",&opt);
if ( opt=='y')
{
cfptr=fopen("student.dat","ab+");
newrecord(cfptr);
fclose(cfptr);
}
else if (opt=='n')
{
mainmenu();
program();
}
else
{
printf("invalid choice press y or n:");
scanf("%s",&opt);
}

}
}
int enterchoice()
{
int menuchoice;

scanf("%d", &menuchoice);
return menuchoice;
}
void read()
{
float percentage;
FILE *readptr;
struct stdtdata student ;
readptr = fopen("student.dat", "rb+");
if (readptr == NULL)
{
printf("\nCannot open file");
}
else
{
printf("\ncan read the file\n");
printf("id lastname firstname Workingdays
Attendance Percentage\n");
while(!feof(readptr))
{
int i=fread(&student , sizeof(struct stdtdata),1, readptr);
percentage=(student.balance/student.total)*100;
if(i==1)
{

printf("%-6d%-16s %-11s%10.2f%10.2f %10.2f\n\n",


student .stnum, student .lastname, student .firstname,student .total, student
.balance,percentage);
}
}
}
fclose(readptr);

Code for which student details are created:

#include <stdio.h>
#include <conio.h>
struct clientdata
{
int stnum;
char lastname[12];
char firstname[10];
float balance;
float total;
};
void main()
{
printf("\nin textfile");
FILE *writeptr;
int i=1;
struct clientdata client = {0,"shalini","5030",0.0};
writeptr = fopen("student.dat", "wb");
if ( writeptr == NULL)
{
printf("\nCannot open the file.");
}
else
{
printf("Enter no. of working days:");
scanf("%f",&client.total);
while(i==1)
{
printf("\nENter student id #:");
scanf("%d",&client.stnum);
printf("\nEnter Last Name:");
scanf("%s",&client.lastname);
printf("\nEnter First Name:");
scanf("%s",&client.firstname);
printf("\nEnter attendance:");
scanf("%f",&client.balance);
fseek(writeptr, (client.stnum -1) * sizeof(struct clientdata),
SEEK_SET);
fwrite(&client, sizeof(struct clientdata),1,writeptr);
printf("do u want to enter one more record yes=1, no=0");
scanf("%d",&i);
}
}
fclose(writeptr);
}

You might also like