Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
35 views

Write A C++ Program To Display The Student Data L

Bsc lab programs

Uploaded by

srigopi1415
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

Write A C++ Program To Display The Student Data L

Bsc lab programs

Uploaded by

srigopi1415
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

66 ' )

Navigation . / - , ( 7

$ Mar 28 2018
Computer Science Programming
MCQ

Smart Code

For YOU
Home ! Classes ! Write a C++ program to display the student
data like name, roll-no, total marks and percentage with the help
of a class.

Write A C++ Program To


Display The Student
Data Like Name, Roll-No,
Total Marks And
Percentage With The
Help Of A Class.
$ At October 30, 2017 % Classes,

Write a C++ program to display the


student data like name, roll-no, total
marks and percentage with the help of
a class.

Program Code:
#include <iostream>
using namespace std;
class student
{

private:
char name[30];
int rollNo;
int total;
float perc;
public:
//member function to input student's details
from user
void getdata()
{
cout << "Enter name: " ;
cin >> name;
cout << "Enter roll number: ";
cin >> rollNo;
cout << "Enter total marks out of 700: ";
cin >> total;
perc=(float)total/700*100;
}
//member function to display student's
details
void putdata()
{
cout << "Student details:";
cout<<endl;
cout << "Name of student :"<< name;
cout<<endl;
cout<< "Roll Number of student :" << rollNo;
cout<<endl;
cout<< "Total marks of student :" << total;
cout<<endl;
cout<< "Percentage of student :" << perc;
}
};
int main()
{
//object declaration of class student
student obj;
obj.getdata();
obj.putdata();
return 0;
}

The program code is tested on


www.jdoodle.com
Output:
Enter name: Mukesh
Enter roll number: 102
Enter total marks out of 700: 500
Student Detail:
Name of student : Mukesh

Roll Number of student : 102


Total marks of student : 700
Percentage of student : 71.42

Thanks
Mukesh Rajput

& Classes

Share To:

' ( ) * + , -

Next
" C++ program to demonstrate example of friend
function with class.

Previous
Write a C++ program which calculate addition of two
number with the help of class. #

Mukesh Rajput
I am a Computer Engineer, a small
amount of the programming tips as it’s
my hobby, I love to travel and meet
people so little about travel, a fashion
lover and love to eat food, I am investing a good time to
keep the body fit so little about fitness also..

( ' . /

RELATED ARTICLES

Blogger Disqus Facebook

1 comments:

Unknown $ 12 March 2022 at 20:44


Write A C++ Program To Display The Student Data
Like Name, Roll-No, Total Marks And Percentage With The
Help Of A Class. - Smart Code For You >>>>> Download
Now

>>>>> Download Full

Write A C++ Program To Display The Student Data Like


Name, Roll-No, Total Marks And Percentage With The Help
Of A Class. - Smart Code For You >>>>> Download LINK

>>>>> Download Now

Write A C++ Program To Display The Student Data Like


Name, Roll-No, Total Marks And Percentage With The Help
Of A Class. - Smart Code For You >>>>> Download Full

>>>>> Download LINK


Reply 8

To leave a comment, click the button below to


sign in with Google.

SIGN IN WITH GOOGLE

0 RECENT 1 POPULAR 2 COMMENT

The Most Popular Coding Challenge


Websites For 2018
$ Apr 26 2018 3 Anonymous

Best Online Resources To Practice C++


$ Apr 21 2018 3 Anonymous

PortoCafe PLX Edition-PC Like Experience


(White)
$ Mar 30 2018 3 Anonymous

CATEGORIES

4 Arrays

4 Classes

4 Computer Science MCQ

4 Files Programing

4 Functions

4 Home

4 Looping

4 Pointers

4 Sorting

4 Strings

4 Structure

LIKE US ON FACEBOOK

Copyright © 2017-2018. Smart Code For YOU All Rights Reserved.


Developed by Digital Education

You might also like