Write a complete Java program that prompts the user for a number and prints back the integer as well as floating point values to the console.

What will be an ideal response?


```
import java.util.Scanner;
public class WrapperDemo
{
public static void main(String args[])
{
Scanner keyboard = new Scanner(System.in);
System.out.print("Enter any number >> ");
String strNumber = keyboard.next();
int intNumber = Integer.parseInt(strNumber);
double dblNumber = Double.parseDouble(strNumber);

System.out.println("The integer value of " + strNumber + " is: " +
intNumber);
System.out.println("The floating-point value of " + strNumber + " is: " +
dblNumber);
}
}
```

Computer Science & Information Technology

You might also like to view...

Resources managed by a ResourceManager include

a. material scripts b. overlay scripts c. 3D models d. all of the above

Computer Science & Information Technology

Select all that apply. The base class's __________ affects the way its members are inherited by the derived class.

a. name b. return data type c. access specification d. construction e. None of these

Computer Science & Information Technology

Semaphores are used to allow only

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

A budget should be included as part of a website's project plan.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology