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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started