Plate Distribution - Report
Plate Distribution - Report
Plate Distribution - Report
ON
Submitted by
USN NAME
2SD18CS117 TEJASWINI P A
2SD18CS118 USHA NANDINI
2SD18CS119 VAIBHAV N
2SD18CS120 VARSHINI D
Table of Contents
Page 1 of 23
Plate Distribution
PROBLEM STATEMENT
The proposed system is to develop and design a plate distribution system that
looks into the process of collection of plates that are arranged in a stack by
students who are standing in a queue.
CHAPTER 1: INTRODUCTION
Every hostel has a mess. In the mess, the plates are arranged one on top of the
other (they are stacked up) and to collect these plates, the students have to stand
in a queue. The students enter the queue (insert), collect the plates and exit the
queue (delete).
By using the combination of stack and queue, a code has been written to
understand this routine easily.
The number of plates present in the stack after students pick the plates up from
the top (pop) and the staff place washed plates on the stack (push) can be easily
predicted. Also, if the number of plates present in the stack are sufficient for the
students standing in the queue, extra plates cannot be added.
State Diagrams
Class Diagram
Hardware Requirements:
i3 Processor
256 MB Ram
512 KB Cache Memory
Hard Disk 10GB
Software Requirements:
Operating System : Windows
Web-Technology : Java
Non-functional Requirements:
• Maintainability
• Portability
• Readability
• Sufficiency and Completeness
• Consistency
• Adaptability
CHAPTER 4: IMPLEMENTATION
Implementation is the stage where the theoretical design is turned into a working
system.
Design Specification:
Test Cases
StackTest
class StackTest {
void test() {
Stack stk = new Stack();
stk.setSize(3);
QueueTest
class QueueTest {
void test() {
Queue que = new Queue();
que.setSize(3);
Test Case-1: State->Queue Empty
que.delete();
boolean result1 = que.isEmpty();
if(result1==true)
{
System.out.println("Test Case 1 is successful,Queue is empty");
}
else
{
System.out.println("Test Case 1 is not successful, Queue is not
empty");
}
//Students entering the queue
que.insert(100);
CHAPTER 5: RESULTS
When the number of plates the staff is putting back is greater than the number of students:
CHAPTER 6: OUTCOMES
STUDENT OUTCOMES:
• We learnt how to develop test cases and write a program to test reusable
objects.
• We learnt how to incorporate a lot of features we had studied in our code
and also learnt how to apply them in a business scenario.
• We got to practice Pair programming – an agile software development
technique. We learnt how to work in a team and coordinate with each other.
PROJECT OUTCOMES:
Naming convention and consistency – The written code follows the naming
convention. The name of the package, classes, methods are given according to
their function. The code is uniform and consistent and hence is more reliable.
/**
* To insert plate into the stack
* @param x value to be inserted
* return-type void
*/
void insert(int x) {
//if stack is full
if(isFull()) {
System.out.println();
System.out.println("=======================================
===================");
System.out.println("=======================================
===================");
System.out.println("It's an Overflow,so we can't put back your
plate back.....");
System.out.println("=======================================
===================");
System.out.println("=======================================
===================");
System.out.println();
return;
}
Department of Computer Science and Engineering, SDMCET, Dharwad. 18
Plate Distribution
//else
stk[++top]=x;
System.out.println("Thank you... You have successfully inserted your
plate");
}
Sample Code:
package com.sdmect.iopp_project;
Sample Code:
//If we want to add any methods in any class, modifications need not //to be done
in other classes
package com.sdmect.iopp_project;
Department of Computer Science and Engineering, SDMCET, Dharwad. 19
Plate Distribution
/**
* class name: Stack
* functions: isEmpty(),isFull(),peek(),insert(),delete(),peek()
* return-type: boolean,void,int
*
*/
/**
* to get the size the Stack
* @return int
* return the size of the stack
*/
void getSize() {
return size;
}
}//end of the class Stack
Testability - The code has been designed and implemented to make it easier for
tests to achieve complete and repeatable code path coverage and simulates all
usage situations in a cost-efficient manner.
Sample Code:
Test Case-3: State->Stack Full
stk.insert(4);
boolean result2 = stk.isFull();
if(result2==true)
{
System.out.println("Test Case 3 is successful, Stack is full");
}
Department of Computer Science and Engineering, SDMCET, Dharwad. 20
Plate Distribution
else
{
System.out.println("Test Case 3 is not successful, Stack is not
full");
}
//If we need any change we can do it in particular classes according to the need
package com.sdmect.iopp_project;
/**
* class name: Queue
* functions: isEmpty(),isFull(),peek(),insert(),delete(),peek()
* return-type: boolean,void,int
*
*/
/**
* to get the size the Queue
* @return int
* return the size of the queue
*/
void getSize() {
return size;
}
}//end of the class Queue
Sample Code:
System.out.println("Enter your ID");
studentID=sc.nextInt();
//queue is full
if(studentID==queue1.peek()) { //beginning of if
System.out.println("----------------------------------------------------------");
//Functional dependency
stk1.delete(); //one plate gets removed from the Stack
queue1.delete(); //one students goes out of the Queue
System.out.println("----------------------------------------------------------");
}//end of if
Completeness – The written code is complete as it has all the necessary and
appropriate parts and meets all the requirement of the project.
CHAPTER 6: CONCLUSION
This program has been designed in such a way that, it makes the plate
distribution process in hostel messes more organized, systematic and less chaotic.
The program has been written by taking most of the possible cases into
consideration. We have also incorporated all the important features in the
program.