Write a java class which implements methods

Assignment Help JAVA Programming
Reference no: EM131588787

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

Reference no: EM131588787

Questions Cloud

Clearly show the main message of the poster : What does Design Thinking mean to you? More specifically, your poster should: clearly show the main message of the poster
Data warehouses and business intelligence : Data warehouses (DW) and business intelligence (BI) systems also utilize system life cycles. Like most life cycles, DW and BI life cycles commence with project.
Compare state and national program standards for teachers : Explain the professional responsibilities of a teacher and which of these you will need to focus on to be effective.
Illustrate the failure of discrete categories : creating a thesis statement for a character analysis for We came all the way from Cuba so you could dress like this
Write a java class which implements methods : 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
Provide reasons both for drilling and against drilling : Provide reasons both for drilling and against drilling in these locations. Which side of the argument do you find more persuasive? Why?
Post a short description of what you found : Post a short description of what you found. What are your thoughts about your tap water after reading the report you obtained?
Define relationship between sentence fluency and conventions : In your best writing, explain the relationship between sentence fluency and conventions.Your answer should be at least five sentences
Basic understanding of change management : With a basic understanding of change management, you will now turn your attention to the service transition process as a whole.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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