SlideShare a Scribd company logo
1 of 1
Download to read offline
How can I fix this error in my code?
Give feedback
public class TestUnitFraction{public static void main(String[] args){Fraction f1 = new
UnitFraction(3, 3, "mile", "hour");Fraction f2 = new UnitFraction(4, 12, "mile", "hour");Fraction
f3 = new UnitFraction(5, 10, "dollar", "gallon");Fraction f4 = new UnitFraction(-6, 8, "gallon",
"gallon");Fraction f5 = new IntegerFraction(9, 4);Fraction f6 = new UnitFraction(6, 8, null,
null);System.out.println("f1 = " + f1);System.out.println("f2 = " + f2);System.out.println("f3 = "
+ f3);System.out.println("f4 = " + f4);System.out.println("f1 + f2 = " +
f1.add(f2));System.out.println("f3 + f4 = " + f3.add(f4));System.out.println("f2 in decimal is: " +
((UnitFraction) f2).decimalValue());System.out.println("f1 + f3 = " +
f1.add(f3));System.out.println("f2 + f5 = " + f2.add(f5));System.out.println("f6 + f5 = " +
f5.add(f6));}}

More Related Content

More from allystraders

Supplemental knowledge conversion processes have been added to the E.pdf
Supplemental knowledge conversion processes have been added to the E.pdfSupplemental knowledge conversion processes have been added to the E.pdf
Supplemental knowledge conversion processes have been added to the E.pdfallystraders
 
Supongamos que Musashi, un economista de un programa de radio AM, y .pdf
Supongamos que Musashi, un economista de un programa de radio AM, y .pdfSupongamos que Musashi, un economista de un programa de radio AM, y .pdf
Supongamos que Musashi, un economista de un programa de radio AM, y .pdfallystraders
 
Suponga que las tasas de inter�s en los Estados Unidos, pero no aume.pdf
Suponga que las tasas de inter�s en los Estados Unidos, pero no aume.pdfSuponga que las tasas de inter�s en los Estados Unidos, pero no aume.pdf
Suponga que las tasas de inter�s en los Estados Unidos, pero no aume.pdfallystraders
 
Suponga que la ARN polimerasa estaba transcribiendo un gen eucari�ti.pdf
Suponga que la ARN polimerasa estaba transcribiendo un gen eucari�ti.pdfSuponga que la ARN polimerasa estaba transcribiendo un gen eucari�ti.pdf
Suponga que la ARN polimerasa estaba transcribiendo un gen eucari�ti.pdfallystraders
 
Suppose researchers are about to draw a sample of 1450 observations .pdf
Suppose researchers are about to draw a sample of 1450 observations .pdfSuppose researchers are about to draw a sample of 1450 observations .pdf
Suppose researchers are about to draw a sample of 1450 observations .pdfallystraders
 
Suponga que el Congreso est� considerando un proyecto de ley que imp.pdf
Suponga que el Congreso est� considerando un proyecto de ley que imp.pdfSuponga que el Congreso est� considerando un proyecto de ley que imp.pdf
Suponga que el Congreso est� considerando un proyecto de ley que imp.pdfallystraders
 
Suppose that there are two groups of people in the economy. In group.pdf
Suppose that there are two groups of people in the economy. In group.pdfSuppose that there are two groups of people in the economy. In group.pdf
Suppose that there are two groups of people in the economy. In group.pdfallystraders
 
Suppose that the Fed will increase the money supply. Which of the fo.pdf
Suppose that the Fed will increase the money supply. Which of the fo.pdfSuppose that the Fed will increase the money supply. Which of the fo.pdf
Suppose that the Fed will increase the money supply. Which of the fo.pdfallystraders
 
Suppose that the body weights of Roborovski dwarf hamsters are norma.pdf
Suppose that the body weights of Roborovski dwarf hamsters are norma.pdfSuppose that the body weights of Roborovski dwarf hamsters are norma.pdf
Suppose that the body weights of Roborovski dwarf hamsters are norma.pdfallystraders
 
Suppose that in a particular country, the TFR fell to zero and remai.pdf
Suppose that in a particular country, the TFR fell to zero and remai.pdfSuppose that in a particular country, the TFR fell to zero and remai.pdf
Suppose that in a particular country, the TFR fell to zero and remai.pdfallystraders
 
Suppose that disposable income, consumption, and saving in some coun.pdf
Suppose that disposable income, consumption, and saving in some coun.pdfSuppose that disposable income, consumption, and saving in some coun.pdf
Suppose that disposable income, consumption, and saving in some coun.pdfallystraders
 
