My questions are:
- What is an interactive console program in JAVA and how do I write one ?
- What are the differences between a normal java code and a console program?
- When and why we should use a console program?
- How could we write println without system.out and readint without any scanner? As written in the solution?
- Please explain the following solution
Question from my friend: Write a console program too convert feet and inches into cm.
The solution I got from my friend:
println("This program converts feet and inches to centimeters.");
int feet = readInt("Enter number of feet: ");
int inches = readInt("Enter number of inches: ");
double centimeters = ((feet * 30.48) + (inches * 2.54));
println(feet + "ft " + inches + "in = " + centimeters + "cm");