What is wrong with my java code? How do I fix it? and Will it run the
Question:
What is wrong with my java code? How do I fix it? and Will it run the way I want it too?
public class Exercise
{
public static void main(String[] args)
{
int x;
int y;
int product;
int landSpeed;
float decimalValue;
float weight;
double difference;
double result;
char letter;
x=34;
y=45;
product=(x*y);
landSpeed=(x+y);
decimalValue=99.3f;
weight=33.21f;
difference=(decimalValue-weight);
result=(product/difference);
char letter='X';
System.out.println("product="+product);
System.out.println("sum="+landSpeed);
System.out.println("diff="+difference);
System.out.println("result="+result);
System.out.println("The value of letter is " + letter);
System.out.println("<<--- --- --- \\\ -o- /// --- --- --->>");
System.out.println("####### # # # ");
System.out.println(" # # # # ");
System.out.println(" # # # # ");
System.out.println(" # # #######");
System.out.println(" # # # #");
System.out.println("# # # #");
System.out.println("####### ####### # #");
}
}
Cambridge Checkpoint Lower Secondary Mathematics Student's Book 7
ISBN: 9781398301948
3rd Edition
Authors: Frankie Pimentel, Ric Pimentel, Terry Wall