Frac Mult
If you wish to view the code only, check this page. You can click the links and it should open up in a notepad file.
class FracMult{ //REMEMBER:
Your program will not run if you do not use this exact class!
public static void main(String args[])
{
int FNum = 2;// changing these numbers chages the fractions.
int FDen = 3;
int SNum = 1;
int SDen = 4;
System.out.println("Hello World! We're adding fractions!");
// Notice that words in quotes are printed out, variables are not in quotes.
System.out.println(FNum +"/"+ FDen + "plus " + SNum + "/" +SDen);
System.out.println("adds to:");
System.out.println(FNum*SDen + SNum*FDen +" / "+ FDen*SDen); //This line does
the math //to figure out what they will multiply to
}
}
No new terms for this program.