SRM ELAB SOLUTUIONS OOPS
OBJECT ORIENTED PROGRAMING SYSTEM
- Waiting or Not Waiting
- Digits in Words
- Upper case conversion
- Country
- Sachin and his Pills
- Dhoni and Ziva in Chennai
- You and Me ** creativity leads to thinking **
- SRM Calculator **thinking leads to knowledge**
- Legends of Indian Cricket
- Play with XOR
- Professor Omkar
- Swim
- Print Floyd's
- Letter Pattern
- Scientist Game
- Find your Partner
- DATE CLASS
- Online Shopping
- Student Details
- Inner and Outer
- Cricbuzz Library
- Arulmozhivarman and his pets
- TRAI
- Pamban Bridge
- Athithya Karihalan and his Hobby
- Land Survey
- Complex Game
- RBI
- TNEB Billing
- Digital Library Function and Constructor Overloading
- Limka Book of Recodrs
- Saravana Stores
- Smart Appraisal System
- Profit of the Day
- BCD Game
- Database Administrator
- Buisness Man
- Olympic Gold for India
- CUB
- Anti-Proxy Attendance
- Efficiency of Car
- SRM Admission
- Store Keeper
- Dhoni the CEO
- Fill Water
- Hospital Bill Operator Overloading
- Light House
- Decimal Decrement
- Compare Distance
- Prefix Increment
- Concatenate
- Decimal Increment
- Copy
- Ice Cream Seller
- First Day of College
- Savings
- Operator!
- Distance
- Play with Fraction
- Travel
- Compare Distance Inheritance
- Examination
- Multilevel Inheritance for Student Marklist
- Payroll
- Counselling
- Rectangle
- Student and Sports
- Single Level Inheritance - Rectangle
- Payslip Generation
- Square and cube
- Cost of Pen
- Programmer Information
- Percentage of Student
- Bio
- Interface for Rectangle
- Abstract Class Virtual Function and Friend Function
- Jaganath and his Juniours
- Polio
- Engineering Counselling
- Shape and Measurements
- Numbers
- Difference Problem
- Friends in Maths tutuion
- Measure the Area
- Multiples
- Super Market
- Jadeja and Googly
- Kajal and her Shopping
- ONGC
- Varun and his Students
- District Sports Meet
- 7. Templates
- Division
- Swap
- Product of numbers
- Largest of Long
- Adding Numbers
- Minimum of given elements (Banglore)
- Subtraction
- Adding Array
- Sum of Numbers
- Largest Number 9. STL
- Address Map
- Play with Permutations
- Vector Iterator
- My Pair
- Remove Duplicate **DS will be updated soon **
- Balancing
- Programmer
- Sort Game
- Vector to Heap
- Play with Streams
- Sets
- Deque
- Swapping two Functions 8.Exceptional Handling
- Calculation
- Divide by zero exception
- Checking Valid Data
- User defined Exception - Division
- Finding Alphabets
- Multiple Exception - Default Exception
- Palindrome
- Reverse - Array Exceptions
- Factorial
- Exceptional - Operator Checking
- Check input
- Relational Operators - Exceptional Handling
- Vowels - Consonants Exceptional Handling 10. IO Streams
- IOST9
- IOST3
- IOST2
- IOST15 ***if u didnt get any program***
- IOST11 ***place it in comment section***
- IOST16
- IOST17
- IOST7
- IOST9
- IOST13
- IOST6
- IOST18
- IOST5
- IOST12
- IOST10
- IOST19
- IOST14
good job
ReplyDeletehey RAM are you going home for this dussehra?
Deletethe progrms are not showing any %
ReplyDeletewhich problem did u don't get any %
DeleteSESSION: Classes Functions and Constructors
DeleteQ. 12: Bhagavan the Inspirational Teacher
QUESTION DESCRIPTION
Bhagavan the Government school teacher from Karur district is so involved with his students development which in turn even forced the Tamilnadu Educational department to cancel his transfer from his old school on the request of his students.
He is such an inspirational teacher.Now he has been assigned the new set of students from other schools to train them.So before starting the training he wants to collect the personal details from the new student for maintaining the record in his school.
Can you help him to automate his task of collecting student details?
Mandatory:
1.Create a class "student"
2.Create the following datamembers:
a)roll,
b)name,
c)height and
d)weight.
3.Create a DEFAULT CONSTRUCTOR to assign the values to the above data members as follows:
name="Bhagavan"; roll=1593; height=172.5; weight=60.4;
4.Create a member function readinput() to get the values from the above members
5.Create a member function displaydata() to print the information collected from the students.
6.Create two objects s1 and s2.Call the member function readinput() only with s1 and displaydata() with s1 and s2.
Refer sample testcases
TEST CASE 1
INPUT
Manikandan 156 168.5 65.3
OUTPUT
Manikandan 156 168.5 65.3
Bhagavan 1593 172.5 60.4
TEST CASE 2
INPUT
Maheshwaran 157 162.1 68.1
OUTPUT
Maheshwaran 157 162.1 68.1
Bhagavan 1593 172.5 60.4
#include
Deleteusing namespace std;
class Student{
public:
int roll;
string name;
float height,weight;
void readinput();
void displaydata();
Student(){
name = "Bhagavan";
roll = 1593;
height = 172.5;
weight = 60.4;
}
};
void Student::readinput(){
cin>>name>>roll>>height>>weight;
}
void Student::displaydata()
{
cout<<name<<" "<<roll<<" "<<height<<" "<<weight;
}
int main() {
Student s1,s2;
s1.readinput();
s1.displaydata();
cout<<endl;
s2.displaydata();
return 0;
}
its showing error
Deletecomplete the include header file
Delete#include
ReplyDelete#include
using namespace std;
int main() {
int t=2;
while(t)
{ char b[100];
int i=0;
cin.getline(b,30);
cout.write(b,5);
cout<<endl;
t--;
}
return 0;
}
iost11
This comment has been removed by a blog administrator.
DeleteThis comment has been removed by a blog administrator.
ReplyDeletehave fun with bhavageethe
Delete#include
ReplyDeleteusing namespace std;
class salary
{int deftsalary;
public:
salary()
{deftsalary=10000;
cout<>Testclass;
salary myobj2(Testclass);
return 0;
}
Function and Constructor Overloading :: Dhoni the CEO
#include
Deleteusing namespace std;
class salary
{int deftsalary;
public:
salary()
{deftsalary=10000;
cout<>Testclass;
salary myobj2(Testclass);
return 0;
}
#include
ReplyDelete#include
using namespace std;
class Student
{
char stuname[20];
public:
Student()
{
cout<<"No Attendance";
}
Student(char name[])
{
strcpy(stuname,name);
}
void display()
{
cout<<"\nHello "<>new_name;
Student stdpst(new_name);
stdpst.display();
return 0;
}
Function and Constructor Overloading: anti-proxy attendance
updated the question check bro
Deletebhavageethe
Deletetest case 8 not working
Deletelimka book of record is giving me 77% evaluation
ReplyDeleteits working bro once again copy and check
Deleteno its not bro
Delete#include
ReplyDeleteusing namespace std;
template
void displayresult(t1 a,t2 b){
cout<>x>>y;
cout<<x<<endl<<y<<endl;
displayresult(x,y);
return 0;
}
for which question bro
Delete#include
ReplyDeleteusing namespace std;
// template function
template
T Large(T n1, T n2)
{
return (n1 > n2) ? n1 : n2;
}
int main()
{
int i1, i2;
float f1, f2;
cin >> i1 >> i2;
cout << Large(i1, i2)<< endl;
cin >> f1 >> f2;
cout << Large(f1, f2);
return 0;
}
for which question bro
Delete#include
ReplyDeleteusing namespace std;
int r1,r2,i1,i2;
class complex{
public:
friend void sum(complex);
void display(){
cout<>r1;
cin>>i1;
cin>>r2;
cin>>i2;
}
int main(){
complex o;
sum(o);
o.display();
return 0;
}
for which question bro
DeleteFunction and Constructor Overloading
ReplyDeleteSrm Admission
Store Keeper
we are trying to find code after getting the code i will publish bro if you get before than me then comment the question name and the program it will use full for other
Deletepls...upload all the programs
ReplyDeleteNeed program for hospital bill......pls upload asap
ReplyDeleteNeed program for hospital bill......pls upload asap
ReplyDeletetrying to get the program if i get i will publish
DeleteI/O Operations:-Scientist Game
ReplyDelete#include
using namespace std;
int main()
{
int origNum, num, rem, sum = 0;
cin >> origNum;
num = origNum;
while(num != 0)
{
rem = num % 10;
sum += rem * rem * rem;
num /= 10;
}
if(sum == origNum)
cout << "Give to Scientist Armstrong";
else
cout<< "Dont Give to Scientist Armstrong";
return 0;
}
Inheritance:Payslip Generation
ReplyDelete#include
using namespace std;
class c1
{
public:
int length, breadth;
c1()
{
cin>>length>>breadth;
}
};
class c2:public c1
{
public:
void area(int length,int breadth)
{
cout<<2*(length+breadth);
}
};
int main() {
c2 one;
one.area(one.length,one.breadth);
return 0;
}
thank you its working
DeleteThis comment has been removed by the author.
ReplyDeleteFILL WATER NEW CODE : 100% WORKING
ReplyDelete#include
using namespace std;
class Box
{
double width,height,depth;
public:
Box()
{
width=0;
height=0;
depth=0;
}
Box(double w, double h, double d)
{
width=w;
height=h;
depth=d;
}
double volume()
{
return width*height*depth;
}
};
int main()
{
Box mybox1;
double a,vol;
cout<>a;
Box mybox2(a,a,a);
vol = mybox2.volume();
cout<<vol;
return 0;
}
ABSTRACT CLASS VIRTUAL FUNCTIONS
ReplyDeleteVARUN AND HIS STUDNETS : #include
using namespace std;
class parent{
public:
virtual float average(int a, int b, int c)=0;
};
class child:public parent{
public:
float average(int a, int b, int c){
return (a+b+c)/3.0f;
}
};
int main() {
parent *p;
child c;
p=&c;
int a,b,d;
cin>>a>>b>>d;
cout << "Average=" << p->average(a,b,d);
return 0;
}
Abstract Class Virtual Function and Friend Function
ReplyDeleteSuper Market
#include
using namespace std;
class consumer
{
public:
virtual void getdata()=0;
virtual void display()=0;
};
class transaction:public consumer
{
public:
char n[100],t[100];
int c,q,p;int tp;
void getdata()
{
cin>>n>>c>>t>>q>>p;
tp=q*p;
}
void display()
{
cout<<"Name : "<<n;
cout<<"\nCode : "<<c;
cout<<"\nTelephone : "<<t;
cout<<"\nQuantity : "<<q;
cout<<"\nPrice : "<<p;
cout<<"\nTotal Price : "<<tp;
}
};
int main()
{
transaction f;
f.getdata();
f.display();
return 0;
}
Abstract Class Virtual Function and Friend Function
ReplyDeleteDifference Problem
#include
using namespace std;
class parent
{
public:
virtual void difference(int a,int b)=0;
};
class child:public parent
{
public:
void difference(int a,int b)
{
cout<<"Difference="<>a>>b;
p->difference(a,b);
return 0;
}
some problem is there bro
DeleteAbstract Class Virtual Function and Friend Function
ReplyDeleteKajal and her Shopping
#include
using namespace std;
class Bill
{
public:
int a,b;
void getamount()
{
cin>>a>>b;
}
friend float billavg(Bill&,int,int);
};
float billavg(Bill& x,int a,int b)
{
float y;
y=(float)(a+b);
return y/2;
}
int main()
{
Bill obj;
obj.getamount();
cout<<"Average amount spent:"<<billavg(obj,obj.a,obj.b);
return 0;
}
Abstract Class Virtual Function and Friend Function
ReplyDeleteDistrict Sports Meet
#include
using namespace std;
class Sports
{
public:
virtual void getdata()=0;
virtual void display()=0;
};
class Student:public Sports
{
public:
int a;
string b;
void getdata()
{
cin>>a>>b;
}
void display()
{
cout<<"Student Name is: "<getdata();
ptr->display();
return 0;
}
some problem is there bro
Deleteiost8 bro
Deleteupload the comment programs also naa
ReplyDeletebhagavan the inspirational teacher
ReplyDelete#include
#include
using namespace std;
class student
{
string name;
double roll,height,weight;
public:
void readinput()
{
cin>>name>>roll>>height>>weight;
}
void displaydata()
{
cout<<name<<" "<<roll<<" "<<height<<" "<<weight<<endl;
}
void display()
{ }
void read()
{ }
student()
{
name="Bhagavan"; roll=1593; height=172.5; weight=60.4;
}
};
int main() {
student s1,s2;
//student s2;
s1.readinput();
s1.displaydata();
s2.displaydata();
s1.read();
s2.display();
return 0;
}
Can someone post Jadeja and googly program form abstract and virtual functions
ReplyDelete#include
Deleteusing namespace std;
class googly{
int num;
public:
void getballnumber(){
cin >> num;
}
friend int isgoogly(googly);
};
int isgoogly(googly g){
if(g.num%2 == 0){
cout << "Not a Googly Ball" << endl;
return 0;
}
cout << "Googly Ball" << endl;
return 1;
}
int main() {
googly e1;
e1.getballnumber();
isgoogly(e1);
return 0;
}
IOST11
ReplyDelete#include
using namespace std;
int main()
{
char in1[30],in2[30];
cin.getline(in1,30);
cin.getline(in2,30);
cout.write(in1,5);
cout<<'\n';
cout.write(in2,5);
return 0;
}
thought to contribute a code here since i didn't find it and used this page to complete the E-Lab, thank you
thank you for using this when ever you open this fuck elab next time please clear the history and open so that i will get views
Deleteplsss upload program for interface for rectangle,district sports meet and unary......
ReplyDeleteplzz give SRM ADMISSION of function and constructor overloading
ReplyDeleteplz upload IOST4,10,5,19
ReplyDeleteplz upload unary and interface for rectangle
ReplyDeletewe are trying to find code after getting the code i will publish bro if you get before than me then comment the question name and the program it will use full for other
Deletepzl upload IOST 14,12,5,8
ReplyDeletePls post IOST 14
ReplyDeletepost IOST 19,8,5,4
ReplyDeleteIOST5,19,12
ReplyDeletewe are trying to find code after getting the code i will publish bro if you get before than me then comment the question name and the program it will use full for other
DeleteNEED IOST1
Deleteplzzz upload IOST4
ReplyDeletewe are trying to find code after getting the code i will publish bro if you get before than me then comment the question name and the program it will use full for other
Deletepls provide solution for IOST14
ReplyDeletesolution for swapping two functions
ReplyDeleteneed this solution please
Deleteanyone upload solution for unary and interface for rectangle and IOST 4 asap.....
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteneed compare 2 strings and no exception in Exception handling
ReplyDeleteneed IOST 10 , IOST 14
ReplyDeleteplz upload inheritance:bank , iost19
ReplyDeletestl:marks and vector , play with sets , exceptional handling:number exceptiion
ReplyDeleteBro there is a problem in deque code bro
ReplyDeletepls check it once.
iost19,iost10,iost14,iost4
ReplyDeleteAdmin bro, pls upload IOST 14 as soon as possible
ReplyDeletewe are trying to find code after getting the code i will publish bro if you get before than me then comment the question name and the program it will use full for other
Deleteiost1,iost14,iost8,iost19 please publish these programs
ReplyDeleteunary-operator overloading
ReplyDeletelength of string,number exception-exceptional handling,
marks and vector,play with set-STL
please upload these programs
we are trying to find code after getting the code i will publish bro if you get before than me then comment the question name and the program it will use full for other
DeleteIOST14, PLAY WITH STREAM, IOST8, IOST19, COMPARE TWO STRINGS
ReplyDeleteplease upload iost 14,iost 19,iost 1 and iost 8 as soon as possible
ReplyDeletePlease post solution for IOST 8
ReplyDelete
Delete#include
using namespace std;
class Time
{
private:
int hour, min;
public:
friend ostream & operator << (ostream &out, const Time &c);
friend istream & operator >> (istream &in, Time &c);
friend void operator>> (Time &hourw, Time &minw);
};
istream & operator >> (istream &in, Time &c)
{
in >> c.hour;
in >> c.min;
return in;
}
ostream & operator << (ostream &out, const Time &c)
{
cout << "dx="<< c.hour << " dy=" << c.min;
return out;
}
int main()
{
Time c1;
cin >> c1;
cout << c1;
return 0;
}
This comment has been removed by the author.
Deleteit will not work it has a problem in the friend void operator>>, it need a space btwn oprtr and >>
Deletethis will work -
#include
using namespace std;
class Time
{
private:
int hour, min;
public:
friend ostream & operator << (ostream &out, const Time &c);
friend istream & operator >> (istream &in, Time &c);
friend void operator >>(Time &hourw, Time &minw);
};
istream & operator>>(istream &in, Time &c)
{
in >> c.hour;
in >> c.min;
return in;
}
ostream & operator << (ostream &out, const Time &c)
{
cout << "dx="<< c.hour << " dy=" << c.min;
return out;
}
int main()
{
Time c1;
cin >> c1;
cout << c1;
return 0;
}
could u please upoad solutions for iost 14,1,19
ReplyDeleteneed iost10 ,iost4 ,number exception in exception handling,and measure the area is not correct
ReplyDeletePlease someone give IOST14
ReplyDeleteIOST1 is missing.Please help
ReplyDelete#include
Delete#include
#include
using namespace std;
int main() {
string a;
getline(cin,a,':');
float f;
cin >> f;
stringstream my_stream(ios::in|ios::out);
my_stream << a;
my_stream.seekg(-7,ios::end);
std::string dat(a);
cout << "I have a double : " << f*f;
return 0;
}
iostream
Deletestring
sstream
Marks and Vector of STL
ReplyDeleteCompare two strings of Exceptional Handling
IOST4, IOST8
Please give the solution for play with set and Marks and vector of STL
ReplyDeleteBhagavan the Inspirational Teacher
ReplyDelete#include
using namespace std;
class student
{
string name;
double roll,height,weight;
public:
void readinput()
{
cin>>name>>roll>>height>>weight;
}
void displaydata()
{
cout<<name<<" "<<roll<<" "<<height<<" "<<weight<<endl;
}
void display()
{ }
void read()
{ }
student()
{
name="Bhagavan"; roll=1593; height=172.5; weight=60.4;
}
};
int main() {
student s1,s2;
//student s2;
s1.readinput();
s1.displaydata();
s2.displaydata();
s1.read();
s2.display();
return 0;
}
error code
Deletecorrect code-
Delete#include iostream
#include string.h
using namespace std;
class student{
int roll;
char name[20];
float height;
float weight;
public:
student()
{
strcpy(name,"Bhagavan");
roll=1593;
height=172.5;
weight=60.4;
}
void readinput()
{cin>>name;
cin>>roll>>height>>weight;
}
void displaydata()
{
cout<<name<<" "<<roll<<" "<<height<<" "<<weight;
}
};
int main() {
student s1,s2;
s1.readinput();
s1.displaydata();
cout<<endl;
s2.displaydata();
return 0;
}
not working
Delete/***marks and vector ***/
ReplyDelete#include
#include
#include
using namespace std;
int main() {
int n,num;
cin>>n;
vector myvector;
for(int i=0;i>num;
myvector.push_back(num);
}
cout<<*min_element(myvector.begin(),myvector.end())<<" ";
cout<<*max_element(myvector.begin(),myvector.end());
return 0;
}
pls bro with header files coz it's not working
Deletewait
Deleteiostream
Deletevector
algorithm
are the header files
It's wrong
Delete/*** iost 8 ***/
ReplyDelete#include
using namespace std;
class demo
{
public:
int dx, dy;
friend void operator >>(demo& d, istream& mycin)
{
// cin assigned to another object mycin
mycin >> d.dx >> d.dy;
}
// operator overloading using friend function
friend void operator<<(demo& d, ostream& mycout)
{
// cout assigned to another object mycout
mycout << "dx="<<d.dx<< " dy="<<d.dy;
}
};
int main()
{
demo d;
// calls operator >> function and
// pass d and cin as reference
operator >> (d, cin) ;//d >> cin; // can also be written as operator >> (d, cin) ;
// calls operator << function and
// pass d and cout as reference
operator << (d, cout) ;//d << cout; // can also be written as operator << (d, cout) ;
}
its wrng 85% only
Delete
Deletethis will work -
#include iostream
using namespace std;
class Time
{
private:
int hour, min;
public:
friend ostream & operator << (ostream &out, const Time &c);
friend istream & operator >> (istream &in, Time &c);
friend void operator >>(Time &hourw, Time &minw);
};
istream & operator>>(istream &in, Time &c)
{
in >> c.hour;
in >> c.min;
return in;
}
ostream & operator << (ostream &out, const Time &c)
{
cout << "dx="<< c.hour << " dy=" << c.min;
return out;
}
int main()
{
Time c1;
cin >> c1;
cout << c1;
return 0;
}
io stream 19 i need it
ReplyDelete#include
Delete#include
using namespace std;
int main()
{
int n,i,k,x=20,c=1;
long double ans,s=1;
cin>>n;
for(i=1;i<=n;i++)
{
ans=s*c;
cout.width(n);
cout.setf(ios::fixed);
cout.precision(0);
cout<<ans<<"\n";
s=ans;
c++;
}
return 0;
}
This comment has been removed by the author.
DeleteIOST 1,14 and 19. please try for these
ReplyDeleteiost 14
ReplyDelete#include
using namespace std;
int main()
{
float n;
float pi;
cin >> n;
int i = 0;
int n1 = n;
while (n > 0)
{
pi=(float)22/7;
cout.precision(n);
cout << pi;
while (i)
{
cout << '*';
i--;
}
i = n1 - n + 1;
n--;
cout << endl;
}
cout << "3" << endl
<< "Fill Setting:*";
return 0;
}
void d()
{
cout.fill('a');
cout.width(10);
}
iost 19
#include
#include
using namespace std;
int main()
{
int n,i,k,x=20,c=1;
long double ans,s=1;
cin>>n;
for(i=1;i<=n;i++)
{
ans=s*c;
cout.width(n);
cout.setf(ios::fixed);
cout.precision(0);
cout<<ans<<"\n";
s=ans;
c++;
}
return 0;
}
iostream
Deletelimits
iost 1 pls
ReplyDeleteThis comment has been removed by the author.
ReplyDeletesomeone please upload solution for the following questions from EXCEPTIONAL HANDLING :
ReplyDeleteCompare two strings
Number exception
Length of String
#include iostream
Delete#include string.h
using namespace std;
int main() {
char ch[10],ch1[10];
cin>>ch>>ch1;
try
{for(int i=0;i48&&ch[i]<57)
throw ch[i];
for(int i=0;i48&&ch1[i]<57)
throw ch1[i];
if(strcmp(ch,ch1)!=0)
cout<<ch<<" is not "<<ch1;
else
cout<<ch<<" is "<<ch1;
}
catch(char ch)
{
cout<<"Invalid input Try again";
}
return 0;
}
compare 2 strings
Deleteerror bro
Deletethis is correct. just remove i48 and run the code
DeleteThis comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
DeleteThis comment has been removed by the author.
DeleteThere is some error in the code
Deletei know that was compare 2 functions from stl
DeletePlease upload Play with Streams, Number Exception using Exceptional Handling and Saravana Stores.
ReplyDeletei have
DeletePlay with Streams
Delete#include iostream
#include set
#include iterator
using namespace std;
int main() {
set ob;
int n;
cin>>n;
int t;
for(int i=0;i>t;
ob.insert(t);
}
cin>>t;
int g=*ob.find(t);
if(g==t)
cout<<"Element "< onj(ob.begin(),ob.end());
set::iterator it;
for(it=ob.begin();it!=ob.end();++it)
{
cout<<*it<<" ";
}
cout<<endl;
cout<<"Size=";
t=ob.size();
cout<<t;
return 0;
}
Saravana Stores
Delete#include iostream
using namespace std;
class Salary
{public:
int Increment(int currsal)
{
}
int Increment(int currsal,int bonus)
{
int x,y;
x=currsal;
y=bonus;
cout<>a>>b;
Salary ob;
//ob.Increment();
ob.Increment(a,b);
return 0;
}
compile time error Play with Streams
Delete#include
ReplyDelete#include
#include
using namespace std;
int main() {
string a;
getline(cin,a,':');
float f;
cin >> f;
stringstream my_stream(ios::in|ios::out);
my_stream << a;
my_stream.seekg(-7,ios::end);
std::string dat(a);
cout << "I have a double : " << f*f;
return 0;
}
iostream
Deletestring
sstream
100% not evaluating.
Deletetest case 2 and 4 are not passing after removing space after : in
cout << "I have a double : " << f*f;
Arulmozhivarman and his pets program pls
ReplyDelete#include
Deleteusing namespace std;
class catanddog
{
public:
int n,i,a,b,c;
void count()
{
cin>>n;
for(i=0;i>a>>b>>c;
if(c==8 || c==4)
cout<<"yes"<<"\n";
else
cout<<"no"<<"\n";
}
}
};
int main()
{
catanddog obj;
obj.count();
return 0;
}
error bro
DeletePlease upload Number Exception using Exceptional Handling
ReplyDeleteiost 4 please
ReplyDeletepls see above i hv commented
DeletePlease upload for compare two strings
ReplyDeletebro see above
DeleteNumber Exception using Exceptional Handling and Arulmozhivarman and his pets program pls else ask any program u will get the ans
ReplyDeletei need iost4,iost19,iost1,remove duplicate,swapping two functions,vowels of exception handling
ReplyDeleteswapping two functions
Delete#include iostream
#include stack
#include vector
#include algorithm
using namespace std;
using std::stack;
using std::reverse;
void showstack(stacki)
{
while (!i.empty())
{
cout << i.top()<<" ";
i.pop();
}
cout << '\n';
}
int main()
{
vectori;
vectorj;
std::stackI;
std::stackJ;
int a,b;
cin>>a;
for(int k=0;k>b;
I.push(b);
}
for(int k=0;k>b;
J.push(b);
}
showstack(J);
showstack(I);
reverse(i.begin(),i.end());
reverse(j.begin(),j.end());
return 0;
}
Bro did you get Swapping two functions code?
DeleteThis comment has been removed by the author.
ReplyDeletebro search above for iost 19, 1, 4
ReplyDeletePlease repost iost4 . I am not able to find it. I checked most of the comments
Deletesee down
DeleteArulmozhivarman and his pets program pls
ReplyDelete#include iostream
Deleteusing namespace std;
class catanddog
{
public:
int n,i,a,b,c;
void count()
{
cin>>n;
for(i=0;i>a>>b>>c;
if(c==8 || c==4)
cout<<"yes"<<"\n";
else
cout<<"no"<<"\n";
}
}
};
int main()
{
catanddog obj;
obj.count();
return 0;
}
cin>>n;
Deletefor(i=0;i>a>>b>>c;
how can this be possible pls rectify it
iost 18, 8
ReplyDeleteiost 18 is already given in the portal
Deleteiost 8 running 100% garantee
#include iostream
using namespace std;
class Time
{
private:
int hour, min;
public:
friend ostream & operator << (ostream &out, const Time &c);
friend istream & operator >> (istream &in, Time &c);
friend void operator >>(Time &hourw, Time &minw);
};
istream & operator>>(istream &in, Time &c)
{
in >> c.hour;
in >> c.min;
return in;
}
ostream & operator << (ostream &out, const Time &c)
{
cout << "dx="<< c.hour << " dy=" << c.min;
return out;
}
int main()
{
Time c1;
cin >> c1;
cout << c1;
return 0;
}/*
//***2nd method***
#include
using namespace std;
class demo
{
public:
int dx, dy;
friend void operator >>(demo& d, istream& mycin)
{
// cin assigned to another object mycin
mycin >> d.dx >> d.dy;
}
// operator overloading using friend function
friend void operator<<(demo& d, ostream& mycout)
{
// cout assigned to another object mycout
mycout << "dx="<<d.dx<< " dy="<<d.dy;
}
};
int main()
{
demo d;
// calls operator >> function and
// pass d and cin as reference
operator >> (d, cin) ;//d >> cin; // can also be written as operator >> (d, cin) ;
// calls operator << function and
// pass d and cout as reference
operator << (d, cout) ;//d << cout; // can also be written as operator << (d, cout) ;
} */
Please IOST4
ReplyDelete#include iostream
Deleteusing namespace std;
int main()
{
char ch;
while(cin.get(ch))
{
while(cin.peek()=='#')
{
cin.ignore(1,'#');
}
cout<<ch;
}
return 0;
}
find me this pls Arulmozhivarman and his pets
Delete#include
Deleteusing namespace std;
class catanddog
{int C,D,L;
public:
void count()
{cin>>C>>D>>L;
if(L%4==0&&D+C>=L/4)
cout<<"yes"<>T;
for(int i=0;i<T;i++)
obj.count();
return 0;
}
Arulmozhivarman and his pets code
Delete//iost10
ReplyDelete#include
#include
using namespace std;
int main() {
char x[50];int a;
cin.getline(x,50);
cout<<"Your string is :"<<x<<endl;
for(a=0;a<=strlen(x);a++)
{cout.write(x,a);cout<<endl;}
return 0;
}
bro plz send length of string,sets,marks and vector,and vector iterator
ReplyDeleteand also play with sets
ReplyDeleteplease upload Play with Streams with 100% evaluation.
ReplyDeleteMarks and vector ,play with sets...can anyone send this two plz??
ReplyDeleteCan somebody give the program for "Swapping two Functions"?
ReplyDeleteThis comment has been removed by the author.
ReplyDeletePlay with fraction (code in blogspot doesnt give 100%) - Operator Overloading
ReplyDeleteMarks and Vector - STL
Play with Set - STL
:)
pls upload unary,athithya karikalan and his hobby,compare two strings,swapping two functions and play with set asap.....
ReplyDeletelength of the string
ReplyDeleteIOST4
ReplyDeleteIOST8
NEEDED BRO...
IOST14,IOST19,IOST1,IOST4
ReplyDeletepls upload these.....
IOST 4 is not there
ReplyDeleteIOST 10
ReplyDeleteIOST 19
ReplyDeleteplease upload limka book of records in function and constructor overloading
ReplyDeletePLEASE UPLOAD IOST 8
ReplyDeleteplease upload IOST 10 AND IOST 1 / COMPARE TWO STRINGS / SWAPPING OF TWO FUNCTIONS / NUMBER EXPECTION / UNARY / BANK
ReplyDelete//IOST 10
Delete#include
#include
using namespace std;
int main() {
char x[256];
int a,b;
cin.getline(x,256);
cout<<"Your string is :"<<x<<"\n";
for(a=0;a<=strlen(x);a++)
{
cout.write(x,a);
cout<<"\n";
}
return 0;
}
This comment has been removed by the author.
ReplyDeletebro plsssssss repost .. 'IOST 4' and 'marks and vector'
ReplyDeletebro marks and vector(the above one you sent isnt working)
ReplyDeleteArulmozhivarman and his pets code
ReplyDelete#include iostream
using namespace std;
struct cd
{ int c,d,l;
};
class catanddog
{ public:
cd d[100];
int i,t;
void get()
{ cin>>t;
for(i=0;i>d[i].c>>d[i].d>>d[i].l;
}
void count()
{ for(i=0;i<t;i++)
{ if(d[i].l==4||d[i].l==8)
cout<<"yes"<<endl;
else
cout<<"no"<<endl;
}
}
};
int main() {
catanddog q;
q.get();
q.count();
return 0;
}
100 % working
Deletelimka book of records plz
ReplyDeleteAdmin bro Or anyone limka book of records please asap
ReplyDeletewhere are you from iam admin.
Deletebruh i'm from karnataka limka book ofrecords plz
Deletei want a prog for iost 4
ReplyDeletepls bro
ReplyDeleteThis comment has been removed by the author.
ReplyDelete//unary - session 4 operator overloading
ReplyDelete#include
using namespace std;
class data
{
public:
int a;
void setdata()
{
}
void operator -( )
{
int count=0;
for(int i=1;i<=4;i++)
{ cin>>a;
if(a>0)
{
cout<<-a;
count++;
if(count%2!=0)
cout<<" ";
else if(count%2==0)
cout<<"\n";
}
else
{
cout<<-a;
count++;
if(count%2!=0)
cout<<" ";
else if(count%2==0)
cout<<"\n";
}
}
}
};
int main()
{
data obj;
obj.setdata();
obj.operator-();
return 0;
}
need BANK program in inheritance!!
ReplyDeleteyeah that i need
Delete//BANK Program!
Delete#include //iostream (include headerfiles)
#include //math.h
using namespace std;
class Customer {
public:
char s[100];
public:
void display()
{
cin>>s;
}
};
class Bank{
public:
long num1, num2, num3;
void display()
{
cin>>num1>>num2>>num3;
}
};
class Account:public Customer,public Bank
{
public:
char s[100];
long num1,num2,num3;
void display()
{
cin>>s;
cin>>num1>>num2>>num3;
cout<<"Customer Name="<<s<<endl;
cout<<"Customer Id="<<num1<<endl;
cout<<"Account No="<<num2<<endl;
cout<<"Account Balance="<<num3<<endl;
//Interest Calc
double y = num3;
y = floor((y * 100) + 0.5)/100;
y = y*12*3;
int interest = (int)y;
printf("Interest=%d", interest/100);
}
};
int main() {
Account user;
user.display();
}
Bro i want the code for Iomda
ReplyDeleteSession- Classes functions and constructors
SESSION: Exceptional Handling
ReplyDeleteQ. 73: Number Exception
QUESTION DESCRIPTION
Maths teacher is given the task to student that, Write a program to input a number num and run a loop from 0 to num.
The program should throw an exception whenever the loop counter variable is a multiple of 4, and display the number of exceptions at the end.
If it is not an integer then give "Invalid input".
Input:
Number of iterations
Output:
Number of exceptions
Mandatory:
Use the keyword try, catch and throw.
Refer Sample Testcases
Refer Testcase input and output.
TEST CASE 1
INPUT
12
OUTPUT
Number of exceptions: 3
TEST CASE 2
INPUT
123
OUTPUT
Number of exceptions: 30
SESSION: IO Streams
ReplyDeleteQ. 100: IOST8
QUESTION DESCRIPTION
This question will help you to study the concept of "istream_withassign class".
This class is variant of istream that allows object assignment.
The predefined object cin is an object of this class and thus may be reassigned at run time to a different istream object.
User need to write a program, to get two integers from user and print the same as output.
They have to use istream concepts to read the class with friend function.
Mandatory declarations of this program is "friend void operator>>", "operator >>"
Refer Sample Testcases
TEST CASE 1
INPUT
4 5
OUTPUT
dx=4 dy=5
TEST CASE 2
INPUT
41 51
OUTPUT
dx=41 dy=51
unary: operator overloading:
ReplyDelete#include
using namespace std;
class data
{
public:
void setdata()
{
int a,b,c,d;
cin>>a>>b>>c>>d;
cout<<0-a<<" "<<0-b<<"\n"<<0-c<<" "<<0-d;
}
}obj;
int main()
{
obj.setdata();
}
inheritance: friends in math tution: (100% include)
ReplyDelete#include
using namespace std;
class A
{
public:
int n;
void display()
{
cin>>n;
}
};
class B
{public:
int p;
void display()
{
cin>>p;
}
};
class C:public A,public B
{
public:
int total;
void display()
{
total=n*p;
cout<<total<<endl;
}
};
int main()
{
C sample;
sample.A::display();
sample.B::display();
sample.display();
return 0;
}
inheritance bank (100%) (include iostream)
ReplyDelete#include
using namespace std;
class Bank
{
};
class Customer
{
};
class Account:public Customer,public Bank
{
};
int main()
{
int Interestrate=12,year=3;
int a,b,c,i;
char d[15];
cin>>d>>a>>b>>c;
i=c*Interestrate*year;
cout<<"Customer Name="<<d<<"\nCustomer Id="<<a<<"\nAccount No="<<b<<"\nAccount Balance="<<c<<"\nInterest="<<i/100;
}