The denominator for the target fraction

Assignment Help Basic Computer Science
Reference no: EM13161067

When a programming language does not support a needed data type, a programmer must create an abstract data type (ADT). Examples of data types that might have to be created are Complex Numbers (a + bi) or Fraction (n/d). These abstract data types created by a programmer would be released to the user community to be used like Integer or Double. That means a class would be created that implements the desired ADT. You are to create and ADT Fraction in its own file. Fraction must consist of: 2 state variables num (numerator) and den (denominator). a default and 2 parameter override constructor so you can use new Fraction(); or new Fraction(a,b); a toString() that produces output like 1/2 an equals(Fraction f) that compares using: return getNum()*f.getDenom() == f.getNum()*getDenom(); Write an appropriate test program in a separate file. Your test program should read in numerators and denominators and create Fraction instances for comparison.

Possible Example Output: --------------------Configuration: -------------------- Enter the numerator for the target fraction: 1 Enter the denominator for the target fraction: 2 Enter the numerator for the next fraction to test: 2 Enter the denominator for the next fraction to test: 4 The fraction you just entered equals the first fraction of 1/2. Would you like to continue (Y/N)? y Enter the numerator for the next fraction to test: 3 Enter the denominator for the next fraction to test: 4 The fraction you just entered does not equal the first fraction of 1/2. Would you like to continue (Y/N)? n Process completed.

Reference no: EM13161067

Find the speed of the car

A shooter shots gunfire at an interval of 16 seconds. A man in a car that starts travelling from a distance of 160 km can hear the gunshots at an interval of 15 seconds. Fin

Defeating physical security controls to bypass access

You might be wondering if physical security is really important in this digital age. After all, you have been studying how to protect IT assets via a keyboard, not by wearin

What is the corresponding key length in bits

Assume a password consisting of 8 letters, where each letter is encoded by the ASCII scheme (7 bits per character, i.e., 128 possible characters). What is the size of the ke

Define an array named people

Your program should count the number of each 1, 2, 3, and 4 in the array and display a list of how many infants, children, teenagers, and adults were at the school function.

What is the proper rule (2) for shared and exclusive locks

which requires a lock on the parent to get a lock on a node, must be changed to prevent unserializable behavior. What is the proper rule (2) for shared and exclusive locks?

Write program reads in the length and width of a rectangular

Write a program that reads in the length and width of a rectangular yard (in meters) and the length and width of a rectangular house (in meters) placed in the yard. Your pro

Projects design and testing

Along with your program, you should also submit an Approach Document for this assignment. This is a short document (two to five pages long) explaining the project's design a

The two octets following the address fields

NICs can tell whether an arriving frame is tagged or not simply by looking at it. How can they do so? (Hint: They look at the value in the two octets following the addres

Reviews

Write a Review

 
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd