SlideServe
Menu
Préférences
© SlideServe · v2026

Efficient Potato Sorting System for Restaurant Owners

taurus avatar
14 diapositives · 239 Views · Jul 27, 2014

Develop a program for restaurant owners to maximize profit by minimizing potato waste and effort in sorting. Use stack data structure to manage boxes efficiently. Algorithm required for managing deliveries. Inputs from text files.

Efficient Potato Sorting System for Restaurant Owners - slide 1
01 / 14Efficient Potato Sorting System for Restaurant Owners
1 / 17

Télécharger la présentation

Efficient Potato Sorting System for Restaurant Owners
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Assignment 2 Salim Malakouti

  2. Problem Definition? • Restaurant Owner • Sells only potatoes • Keep the profit Maximized Minimize potatoes wasted + Minimize effort

  3. Goal • In other words you are trying to keep the potatoes sorted with minimum effort possible

  4. What is the problem? • You are using a Stack(box) to keep the potatoes • You can use a separate temporary box(Stack) • You are keeping everything in the truck in a stack • You can’t take anything back to the truck. • You need your employee to carry boxes between these boxes or the truck.

  5. Code? • Use: take n from top of the main stack • Skip: Here you move on to the next day. So you should throw out any boxes that are expired + a message for each. • Report • A report for the latest delivery • A report for overall deliveries • Report include: • Number of boxes • Total cost • Cost of moving around • Quit

  6. Display • Display the content of the current box • Different methods • Alter toString method

  7. Receive *** • You receive a stack of boxes from file with the following format: <company>:<date>:<cost> • Example: receive 6 Spud Heaven:3:4.5 Potato Pot:4:5.0 Tuber Town:3:4.0 Perry's Potatoes:9:5.5 Potato Pot:10:5.0 SpudsRUs:3:4.0 • Hard Part: Giving an algorithm for itusingpops and pushes.

  8. Good Question? • Can we sort them in the file? NO • If you want to sort them you have to use the stacks that you have.

  9. A simple example? 1 3 4 3 5 4 1 8 5 10 9 8 9 10

  10. Important • You won’t have any interactive interface? • So how inputs are given? • Through input files.

  11. Sample Input File • display • report • use • 5 • receive • 5 • Fiveth:5:5.0 • Fourth:4:5.0 • Threeth:3:5.0 • Twoth:2:5.0 • Oneth:1:5.0 • display • report • quit • report • display • use • 8 • skip • receive • 4 • Bogus:0:100.0 • Weasel:0:150.0 • Squat:0:125.0 • Nada:0:100.0 • report • receive • 5 • Oneth:1:5.0 • Twoth:2:5.0 • Threeth:3:5.0 • Fourth:4:5.0 • Fiveth:5:5.0

  12. How to read the file? • You need to parse it? Ideas?

  13. Split function • String test = “1,2,3,4,5”; • String[] numbers = test.split(“,”); • System.out.print(numbers.length); OUT: 4 [“1”,”2”,”3”,”4”]