Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  gg
Language: C/C++
Code:
#include<iostream.h>
#include<conio.h>
class eb
{
int unit,p;
public:
void get();
void call();
void display();
};
void eb::get()
{
cout<<"Enter the value of unit";
cin>>unit;
}
void eb::call()
{
if(unit<100)
p=unit*1;
if(unit>100&&<=200)
{
p=100;
unit=unit-100;
p=p+unit*2;
}
if(unit>200)
{
p=200;
unit=unit-200;
p=p+unit*3;
}
void eb::display()
{
cout<<"the value is"<<p;
}
void main()
{
eb;
s.get();
s.call();
s.display();
getch();
}
          
          
Comments: