01 Program

  • Uploaded by: Class 12 A
  • 0
  • 0
  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View 01 Program as PDF for free.

More details

  • Words: 132
  • Pages: 1
#include #include class STUDENT{ //class declaration, definition int roll_no, marks[5]; char name[20], class_st[8]; float percentage; float calculate(); public: void readmarks(); void displaymarks(); }; void STUDENT::readmarks() //function to accept details { cout<<"Enter roll number, name and class of a student:\n"; cin>>roll_no>>name>>class_st; cout<<"\nEnter marks in Computer,Physics,Maths,Chemistry and English:\n"; for(int i=0; i<5; i++) cin>>marks[i]; //accepting marks into an array percentage=calculate(); } float STUDENT::calculate() //calculating percentage { float s=0.0; for(int i=0; i<5; i++) s=s+marks[i]; return s/5; //returning percentage } void STUDENT::displaymarks() //function to display details { cout<<"\nRoll number: "<
//main function //creating object of class STUDENT //calling member functions

Related Documents

01 Program
November 2019 15
Program
May 2020 25
Program
October 2019 41
Program
June 2020 15
Program
July 2020 18

More Documents from ""

08 Output
November 2019 18
02 Program
November 2019 20
05 Program
November 2019 14
01 Program
November 2019 15
04 Program
November 2019 19
03 Program
November 2019 8