the answer of Write a class for rational numbers. A rational number is quotient of two integers, such as 2/3 or 1/2. Your class should have three constructors. One constructor takes no argument, and initializes the rotational number to 0. Another constructor takes a numerator only (the denominator is assumed to be 1). The third constructor takes both a numerator and denominator. Your class should have methods for adding, subtracting, multiplying and dividing rational numbers.
norsalwani.shasa 0 Newbie Poster
NP-complete 42 Junior Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
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.