Java Mini Project in 2nd Year End
Java Mini Project in 2nd Year End
by
Batch -A1
P.Chandini(21JG1A0592)
DepartmentofComputerScienceandEngineering
GAYATRIVIDYAPARISHADCOLLEGEOFENGINEERINGFORWOMEN
[ApprovedbyAICTENEWDELHI,AffiliatedtoJNTUKKakinada]
[Accredited by National Board of Accreditation (NBA) for B.Tech. CSE, ECE & IT – Valid from 2019-20 to 2021-22]
Kommadi ,Madhurawada,Visakhapatnam–530048
2022–2023
GAYATRI VIDYA PARISHAD COLLEGE OF ENGINEERING FOR WOMEN
CERTIFICATE
P.Chandini(21JG1A0592)
The satisfaction that accompanies the successful completion of any task would be incomplete
without the mention of people who made it possible and whose constant guidance and encouragement
crown all the efforts with success.
We would like to extend our heartfelt gratitude and a sincere thanks to Prof. PS Avadhani,
Professor, Department of CSE, GVPCEW, former Director IIIT Agartala,former Principal AU College
of Engineering(A), Andhra University Visakhapatnam, Senior ProfessorDepartment of CSSE College of
Engineering(A), Andhra University , for his valuable guidance and providing necessary help whenever
needed.
We feel elated to extend our sincere gratitude to Mentors Name, Assistant Professor for
encouragement all the way during analysis of the project. His annotations, insinuations and criticisms
are the key behind the successful completion of the thesis and for providing us all the required facilities.
We express our deep sense of gratitude and thanks to Dr. P. V. S. Lakshmi Jagadamba,
Professor and Head of the Department of Computer Science and Engineering for her guidance and for
expressing her valuable and grateful opinions in the project for its development and for providing lab
sessions and extra hours to complete the project.
We would like to take this opportunity to express our profound sense of gratitude to Vice Principal, Dr.
G. Sudheer for allowing us to utilize the college resources thereby facilitating the successful
completion of our project. We are also thankful to both teaching and non-teaching faculty of the
Department of Computer Science and Engineering for giving valuable suggestions for our project.
We would like to take the opportunity to express our profound sense of gratitude to the revered
Principal, Dr. R. K. Goswami for all the help and support towards the successful completion of our
project.
TABLEOFCONTENTS
TOPICS
PAGENO.
Abstract
i
1 INTRODUCTION 1
1.1Problem Statement 1
2. RELATED WORK 4
3. ANALYSIS 8
3.1SoftwareRequirementSpecification 8
3.2 System requirements
3.2.1Softwarerequirements 8
3.2.2Hardwarerequirements 10
4. DESIGN 17
4.1Introduction 17
4.2UMLdiagrams 18
4.2.1 Usecasediagram 18
4.2.2Class diagram 19
4.2.3Sequence diagram 21
4.2.4 Activity diagram
5. METHODOLOGY
5.1 Packages used
5.2 Concepts used
6. IMPLEMENTATIONAND CODE 26
7. RESULTS
7.1OutputScreens 96
8. TESTING 106
8.1Introduction 106
8.2TypesofTesting 107
8.3 Test Cases(Min 3) 109
9. CONCLUSION 105
10. REFERENCES 111
Abstract
A student directory system is a computer-based software application designed to
manage and store information about students, faculty members, and staff in
educational institutions. The system provides a centralized platform for
managing student records, including personal and contact information,
enrollment details, academic performance, and other relevant data.
The system allows authorized users to access and update student records,
generate reports, and perform various administrative tasks. It also enables
communication between students, faculty members, and staff through
messaging and notifications.
3.ANALYSIS
3.1SoftwareRequirementSpecification:-
SOFTWAREREQUIREMENTS SPECIFICATION (SRS) FOR STATES
GEOGRAPHICALINFORMATION SYSTEM:
1.Purpose:
The purpose of the program, which is to manage a student record system.
2.Scope:
The scope of the program, which is to create, edit, search, and display
student records.
3.Functional Requirements:
The program should be able to perform the following functions:
**Add a new student record Edit an existing student record.
**Search for a student record by roll number.
**Display the details of a particular student record
4.Non-functional Requirements:
**The program should be user-friendly and easy to use.
**The program should be efficient and perform operations quickly.
**The program should be reliable and not crash or cause data loss.
**The program should be able to handle up to 50 student records
5.Constraints:
**The program must be developed using C++ programming language
**The program must be able to run on a Windows operating system
3.2 System requirements:
3.2.1Software requirements:
C++ Compiler:
To run the code, a C++ compiler must be installed on the system. The code
appears to be written in C++ language, so a compiler like GCC, Visual Studio,
or Clang could be used.
Operating System:
The code can run on any operating system that supports a C++ compiler, such
as Windows, Mac OS, or Linux.
Library dependencies:
The code includes several standard C++ libraries, including iostream, string,
and conio.h. These libraries should be available with most C++ compilers.
User input interface:
The code uses the console for input and output, so a console interface is
required to interact with the program.
Additional libraries:
The code uses a system function to pause execution and clear the console
screen. These functions may be dependent on additional libraries or system
calls.
3.2.2Hardware requirements:
Processor: Any processor capable of running the C++ programming language,
such as an Intel Core i3 or above.
RAM: At least 2 GB of RAM.
Storage: A minimum of 10 MB of free disk space.
Input devices: A keyboard and a mouse or touchpad for input.
Output devices: A monitor or display for output.
4.DESIGN
4.1Introduction:
Include necessary C++ libraries: Iostream, string, conio, and stdlib.
Declare global variables: ts (total number of students), rec (array of students'
records).
Defining a struct named "student" that contains the following fields:
rollno, name, fname, mname, cell, and address.
Defining function prototypes for the following functions:
*show_data(int searchkey): displays the information of a specific student
*get_data(int i): prompts the user to enter data for a new student record
*search_student(int searchkey): searches for a student with the given
roll no. and displays the information of the student.
*add_student(): allows the user to add a new student record.
*edit_student(int idnumber): allows the user to edit an existing student record.
4.2 UMLdiagrams:
5.METHODOLOGY
5.1 Packages used:
*The code doesn't use any external packages.
*It uses standard C++ libraries such as iostream, string, conio.h, and stdlib.h.
5.2 Concepts used:
1.structs: The code defines a struct data type named student to store
information about individual students.
2.Arrays: An array of student objects is defined to store the data for all the
students.
Functions: The code defines several functions to perform different operations,
such as adding, editing, and searching for students.
Control flow statements: The code uses control flow statements such as if and
switch to control the execution flow based on user input.
File Input/Output: The code does not include any file I/O operations, but it
could be extended to read and write student data to a file.
User Input Validation: The code includes some basic input validation to
ensure that the user enters valid data.
Recursion: The main() function calls itself recursively after the add_student()
function is finished, to allow the user to perform more operations on the student
data.
Pointers: The code does not explicitly use pointers, but the struct data type is
essentially a pointer to a block of memory that holds the data for each student.
#include<string>
#include<conio.h>
#include<stdlib.h>
int main();
void add_student();
void fullscreen();
int ts;
struct student
int rollno;
string name;
string fname;
string mname;
string cell;
string address;
};
student rec[50];
int main()
int choice;
int idnumber;
int searchkey;
cin>>ts;
while(ts--)
cout<<"\t\t----------------------"<<endl;
cout<<"\t\t1-Add student"<<endl;
cout<<"\t\t2-Edit student"<<endl;
cout<<"\t\t3-Search student"<<endl;
cout<<"\t\t4-Quit Program"<<endl;
cout<<"\t\t----------------------"<<endl;
cin>>choice;
switch(choice)
case 1:
add_student();
break;
case 2:
if(rec[0].rollno==0)
system("pause");
main();
else
{
cout<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
for(int i=0;i<=ts;i++)
show_data(i);
cout<<"--------------------------------------------------------------------------------"<<endl;
cin>>idnumber;
if(idnumber>ts || idnumber<0)
cout<<"\nInvalid ID Number."<<endl;
else
edit_student(idnumber);
break;
case 3:
if(rec[0].rollno==0)
{
cout<<"Please Add sudents first."<<endl;
system("pause");
main();
else
cin>>searchkey;
search_student(searchkey);}
break;
case 4:
return 0;
break;
default:
cout<<"Invalid number."<<endl;
system("pause");
main();
return 0;
void get_data(int i)
cin>>rec[i].rollno;
cin>>rec[i].name;
cin>>rec[i].fname;
cout<<"Enter student's Mother name: ";
cin>>rec[i].mname;
cin>>rec[i].cell;
cin>>rec[i].address;
int i=searchkey;
cout<<i<<" ";
cout<<rec[i].rollno<<" ";
cout<<rec[i].name<<" ";
cout<<rec[i].fname<<"\t";
cout<<rec[i].mname<<"\t";
cout<<rec[i].cell<<" ";
cout<<rec[i].address<<"\n\n";
for(int i=0;i<=ts;i++)
if(rec[i].rollno==searchkey)
show_data(i);
}
void add_student()
for(int i=0;i<=ts;i++)
get_data(i);
system("CLS");
cout<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
for(int i=0;i<=ts;i++)
show_data(i);
cout<<"--------------------------------------------------------------------------------"<<endl;
cout<<"---------------------------------FINISH-----------------------------------------"<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
system("pause");
main();
for(int i=0;i<=ts;i++)
{
if(idnumber==i)
cout<<"--------------------------------------------------------------------------------"<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
show_data(i);
get_data(i);
system("pause");
main();
Output
1.Add student:
2.Edit student:
3.Search student:
2.In c program:
#include<stdio.h>
#include<math.h>
#include<string.h>
#include<stdlib.h>
int i = 0;
int j=0;
int k;
struct studentInfo
char name[20];
char mothername[20];
char fathername[100];
int rollNumber;
char address[20];
char mobile[20];
char branch[20];
} st[500];
void addStudent()
scanf("%s", st[i].name);
scanf("%s", st[i].fathername);
scanf("%s", st[i].mothername);
scanf("%d", &st[i].rollNumber);
scanf("%s", &st[i].address);
scanf("%s", &st[i].mobile);
scanf("%s", &st[i].branch);
i=i+1;
void searchByRollNumber()
{
int temp;
scanf("%d", &temp);
if (temp == st[j].rollNumber)
printf("address is %s\n",st[j].address);
printf("branch is %s\n",st[j].branch);
void totalCount()
void deleteStudent()
int temp;
scanf("%d", &temp);
if (temp == st[j].rollNumber)
i--;
void updateStudent()
int temp;
scanf("%d", &temp);
if (temp == st[j].rollNumber)
printf("1. Name\n"
"4. address\n"
"5. mobile\n"
"6. branch\n");
int c;
scanf("%d", &c);
switch(c)
case 1:
scanf("%s", st[j].name);
break;
case 2:
scanf("%s", st[j].fathername);
break;
case 3:
scanf("%s", st[j].mothername);
break;
case 4:
scanf("%d", st[j].rollNumber);
break;
case 5:
scanf("%s", st[j].address);
break;
case 6:
scanf("%s", st[j].branch);
break;
case 7:
scanf("%s", st[j].mobile);
break;
void view(){
printf("view the details\n");
for(j=0;j<i;j++){
printf("\n%7d%12s%22s%22s%12s%12s%9d
%22s",j+1,st[j].name,st[j].fathername,st[j].mothername,st[j].address,st[j].mobile,st[j].rollNumber,st[
j].branch);
int main()
int taskToPerform;
while (1)
printf("7. Exit\n");
scanf("%d", &taskToPerform);
switch (taskToPerform)
case 1:
addStudent();
break;
case 2:
searchByRollNumber();
break;
case 3:
totalCount();
break;
case 4:
deleteStudent();
break;
case 5:
updateStudent();
break;
case 6:
view();
break;
case 7:
exit(0);
break;
default:
exit(0);
return 0;
Output:
Add student:
Search student:
Total students:
Update student:
Delete student record:
Exit: