Unix-Programming-Practice-Commands-Programs
Unix and Shell Programming Textbook
Unix Programming Lab R16
Student Report Card System Project in C++
Student Report Card System
About Student Report Card System:
File handling has been used for the effective implementation of all the typical features of this project. The key features of Student Report Card System are:
1. Create student report card record: This feature creates a new student record containing his marks. For this the information to be provided are the name and roll no. of the student, and the marks obtained by him/her in 5 subjects – Physics, Chemistry, Maths, English and Computer Science.
2. Read all students report card record: The void display_all() function in this student report card system project in C++ has been used for this feature. It basically shows the progress report of all the students added in file. This feature displays the roll no. and name of all the students, the marks obtained by them in 5 subjects – Physics, Chemistry, Maths, English and Computer Science, along with the percentage and grade of each student.
3. Read specific student’s report card record: This feature is same as the one explained above, except it shows the progress report and relevant data related to a particular student.
4. Display all students’ grade report: This feature enlists all the students’ record saved in file. The grade report is displayed in a tabular form with roll no. and name of the students, marks achieved in the five subjects, and the grade and percentage obtained by them.
5. Modify student’s report card record: In student report card system project in C++, this feature is used to edit the report card record of a particular student. For this, the name and roll no. of the student is sought. Upon successful modification, the program displays the message “Record Updated”. If no record of student is found in file, it displays the message “Record not found”.
6. Delete student record: This feature deletes the report card record of a particular student; it first of all asks for the name and roll no. of the student whose record is to be deleted.
Header Files Used:
Student report card system is a very simple project that runs with just five header files. The conio.h header file is required to compile the source code in Turbo C++; it is not required in Code::Blocks . Also, in order to make the project simple and easy to understand and analyze, graphics has not been used in this project. Here, are the header files required for this project:
- #include<conio.h>
- #include<stdio.h>
- #include<process.h>
- #include<fstream.h>
- #include<iomanip.h>
I hope this simple student report card system project in C++ will help you as a reference project to your own C++ college project. Try analyzing the source code of this project to create a new project of your own. Submitting this as your college project with little or no editing at all is complete discouraged.
Student Report Card System Project in C++
JNTUK R19 OBJECT ORIENTED PROGRAMMING THROUGH C++
WT LAB MANUAL R16
WEB TECHNOLOGY R16 UNIT-4 UNIT-5 and UNIT-6
Inheritance in C++
- Public mode: If we derive a sub class from a public base class. Then the public member of the base class will become public in the derived class and protected members of the base class will become protected in derived class.
- Protected mode: If we derive a sub class from a Protected base class. Then both public member and protected members of the base class will become protected in derived class.
- Private mode: If we derive a sub class from a Private base class. Then both public member and protected members of the base class will become Private in derived class.
- Code can be reused.
- The derived class can also extend the properties of base class to generate more dominant objects.
- The same base class is used for more derived classes.
- When a class is derived from more than one class, the derived classes have similar properties to those of base classes.
- Complicated.
- Invoking member functions creates overhead to the compiler.
- In class hierarchy, various data elements remains unused, and the memory allocated to them is not utilized.
-> The old class is reffered to as "Base class" or "Parent class" or "super class".
-> The new class is reffered to as "Derived class" or "child class" or "sub class".
-> A derived class with only one base class, is known as single inheritance.
-> When a single class is derived from a single parent class, it is called Single inheritance. It is the simplest of all inheritance.
For example,
-> Car is derived from vehicle
-> Typist is derived from staff
-> Animal is derived from living things
Syntax of Single Inheritance-
output:-
#include<iostream>
input/output:-
*In this type of inheritance, a derived class is created from another derived class.
*If a class is derived from another derived class then it is called multilevel inheritance. So in C++ multilevel inheritance, a class has more than one parent class.
For example, if we take animals as a base class then mammals are the derived class which has features of animals and then humans are the also derived class that is derived from sub-class mammals which inherit all the features of mammals.
*A diagram that demonstrates multilevel inheritance is given below
// cpp program on multilevel inheritance.
#include<iostream>
using namespace std;
class student
{
protected:
int roll_number;
void getnumber(int a)
{
roll_number=a;
cout<<"roll number:"<<roll_number<<"\n";
}
class test :public student
{
protected:
float sub1,sub2;
void getmarks(float x,float y)
sub1=x;
void putmarks();
void test ::putmarks()
{
cout<<"marks in sub1="<<sub1<<"\n";
cout<<"marks in sub2="<<sub2<<"\n";
}
class result :public test
float total;
public:
void display()
total=sub1+sub2;
putmarks();
cout<<"total="<<total<<"\n";
};
int main()
{
result r;
r.getnumber(1);
r.getmarks(55,77);
r.display();
return 0;
output:-
roll number:1
marks in sub1=55
marks in sub2=77
total=132
1.) Civil, Computer, Mechanical, Electrical are derived from Engineer.
2.) Natural language, Programming language are derived from Language.
3.) Physics, Chemistry, Biology are derived from Science class.
Example of Hierarchical Inheritance in C++:-
// cpp program on hierarchical inheritance
#include<iostream>
using namespace std;
class A
{
public:
void show()
{
cout<<"show called..";
}
};
class B: public A
{
public:
void display()
{
cout<<"display called..";
}
};
class C: public A
{
public:
void output()
{
cout<<"output called..";
}
};
int main()
{
B b;
C c;
b.display();
b.show();
c.output();
c.show();
return 0;
}
INPUT/OUTPUT:-
display called..show called..output called..show called..
What is Hybrid ?
Here is a simple program to illustrate the concept of hybrid inheritance in C++.
-> An ambiguity can arise when several paths exist to a class from the same base class. This means that a child class could have duplicate sets of members inherited from a single base class.
-> C++ solves this issue by introducing a virtual base class. When a class is made virtual, necessary care is taken so that the duplication is avoided regardless of the number of paths that exist to the child class.
What is Virtual base class? Explain its uses.
-> When two or more objects are derived from a common base class, we can prevent multiple copies of the base class being present in an object derived from those objects by declaring the base class as virtual when it is being inherited. Such a base class is known as virtual base class. This can be achieved by preceding the base class’ name with the word virtual.
-> The virtual base class is used when a derived class has multiple copies of the base class.
// C++ program on multipath inheritance using virtual base class.
using namespace std;
class A
{
public:
void showA()
{
cout<<"showA"<<" ";
}
};
class B: public virtual A
{
public:
void showB()
{
cout<<"showB"<<" ";
}
};
class C: public virtual A
{
public:
void showC()
{
cout<<"showC"<<" ";
}
};
class D: public B, public C
{
public:
void showD()
{
cout<<"showD";
}
};
int main()
{
D d;
d.showA();
d.showB();
d.showC();
d.showD();
return 0;
}
OUTPUT:
showA showB showC showD
Inheritance in C++
File Uploading in PHP
File Uploading in PHP PHP allow you to upload any type of a file i.e. image, binary or text files.etc..,PHP has one in built global variab...