You could help me? :C | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

You could help me? :C

using the class queue, using the class linkedList,create an accumulation of 10 people in a mall. each person has name, total purchase and n quantity of products stored in a stack. of the products you know the name and cost. Print the corresponding values when walking through the queue. https://code.sololearn.com/cU8A8787s5YE/?ref=app https://code.sololearn.com/c8Z1wIAhnveL/?ref=app https://code.sololearn.com/cJ1kxVHN5LXO/?ref=app

28th Oct 2020, 7:08 PM
Alexis Domínguez Tadeo
Alexis Domínguez Tadeo - avatar
3 Answers
+ 1
delete } at end of class Ejecutable and same for Persona class also you are use old unchecked raw types in //Queue cola = new LinkedList(); better is: Queue<Integer> cola = new LinkedList<>();
28th Oct 2020, 10:32 PM
zemiak
0
Yes but in the Main I could put.?
29th Oct 2020, 1:24 AM
Alexis Domínguez Tadeo
Alexis Domínguez Tadeo - avatar
0
Yes main() but you will not want to store Integers there. --- As I look at logic this is strange Producto extends Persona better is eg Customer extends Persona { Stack<Producto> shoppingCart --- float precio; //don't do it in a production code --- this is not standard practice public void setnombre(String valornombre){ nombre = "nombre" + valornombre; add "nombre" in user output instead
29th Oct 2020, 2:17 AM
zemiak