import java.util.*;
import java.io.*;
import java.lang.System;
class KbdRead 
{
	static DataInputStream din = new DataInputStream (System.in);
	static StringTokenizer st;
	public static void main (String args[]) 
	{
		try 
		{
			System.out.println ("Enter code no.");
			st = new StringTokenizer (din.readLine());
			int number = Integer.parseInt(st.nextToken());
			System.out.println("Entered number is "+number);
			for (int i = 0;i<number;i++)
			System.out.println("Number read in succesfully");
			System.out.println("Enter Cost");
			st=new StringTokenizer(din.readLine());
			double cost = new Double (st.nextToken()).doubleValue();
			System.out.println("Cost is " +cost);
		}
		catch (IOException e)
		{
			System.out.println("Error");
		}
	}
}

Click here to go back.

Our aim is to provide information to the knowledge seekers. 


comments powered by Disqus


Footer1