tag:blogger.com,1999:blog-4816987417907886548.post1765127931907598504..comments2023-07-02T21:34:46.552+06:00Comments on Java Error Messages and Solutions: class [ClassName] is public, should be declared in a file named [ClassName].javaShamsuddin Ahammadhttp://www.blogger.com/profile/09496582775045632128noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-4816987417907886548.post-77821714112312327712019-07-24T18:35:22.709+06:002019-07-24T18:35:22.709+06:00import java.util.Scanner;
public class Resturentme...import java.util.Scanner;<br />public class Resturentmenu {<br /><br /> public static void main(String[] args) {<br /> Scanner sc = new Scanner(System.in);<br /> int choice;<br /> double total = 0;<br /> double tax;<br /> double vat;<br /> double totalBill;<br /> System.out.println("Welcome");<br /> System.out.println("Here are the munu that we have.");<br /> System.out.println("-------------------");<br /><br /> String[] menuItemNames = new String[10];<br /> String[] menuItemDescriptions = new String[10];<br /> double[] menuItemPrices = new double[10];<br /><br /> menuItemNames[0] = "0. Roti";<br /> menuItemDescriptions[0] = "= Rs:";<br /> menuItemPrices[0] = 12.99;<br /><br /> menuItemNames[1] = "1. MO:MO";<br /> menuItemDescriptions[1] = "= Rs:";<br /> menuItemPrices[1] = 100.99;<br /><br /> menuItemNames[2] = "2. Chomin";<br /> menuItemDescriptions[2] = "= Rs:";<br /> menuItemPrices[2] = 40.69;<br /><br /> menuItemNames[3] = "3. Home Salad";<br /> menuItemDescriptions[3] = "= Rs:";<br /> menuItemPrices[3] = 60.98;<br /><br /> menuItemNames[4] = "4. Soft Drink";<br /> menuItemDescriptions[4] = "= Rs:";<br /> menuItemPrices[4] = 40;<br /><br /> menuItemNames[5] = "5. Hard Drink";<br /> menuItemDescriptions[5] = "= Rs:";<br /> menuItemPrices[5] = 500.98;<br /><br /> menuItemNames[6] = "6. Caffee";<br /> menuItemDescriptions[6] = "= Rs:";<br /> menuItemPrices[6] = 60.98;<br /><br /> menuItemNames[7] = "7. Drum Stick";<br /> menuItemDescriptions[7] = "= Rs:";<br /> menuItemPrices[7] = 100;<br /><br /> menuItemNames[8] = "8. Sacess";<br /> menuItemDescriptions[8] = "= Rs:";<br /> menuItemPrices[8] = 60;<br /><br /> menuItemNames[9] = "9. Tea";<br /> menuItemDescriptions[9] = "= Rs:";<br /> menuItemPrices[9] = 35.00;<br /><br /> // Print out menu:<br /> for (int i = 0; i < menuItemNames.length; i++) {<br /> System.out.println(menuItemNames[i] + " "<br /> + menuItemDescriptions[i] + " "<br /> + menuItemPrices[i]);<br /><br /> }<br /> <br /> System.out.println("-------------------");<br /> System.out.println("Please Enter a Menu Selections");<br /><br /> for (int i = 0; i < menuItemNames.length; i++) {<br /> choice = sc.nextInt();<br /> total = menuItemPrices[choice];<br /> tax = 0.10 * total;<br /> vat = 0.13 * total;<br /> totalBill = total + vat;<br /> System.out.println("Your Item prices RS=" + total);<br /> System.out.println("============================");<br /> System.out.println("Your total tax RS=" + tax);<br /> System.out.println("============================");<br /> System.out.println("Your total vat RS=" + vat);<br /> System.out.println("============================");<br /> System.out.println("Total cost RS=" + totalBill);<br /> System.out.println("============================");<br /> if (i == 4) {<br /> break;<br /><br /> <br /> }<br /><br /> }<br /> }<br /> String Resturentmenu;<br /> }<br /><br />public class Resturentmenu {<br /> public static void main(String[] args){<br /> Resturentmenu method = new Resturentmenu();<br /> System.out.println("Do you want to order again"+method.Resturentmenu);<br /> }<br />}<br />Amithttps://www.blogger.com/profile/08878267312271434845noreply@blogger.comtag:blogger.com,1999:blog-4816987417907886548.post-16822008854494537862018-01-25T20:24:22.986+06:002018-01-25T20:24:22.986+06:00Really appreciated the information and please keep...Really appreciated the information and please keep sharing, I would like to share some information regarding online training.Maxmunus Solutions is providing the best quality of this JBOSS Technology And this online training will be very convenient for the learner.And the training will be online and very convenient for the learner.<br /> <br />For Joining online training batches please feel free to call or email us.<br />Email : minati@maxmunus.com<br />Contact No.-+91-9066638196/91-9738075708<br />website:-http://www.maxmunus.com/page/JBoss-Administration-Training<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4816987417907886548.post-85291548188992389662011-07-11T13:28:37.874+06:002011-07-11T13:28:37.874+06:00not necessarily. remember, you can have several cl...not necessarily. remember, you can have several classes in one file.<br />to complete your previous post:<br />the name of the file must be identical to the name of the public class name. it is very well possible to have a <br /><br />Loader.java file without a Loader - class in it, even though it can contain several other classes.Hansnoreply@blogger.com