Answer to Question #117 in Java | JSP | JSF for Tracy

Question #117
I wanted to know if this code was right and if not what needs to be fixed?
public class Time
{
public static void main(String[] args)
{
int Time = 197;
int hours=3;
int minutes=17;
{
int hours =3;
int left = 17;
System.out.println("197 minutes is 3 hours and 17 minutes");
} // end class Time
}
1
Expert's answer
2010-05-17T09:27:06-0400
No, your code is wrong. Try to use this:
public class Drive
{
public static void main(String[] args)
{
Time time = new Time();
time.setMinutes(197);
System.out.println(time.toString());

} // end class Drive
}
Try to combine our answers and you'll get a solution for your problem.

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS