Answered step by step
Verified Expert Solution
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
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started