Java problem using 1/2 and 3/4 for the variables

Code with C | Programming: Projects & Source Codes Forums JAVA Programming Java problem using 1/2 and 3/4 for the variables

This topic contains 1 reply, has 1 voice, and was last updated by  Adelaid 2 years, 6 months ago.

  • Author
  • #10923


    Here is the code I was given

    The output of the code is suppose to look like this, when using 1/2 and 3/4 for the variables. Any help would be greatly appreciated.

  • #10924


    Where you want to print out the variables in the last println statements mixed with integers but mention you’re not sure how to do it, you use string concatenation. From the example i used below:

    To calculate the sum in fractions you need to find the LCD (lowest common denominator) and the GCD is then used to calculate the simplified fraction. With some googling I found already made methods for these. The code still has exceptions to be handled but works with the example cases, if you need any clarification just let me know. (Second year CS student)

You must be logged in to reply to this topic.