Suppose that 60 of students at Kansas State University have listene.pdf
Suppose that 60 of students at Kansas State University have listene.pdfSuppose that 60 of students at Kansas State University have listene.pdf
Suppose that 60 of students at Kansas State University have listene.pdfallystraders
 
Suppose Maria and Jamal both face the following individual loss dist.pdf
Suppose Maria and Jamal both face the following individual loss dist.pdfSuppose Maria and Jamal both face the following individual loss dist.pdf
Suppose Maria and Jamal both face the following individual loss dist.pdfallystraders
 
Suppose a random variable X has the following probability distributi.pdf
Suppose a random variable X has the following probability distributi.pdfSuppose a random variable X has the following probability distributi.pdf
Suppose a random variable X has the following probability distributi.pdfallystraders
 
Suppose a country had a smaller increase in debt in 2011 than it had.pdf
Suppose a country had a smaller increase in debt in 2011 than it had.pdfSuppose a country had a smaller increase in debt in 2011 than it had.pdf
Suppose a country had a smaller increase in debt in 2011 than it had.pdfallystraders
 
how would implement empowerment techniques within a service Choose .pdf
how would implement empowerment techniques within a service Choose .pdfhow would implement empowerment techniques within a service Choose .pdf
how would implement empowerment techniques within a service Choose .pdfallystraders
 
How were the management controls at Siemens prior to the Bribery sca.pdf
How were the management controls at Siemens prior to the Bribery sca.pdfHow were the management controls at Siemens prior to the Bribery sca.pdf
How were the management controls at Siemens prior to the Bribery sca.pdfallystraders
 
How would I create this diagramRentTool Viewpoints � Technology .pdf
How would I create this diagramRentTool Viewpoints � Technology .pdfHow would I create this diagramRentTool Viewpoints � Technology .pdf
How would I create this diagramRentTool Viewpoints � Technology .pdfallystraders
 
How well did Thaldorf interact with each member of the DMUOn what.pdf
How well did Thaldorf interact with each member of the DMUOn what.pdfHow well did Thaldorf interact with each member of the DMUOn what.pdf
How well did Thaldorf interact with each member of the DMUOn what.pdfallystraders
 
How do increasing atmospheric CO2 emissions threaten sea creatures, .pdf
How do increasing atmospheric CO2 emissions threaten sea creatures, .pdfHow do increasing atmospheric CO2 emissions threaten sea creatures, .pdf
How do increasing atmospheric CO2 emissions threaten sea creatures, .pdfallystraders
 

More from allystraders (20)

Supplemental knowledge conversion processes have been added to the E.pdf
Supplemental knowledge conversion processes have been added to the E.pdfSupplemental knowledge conversion processes have been added to the E.pdf
Supplemental knowledge conversion processes have been added to the E.pdf
 
Supongamos que Musashi, un economista de un programa de radio AM, y .pdf
Supongamos que Musashi, un economista de un programa de radio AM, y .pdfSupongamos que Musashi, un economista de un programa de radio AM, y .pdf
Supongamos que Musashi, un economista de un programa de radio AM, y .pdf
 
Suponga que las tasas de inter�s en los Estados Unidos, pero no aume.pdf
Suponga que las tasas de inter�s en los Estados Unidos, pero no aume.pdfSuponga que las tasas de inter�s en los Estados Unidos, pero no aume.pdf
Suponga que las tasas de inter�s en los Estados Unidos, pero no aume.pdf
 
Suponga que la ARN polimerasa estaba transcribiendo un gen eucari�ti.pdf
Suponga que la ARN polimerasa estaba transcribiendo un gen eucari�ti.pdfSuponga que la ARN polimerasa estaba transcribiendo un gen eucari�ti.pdf
Suponga que la ARN polimerasa estaba transcribiendo un gen eucari�ti.pdf
 
Suppose researchers are about to draw a sample of 1450 observations .pdf
Suppose researchers are about to draw a sample of 1450 observations .pdfSuppose researchers are about to draw a sample of 1450 observations .pdf
Suppose researchers are about to draw a sample of 1450 observations .pdf
 
Suponga que el Congreso est� considerando un proyecto de ley que imp.pdf
Suponga que el Congreso est� considerando un proyecto de ley que imp.pdfSuponga que el Congreso est� considerando un proyecto de ley que imp.pdf
Suponga que el Congreso est� considerando un proyecto de ley que imp.pdf
 
Suppose that there are two groups of people in the economy. In group.pdf
Suppose that there are two groups of people in the economy. In group.pdfSuppose that there are two groups of people in the economy. In group.pdf
Suppose that there are two groups of people in the economy. In group.pdf
 
