restrictedproductedui

restrictedproductedui

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")) } }

View Answers









Related Tutorials/Questions & Answers:
restrictedproductedui

Ads