Posts

Showing posts from May 12, 2019

PROGRAMMING USING CLASS

Image
Program #include <iostream> #include <string> #include<windows.h> using namespace std; int g=1,l,f=4,n=0; float sum=0; class Student {    int con,sem;     char name[50],DOB[50],section[50]; float gpa; public: void getName() { cin.ignore(); cin.getline(name,50); } void getgpa() { cin >> gpa; } void getDOB() { cin.ignore(); cin.getline(DOB,50); } void getsec() { cin >> section; } void getcon() { cin >> con; } void getsem() { cin >>sem; } void getdata(int k){ cout<<k<<"\t\t"<<name<<"\t\t"<<con<<"\t\t"<<sem<<"\t\t"<<section<<"\t\t"<<gpa<<"\t\t"<<DOB<<endl; } void displayAll() { cout << "Name : " << name << endl; cout << "GPA : " <&