2. Create a class Reals for performing integer arithmetic on real numbers. Each real number has a whole part and a decimal part; your class should contain data components representing both parts as integers and should contain methods to do the following:
a. Default constructor
b. set the two components
c. get the components
d. print a real number
e. add two real numbers.
Add a client class to test your work.

Recommended Answers

All 2 Replies

show us your efforts first..!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.