Suppose that the Fed will increase the money supply. Which of the fo.pdf
Suppose that the Fed will increase the money supply. Which of the fo.pdfSuppose that the Fed will increase the money supply. Which of the fo.pdf
Suppose that the Fed will increase the money supply. Which of the fo.pdf
 
Suppose that the body weights of Roborovski dwarf hamsters are norma.pdf
Suppose that the body weights of Roborovski dwarf hamsters are norma.pdfSuppose that the body weights of Roborovski dwarf hamsters are norma.pdf
Suppose that the body weights of Roborovski dwarf hamsters are norma.pdf
 
Suppose that in a particular country, the TFR fell to zero and remai.pdf
Suppose that in a particular country, the TFR fell to zero and remai.pdfSuppose that in a particular country, the TFR fell to zero and remai.pdf
Suppose that in a particular country, the TFR fell to zero and remai.pdf
 
Suppose that disposable income, consumption, and saving in some coun.pdf
Suppose that disposable income, consumption, and saving in some coun.pdfSuppose that disposable income, consumption, and saving in some coun.pdf
Suppose that disposable income, consumption, and saving in some coun.pdf
 
Suppose that 60 of students at Kansas State University have listene.pdf
Suppose that 60 of students at Kansas State University have listene.pdfSuppose that 60 of students at Kansas State University have listene.pdf
Suppose that 60 of students at Kansas State University have listene.pdf
 
Suppose Maria and Jamal both face the following individual loss dist.pdf
Suppose Maria and Jamal both face the following individual loss dist.pdfSuppose Maria and Jamal both face the following individual loss dist.pdf
Suppose Maria and Jamal both face the following individual loss dist.pdf
 
Suppose a random variable X has the following probability distributi.pdf
Suppose a random variable X has the following probability distributi.pdfSuppose a random variable X has the following probability distributi.pdf
Suppose a random variable X has the following probability distributi.pdf
 
Suppose a country had a smaller increase in debt in 2011 than it had.pdf
Suppose a country had a smaller increase in debt in 2011 than it had.pdfSuppose a country had a smaller increase in debt in 2011 than it had.pdf
Suppose a country had a smaller increase in debt in 2011 than it had.pdf
 
how would implement empowerment techniques within a service Choose .pdf
how would implement empowerment techniques within a service Choose .pdfhow would implement empowerment techniques within a service Choose .pdf
how would implement empowerment techniques within a service Choose .pdf
 
How were the management controls at Siemens prior to the Bribery sca.pdf
How were the management controls at Siemens prior to the Bribery sca.pdfHow were the management controls at Siemens prior to the Bribery sca.pdf
How were the management controls at Siemens prior to the Bribery sca.pdf
 
How would I create this diagramRentTool Viewpoints � Technology .pdf
How would I create this diagramRentTool Viewpoints � Technology .pdfHow would I create this diagramRentTool Viewpoints � Technology .pdf
How would I create this diagramRentTool Viewpoints � Technology .pdf
 
How well did Thaldorf interact with each member of the DMUOn what.pdf
How well did Thaldorf interact with each member of the DMUOn what.pdfHow well did Thaldorf interact with each member of the DMUOn what.pdf
How well did Thaldorf interact with each member of the DMUOn what.pdf
 
How do increasing atmospheric CO2 emissions threaten sea creatures, .pdf
How do increasing atmospheric CO2 emissions threaten sea creatures, .pdfHow do increasing atmospheric CO2 emissions threaten sea creatures, .pdf
How do increasing atmospheric CO2 emissions threaten sea creatures, .pdf
 

Recently uploaded

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 

Recently uploaded (20)

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 

How can I fix this error in my codeGive feedbackpublic class .pdf

  • 1. How can I fix this error in my code? Give feedback public class TestUnitFraction{public static void main(String[] args){Fraction f1 = new UnitFraction(3, 3, "mile", "hour");Fraction f2 = new UnitFraction(4, 12, "mile", "hour");Fraction f3 = new UnitFraction(5, 10, "dollar", "gallon");Fraction f4 = new UnitFraction(-6, 8, "gallon", "gallon");Fraction f5 = new IntegerFraction(9, 4);Fraction f6 = new UnitFraction(6, 8, null, null);System.out.println("f1 = " + f1);System.out.println("f2 = " + f2);System.out.println("f3 = " + f3);System.out.println("f4 = " + f4);System.out.println("f1 + f2 = " + f1.add(f2));System.out.println("f3 + f4 = " + f3.add(f4));System.out.println("f2 in decimal is: " + ((UnitFraction) f2).decimalValue());System.out.println("f1 + f3 = " + f1.add(f3));System.out.println("f2 + f5 = " + f2.add(f5));System.out.println("f6 + f5 = " + f5.add(f6));}}