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

Questions Cloud

Assume a dual-railed system : (Multiplexers) Assume a dual-railed system, where you have access to any vari- able and its complement. Implement the following four-input Boolean function as indicated in each of the following subsections.
What is the process involved in the formation : What is the process involved in the formation of identical twins from pre-fertilization to the implantation in the uterus?
Application letter and resume : In this project, you will work with a fax cover sheet, an application letter, and a resume. To complete the project you will create a table, add text to a table, and format tables.
Explain what is the hydroxide ion concentration : If an aqueous solution has a hydronium ion concentration ([H3O+]) of 5.10 x 10-9 mol/L, what is the hydroxide ion concentration ([OH-]) in the solution
The denominator for the target fraction : 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)?
Calculate the mass of formed from the unbalanced reaction : Calculate the mass of formed from the unbalanced reaction? A solution is prepared by mixing 100.0 mL of 0.45 M NaCl, 100 mL of 0.082M, and enough to bring the total volume to 400.0 mL
Distinguish recombinant and non-recombinant plasmids : c. Which antibiotic(s), if any, will cells be resistant to ifthey have obtained a plasmid containing inserted foreign DNA? d. How would you distinguish recombinant and non-recombinant plasmids by agarose gel electrophoresis.
Let''s try to make inheritance : Let's try to make inheritance a little less abstract and a little bit more concrete. In order to do this, we will model a simple inheritance relationship
State the decomposition of no2 : The decomposition of NO2 (shown below) has a KP = 4.8 × 10-6 at a certain temperature. If 1.36 atm of NO2 is placed in a flask at this temperature

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Information technology support company-s business processes

How can information Technology support a company's business processes and decision making and give it competitive advantage? Give examples to illustrate your answer.

  Explain hardware to gather the essential information

Write down a 2-3 page paper explaining the hardware and software utilized to support personal, workgroup, and enterprise computing in the present organization.

  Find crc using modulo two arithmetic or polynomials

For a pattern P = 10011, and a message D = 10010011011, find, using modulo 2 arithmetic or polynomials, the CRC, then the string T to be transmitted.

  Significant invention which shaped society today

Pondering history of technology development, decide what you think was the most significant invention previous to the 1600s which has shaped society today. Explain your decision.

  Examine amazon using competitive forces-value chain models

Examine Amazon.com using competitive forces and value chain models. How has it replied to pressures from its competitive environment?

  Use electronic monitoring to measure employee productivity

A discussion of the current trend to use electronic monitoring to measure employee productivity, bearing in mind the theories of Taylor and McGregor. The key ethical issues and the stakeholders involved.

  Why information security is not factor for organization

But would not require to give for information security on those systems. Explain that environment and desribe why information security is not factor for that organization.

  Business rules that are reflected in the erd

Write the business rules that are reflected in the ERD shown below. (Keep in mind that the ERD reflects some simplifications. For example, this ERD states that each book is only written by one author, but in reality, there are many books written by m..

  Process centered organization differ from task-centered one

According to Hammer, how does a process centered organization differ from a task-centered one? What are the pros and cons of either approach?

  Describe what is downward solution

The Conflict Resolution Phase can be thought of as control strategy, describe four types of such strategy Describe what is downward solution

  Prove that machine precision as bound for relative round off

Prove that machine precision (epsilon) calculated by mathlab's eps function can be utilized as a bound for relative round off.

  Study ai literature to find-task can be solved by computers

Study the AI literature to find whether or not the following tasks can presently be solved by computers. Give proper reference to support your answer.

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