Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

Description

Note that your program must perform the following checks:

1. All the values in the second row of the array Fractions must be different than zero
2. The length of the array Operators must be n-1 where n is the number of columns of the array Fractions.
3. The only 4 characters allowed for the array Fractions are +,-,/,*

The output must be in the form of a fraction (like 13/6 of the previous example) and the fraction must be in its minimal form: for instance 2/4 becomes 1/2 or 12/30 becomes 2/5

General Info

Your project is to write a Java class which implements methods to perform symbolic computations on fractions. The input to your program will be 2 arrays which you will transform into fractions.

Methods

Write and use methods. Try not to repeat any code, create a method and call the method twice.

You must use the two methods LCM and GCD, that take as input 2 positive integers and return respectively the least common multiple and the greatest common divisor of the two given integers (Zybook has examples of these algorithms).

Examples
LCM(6,20) should return 60 and
LCM(8,20) should return 40
GCD(6,20) should return 2 and
GCD(8,20) should return 4

Testing and Commenting
Test your program with different examples, including all 4 arithmetic operators
Test your program also with input errors as described before (values of second row all different than zero, etc.)
Use succinct, thoughtful comments in your program, describe what all the different blocks or methods are doing
Use consistent indentation to make your program readable

Here is a list of methods to think about:
- Multiply 2 fractions
- Divide 2 fractions (call multiply function on the reciprocal)
- Subtract 2 fractions
- Add 2 fractions
- Return the negative of a fraction
- Simplify a fraction
- Scan in a 2D array
- Scan in a 1D array
- Overload print methods to print output as needed

Java, Programming

  • Category:- Java
  • Reference No.:- M92397501
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Java

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

Can someone kindly help me to consider whether java

Can someone kindly help me to consider whether Java provides the facility of operator overloading? If it does, may you kindly describe how overloading operators can be accomplished? If not, may you kindly describe why yo ...

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

Can someone please help me with the following java

can someone please help me with the following java question The input is an N by N matrix of nonnegative integers. Each individual row is a decreasing sequence from left to right. Each individual column is a decreasing s ...

Assignment - java program using array of objectsobjectives

Assignment - JAVA Program using array of objects Objectives - This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details - For this assignment, you are required to develop a Menu ...

Applied software engineering assignment 1 -learning

Applied Software Engineering Assignment 1 - Learning outcomes - 1. Understand the notion of software engineering and why it is important. 2. Analyse the risk factors associated with phases of the software development lif ...

Retail price calculatorwrite a java program that asks the

Retail Price Calculator Write a JAVA program that asks the user to enter an item's wholesale cost and its markup percentage. It should then display the item's retail price. For example: (If an item's wholesale cost is 5. ...

Answer the following question whats the difference public

Answer the following Question : What's the difference public inheritance and private inheritance? What can derived classes inherit from base classes? What cannot be inherited from base classes?

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As