StudentShare solutions
Got a tricky question? Receive an answer from students like you! Try us!

Assignment example - Programming Project in Java

Only on StudentShare
Pages 8 (2008 words)
1. BurritoBrothers - Shop can be shared by multiple customers at a time, with a limit on total number of customers. Counter Semaphore can be used to keep check on number of customers getting entry into Burrito Brothers shop. Per problem counter semaphore should be initialized to 15.

Extract of sample

Since, there exist a single cash register and only one customer can access it at given moment. A binary semaphore can be used to control customers waiting to pay from paying together, but would ensure they pay one by one.
Since, customer with smallest order needs to get change to aquireCounter first Waiting Area is implemented as TreeSet which automatically sorts objects, if object implements Comparable interface. Customers just need to check whether they are first in Tree Set to know whether they are eligible to acuire Counter Location, if available.
World.log("Admitted one customer " +customer.getCustomerName() + ", additional space for " + customerSemaphore.availablePermits() + " customers available. Waiting area consits of " + customersWaitingForBurrito.toString());
World.log(serverName + " made " + burritosToMake + " burritos for " + customerToServe.getCustomerName() + ", customer still requires " + (customerToServe.getOrderBurritoCount() - customerToServe.getAcceptedBurritos()) + " burritos.");
Download paper
Not exactly what you need?

Related papers

Java programming and written exercises
2. Assume a class Square that implements the interface Comparable. You are required to implement the method compareTo so that squares are compared according to their sides. Part of the Java code has been provided as below. Please complete the code inside the compareTo() method.…
3 pages (753 words)
The first challenge of project management is ensuring that a project is delivered within the defined constraints. The second challenge is the optimized allocation and integration of the inputs needed to meet those pre-defined objectives. (The Gale Group 2002)…
6 pages (1506 words)
Java Game Programming, any future
The main feature of Java is that it is a platform independent language. The program can be written only once in Java and can be compiled in any operating system. To be simple it is write once, run anywhere. It is an object oriented, multithreaded programming language. (King 2000 ).…
15 pages (3765 words)
java assignment
4 pages (1004 words)
Can teaching the key ideas of object orientation be aided by using visual representations
These modern, re-engineered techniques have had a positive impact in the world of Programming, academic arenas and society at large: programming in teams, maintenance of large systems and software re-use.…
32 pages (8032 words)
Java Programming Code java
1 pages (251 words)