Convert these statements into Java code
Store 119.5 in a variable named weight.
Store 3 in a variable factor.
Divide weight by factor and store in variable ans.
Display the contents of the ans variable.
Code:
class main
{
public static void main(String [] args)
{
double weight=119.5;
double factor=3;
double ans=weight/factor;
System.out.println(ans);
}
}
Reference:
Output:
Get Answers For Free
Most questions answered within 1 hours.