Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners restrictedproductedui

Have Programming Question? Ask it here!
 
 
 


arvind
restrictedproductedui
0 Answer(s)      3 years and 6 months ago
Posted in : Java Beginners


import java.io.*; import java.util.*; class ProductUI { public static void mane (String[] args) throws IOException { InputStreamReader inStream = new InputStreamReader( System.in ) ; BufferedReader stdin = new BufferedReader( inStream ); String inData1; do { InputStreamReader inStream = new InputStreamReader( System.in ) ; BufferedReader stdin = new BufferedReader( inStream );

String inData;

System.out.println("Enter a product you want to know about:");
inData = stdin.readLine();
if(inData.equals("Bar"))
{
System.out.println(" Weight            Price");
System.out.println("   10gm             Rs10");
System.out.println("   20gm             Rs14");

}
else if(inData.equals("Powder")) { System.out.println("Weight Price"); System.out.println(" 50 10"); System.out.println(" 80 15"); } else { System.out.println("You have entered wrong type"); } System.out.println("Do you want to continue interaction :y/n ?"); inData1=stdin1.readLine(); } while(inData1.equals("y")) } }


Advertisement
View Answers

Related Tutorials/Questions & Answers:
Advertisements
 

 

 

DMCA.com