Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 2 (35 marks) A MixedFraction can be represented by three data members namely whole, numezator and denominator. All data members are integers Identify suitable

image text in transcribed

image text in transcribed

Question 2 (35 marks) A MixedFraction can be represented by three data members namely whole, numezator and denominator. All data members are integers Identify suitable coding modules for the MixedFraction class with the following specifications (a) Define the three data members: whole, numerator and denominator 3 marks) (b) Implement a parameterised constructor that receives three arguments that represent the values of whole, numerator and denominator respectively. The constructor will initialise the three data members with the arguments with the following rules. An error message is displayed if the value of denominator is 0. The constructor replaces the denominator with the value1 The constructor uses the lowestTerm () function to convert the fraction into its lowest term. If the numerator is greater than or equal to the denominator, then numerator is decreased by the value of denominator and the value of whole is increased by 1. This is repeated until the value of numerator is less than the value of denominator

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Oracle8I Building Efficient Databases

Authors: Jonathan Lewis

1st Edition

0201715848, 978-0201715842

More Books

Students also viewed these Databases questions

Question

7. Define and describe the occurrence of culture shock.

Answered: 1 week ago

Question

Provide examples of KPIs in Human Capital Management.

Answered: 1 week ago

Question

What are OLAP Cubes?

Answered: 1 week ago