Hi guys it's been a while since i been on this site, and school just started and i took another computer science class and I'm learning java now . So anyways my teacher gave me some stuff to program i did all except for one which i tried to program but I'm getting a different answer then what I'm expecting to get.
Quote:
Write a program that calculates the amount of tax on $5.75 saves it to a new variable and then outputs the information on the screen.
This is what i tried so far.
Quote:
public class problem6
{
public static void main (String[] args)
{
double a = 5.75 / 0.13;
double b = a - 5.75;
System.out.println (" The tax on 5.75 is " + a + " , the original price is " + b);
}
}
This is the out put i get
Quote:
The tax on 5.75 is 44.230769230769226 , the original price is 38.480769230769226
Am i doing something wrong? [/quote]