#include<iostream>
#include<conio.h>
using namespace std;
class Distance{
private:
int feet;
float inches;
public:
void set_distance();
void display_distance();
};
int main()
{
Distance t;
t.set_distance();
t.display_distance();
}
I create this Blog for helping student in study. This Blog is not for some specific thing you can different information related to study.
Sunday, 8 April 2018
Define a Class Distance with private attributes Feet (int) and Inches (float). Also, define public member functions: - Set_distance() – to assign values to the class attributes - Display_distance() – to display the values of class attributes Include a main() program that creates an instance (object) of type Distance. Ask the user to enter the value of Distance variables and call the appropriate functions to set the object value and then display the object value.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment