|
Coffee shop management system in java
If Cashier, items, Customers, inventory are major classes of java program what will be the relation they have for each other. In short, how to make Object oriented model of coffee shop management system (like Composition, inheritance etc)
please help me
|
|
|
|
|
|
Can anyone inform me about the custom browser means which types of languages we have to learn to make custom browser and how to create css parser and java script parser? Please
|
|
|
|
|
sandeep kamara wrote: which types of languages we have to learn to make custom browser Any languages that you want. A browser (custom or otherwise) is simply a program that runs on a computer. And you can learn about parsers by Googling the subject, there are many existing ones, applications or libraries, that you can use to leverage your application.
|
|
|
|
|
what is Singleton pattern in java?
how to use singleton pattern?
real time example
|
|
|
|
|
I've found that the Java design patterns explained on tutorialspoint are easy to understand:
Design Patterns Singleton Pattern[^]
-NP
Never underestimate the creativity of the end-user.
|
|
|
|
|
Hey guys. I'm having so much trouble understanding setters and getters. I've read the setter/getter chapter for our testbook multiple times and have looked up many things online but can't get it to work. It doesn't help that there are very few completed examples in my book so its hard to actually see how anything is applied in a finished state. This is one of our programs we have to do for class. We were supposed to use setters and getters, but I couldn't figure it out, so desperately created the program below to at least get the end result, albeit not with the method required.
Utilizing my program below, can someone explain the basics of setters and getters and how I would apply them? Not asking for someone to do my work for me, just thought it'd give a good example for me to understand.
My program basically shows a menu, a user enters how many of each product they want through keyboard input, and then the program calculates the subtotal before tax, the tax amount, and then the grand total (subtotal + tax). Pretty simple.
public class CateringOrderApp {
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
double SALES_TAX_RATE = .0875;
double subtotalCost;
double taxAmount;
double totalCost;
double VEGGIE_SANDWICH_PRICE = 2.75;
double HAM_AND_CHEESE_SANDWICH_PRICE = 3.25;
double SPAGHETTI_PRICE = 35.00;
double SALAD_PRICE = 18.00;
double veggieSandwichCount = 0;
double hamAndCheeseSandwichCount = 0;
double spaghettiCount = 0;
double saladCount = 0;
System.out.println("Food Item Price");
System.out.println("--------------------------------------------------------");
System.out.println("Veggie Sandwich $2.75");
System.out.println("Ham and Cheese Sandwich $3.25");
System.out.println("Spaghetti (tray serves 20) $35.00");
System.out.println("Salad (tray serves 20 $18.00");
System.out.println("--------------------------------------------------------");
System.out.println("Please enter the amount of Veggie sandwiches that you want: ");
veggieSandwichCount = keyboard.nextDouble();
System.out.println("Please enter the amount of Ham and Cheese sandwiches that you want: ");
hamAndCheeseSandwichCount = keyboard.nextDouble();
System.out.println("Please enter the orders of Spaghetti that you want: ");
spaghettiCount = keyboard.nextDouble();
System.out.println("Please enter the orders of salad that you want: ");
saladCount = keyboard.nextDouble();
subtotalCost = (veggieSandwichCount*VEGGIE_SANDWICH_PRICE)+
(hamAndCheeseSandwichCount*HAM_AND_CHEESE_SANDWICH_PRICE)+
(spaghettiCount*SPAGHETTI_PRICE)+
(saladCount*SALAD_PRICE);
taxAmount = (subtotalCost*SALES_TAX_RATE);
totalCost = (subtotalCost + taxAmount);
System.out.println("Food Item Number Ordered");
System.out.println("--------------------------------------------------------");
System.out.println("Veggie Sandwich " + veggieSandwichCount);
System.out.println("Ham and Cheese Sandwich " + hamAndCheeseSandwichCount);
System.out.println("Spaghetti (tray serves 20) " + spaghettiCount);
System.out.println("Salad (tray serves 20 " + saladCount);
System.out.println("--------------------------------------------------------");
System.out.println("Sutotal: " + subtotalCost);
System.out.println("Tax Amount: " + taxAmount);
System.out.println("Total: " + totalCost);
}
}
|
|
|
|
|
Setters and Getters are used to hide the implementation of fields in an object, and just provide a convenient method to save or return a value. At its most basic level you could have something like:
private double taxAmount;
public double getTaxAmount()
{
return taxAmount;
}
public void setTaxAmount(double value)
{
taxAmount = value;
}
If the implementation of the field changes then it should only be necessary to modify the setter and getter thus avoiding changes to the code in the rest of the class.
|
|
|
|
|
Message Closed
modified 16-Apr-20 11:19am.
|
|
|
|
|
This question was answered, by me, four years ago. Please focus on current questions, and also ensure that you are responding to the correct person.
|
|
|
|
|
Rep point hunter: he's plagiarising semi-relevant crap and trying to hide it in old posts: Plagiarism in the forums (Sherin_Mathew)[^]
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Thanks, I didn't spot that.
|
|
|
|
|
I have a requirement to fetch the details from pos transaction and use it in my application(Based on Java) for business purpose.
Please suggest best possible solution to proceed.
on discussions i found few possible solution to start are Applets or Active X . But didnt get much information on how to start with any of the above option or any other possible solution.
Any input will be really appreciated
Thanks in advance
|
|
|
|
|
The first thing to research is how the POS presents its data, and through what interface.
|
|
|
|
|
I am unable a to understand a concept. double variable and double array are declared outside the function and a function which increments the value of both is made. Values from the functions are not returned still the value of the double array gets incremented where as it is not the same case with double variable. Why ? Same with Double class
double x = 100.5;
p.m1( x );
System.out.println("" + x);
double[] xa1 = {10,20,30,40};
for (int i=0;i<4;i++){
System.out.println(xa1[i]);
}
public void m1(double a) {
a += 100;
}
public void m5(double[] x) {
for(int i=0; i < x.length; i++)
x[i] += 100;
}
OUTPUT : 100.5
110.0 120.0 130.0 140.0
|
|
|
|
|
'a' is an instance and it is copied when you call m1().
'x' is a reference so when 'x' is used in m5() the original, not a copy is used.
The above is a simple explanation and it is not exactly true semantically but is true conceptually. But without understanding what you are trying to understand I don't want to explain what is actually going on.
|
|
|
|
|
hi
i would like to ask if its possible to run the selenium webdriver to attached to an existing opened browser.
i tried to do a simple google and varies tried the suggested result of using remotewebdriver and profiles but both didnt work as they still opened a new browser.
does anyone know how to do this?
|
|
|
|
|
help out with this question plz
|
|
|
|
|
You didn't say what help you need.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
|
am developing a spring mvc web application.
in WEB-INF/context.xml am not mensioning any path.then how to get the context path into the jsp.
If i have path="/abc" in context.xml then in jsp
<a href="${pageContext.request.contextPath}"/> gives context path in localhost as
localhost:8080/abc
but in my application we r not mensioning any path attribute in context.xml so how can i get
localhost:8080 path
modified 30-Jan-16 4:22am.
|
|
|
|
|
private method using inherit in class
|
|
|
|
|
Is that a question or a statement?
|
|
|
|
|
|
how to read large 8gb json text file in java program.
I am try with FileInputStream in java but after 2gb it's not work.
|
|
|
|