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

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("#######   #######   #            #");

}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Algorithms Questions!