Project 4 DB A Simple database program



Similar documents
CSE 308. Coding Conventions. Reference

LINKED DATA STRUCTURES

HW3: Programming with stacks

Data Structures and Algorithms Lists

Quiz 4 Solutions EECS 211: FUNDAMENTALS OF COMPUTER PROGRAMMING II. 1 Q u i z 4 S o l u t i o n s

Introduction to Programming System Design. CSCI 455x (4 Units)

Unit Testing & JUnit

BSc (Hons) Business Information Systems, BSc (Hons) Computer Science with Network Security. & BSc. (Hons.) Software Engineering

API for java.util.iterator. ! hasnext() Are there more items in the list? ! next() Return the next item in the list.

Questions 1 through 25 are worth 2 points each. Choose one best answer for each.

Analysis of a Search Algorithm

Abstract Data Type. EECS 281: Data Structures and Algorithms. The Foundation: Data Structures and Abstract Data Types

Computer Programming I

AP Computer Science Java Subset

D06 PROGRAMMING with JAVA

Creating Database Tables in Microsoft SQL Server

1.00 Lecture 1. Course information Course staff (TA, instructor names on syllabus/faq): 2 instructors, 4 TAs, 2 Lab TAs, graders

Practical Session 4 Java Collections

Author: Sascha Wolski Sebastian Hennebrueder Tutorials for Struts, EJB, xdoclet and eclipse.

CS 111 Classes I 1. Software Organization View to this point:


JUnit Automated Software Testing Framework. Jeff Offutt. SWE 437 George Mason University Thanks in part to Aynur Abdurazik. What is JUnit?

Vim, Emacs, and JUnit Testing. Audience: Students in CS 331 Written by: Kathleen Lockhart, CS Tutor

Using NetBeans IDE to Build Quick UI s Ray Hylock, GISo Tutorial 3/8/2011

dictionary find definition word definition book index find relevant pages term list of page numbers

CS 2112 Spring Instructions. Assignment 3 Data Structures and Web Filtering. 0.1 Grading. 0.2 Partners. 0.3 Restrictions

LAB 6: Code Generation with Visual Paradigm for UML and JDBC Integration

Data Tool Platform SQL Development Tools

Data Structures and Algorithms

CSCI 1301: Introduction to Computing and Programming Summer 2015 Project 1: Credit Card Pay Off

A TOOL FOR DATA STRUCTURE VISUALIZATION AND USER-DEFINED ALGORITHM ANIMATION

Storage Classes CS 110B - Rule Storage Classes Page 18-1 \handouts\storclas

Lecture 12 Doubly Linked Lists (with Recursion)

10 Java API, Exceptions, and Collections

Business Objects. Report Writing - CMS Net and CCS Claims

Visualising Java Data Structures as Graphs

Java CPD (I) Frans Coenen Department of Computer Science

How To Use The Command Pattern In Java.Com (Programming) To Create A Program That Is Atomic And Is Not A Command Pattern (Programmer)

Algorithms and Data Structures Written Exam Proposed SOLUTION

PLV Goldstein 315, Tuesdays and Thursdays, 6:00PM-7:50PM. Tuesdays and Thursdays, 4:00PM-5:30PM and 7:50PM 9:30PM at PLV G320

Data Structure [Question Bank]

Java 7 Recipes. Freddy Guime. vk» (,\['«** g!p#« Carl Dea. Josh Juneau. John O'Conner

Phase II: Design THE END OF THIS DOCUMENT IS DELIVERED TO THE CLIENT

JiST Graphical User Interface Event Viewer. Mark Fong

In this session, we will explain some of the basics of word processing. 1. Start Microsoft Word 11. Edit the Document cut & move

CS506 Web Design and Development Solved Online Quiz No. 01

A Brief Introduction to MySQL

JIDE Action Framework Developer Guide

10CS35: Data Structures Using C

Sample CSE8A midterm Multiple Choice (circle one)

Arrays. Atul Prakash Readings: Chapter 10, Downey Sun s Java tutorial on Arrays:

Some Scanner Class Methods

cs2010: algorithms and data structures

Software Development with UML and Java 2 SDJ I2, Spring 2010

Lynda.com > InDesign CS5 Tutorials Interactive Documents & Presentations

Queues Outline and Required Reading: Queues ( 4.2 except 4.2.4) COSC 2011, Fall 2003, Section A Instructor: N. Vlajic

CS297 Report. Accelerometer based motion gestures for Mobile Devices

Basic Excel Handbook

Image Management Suite. Mini Thesis. Roland Foster. Supervisors: Mr. Mehrdad Ghaziasgar and Mr. James Connan. B.Sc. Honours

AP Computer Science Java Mr. Clausen Program 9A, 9B

Data Structures Using C++ 2E. Chapter 5 Linked Lists

Responders: Language Support for Interactive Applications

Java the UML Way: Integrating Object-Oriented Design and Programming

Inside the Java Virtual Machine

Hands-On: Introduction to Object-Oriented Programming in LabVIEW

Collections in Java. Arrays. Iterators. Collections (also called containers) Has special language support. Iterator (i) Collection (i) Set (i),

Effective feedback from quality tools during development

Creating tables in Microsoft Access 2007

CHAPTER 4 ESSENTIAL DATA STRUCTRURES

Ohio University Computer Services Center August, 2002 Crystal Reports Introduction Quick Reference Guide

Software Engineering Techniques

Word 2007: Basics Learning Guide

Software Quality Exercise 2

MySQL for Beginners Ed 3

CIS 544 Advanced Software Design and Development. Project Management System. Oreoluwa Alebiosu

Data Structures in the Java API

ICAB4136B Use structured query language to create database structures and manipulate data

Japan Communication India Skill Development Center

CS 241 Data Organization Coding Standards

NICK COLLIER - REPAST DEVELOPMENT TEAM

Dinopolis Java Coding Convention

Android Application Development Course Program

Assignment 3 Version 2.0 Reactive NoSQL Due April 13

Notepad++ The COMPSCI 101 Text Editor for Windows. What is a text editor? Install Python 3

Testing, Debugging, and Verification

TESTING WITH JUNIT. Lab 3 : Testing

Excel 2003 Tutorial I

Lecture 11 Doubly Linked Lists & Array of Linked Lists. Doubly Linked Lists

JIDE Docking Framework Developer Guide

Topics. Parts of a Java Program. Topics (2) CS 146. Introduction To Computers And Java Chapter Objectives To understand:

PA Payroll Exercise for Intermediate Excel

DATA STRUCTURES USING C

Database Studio is the new tool to administrate SAP MaxDB database instances as of version 7.5.

Designing and Writing a Program DESIGNING, CODING, AND DOCUMENTING. The Design-Code-Debug Cycle. Divide and Conquer! Documentation is Code

UIL Computer Science for Dummies by Jake Warren and works from Mr. Fleming

Coding Rules. Encoding the type of a function into the name (so-called Hungarian notation) is forbidden - it only confuses the programmer.

Microsoft Access 3: Understanding and Creating Queries

Tutorial 5: Developing Java applications

A binary search tree or BST is a binary tree that is either empty or in which the data element of each node has a key, and:

KITES TECHNOLOGY COURSE MODULE (C, C++, DS)

Transcription:

Project 4 DB A Simple database program Due Date April (Friday) Before Starting the Project Read this entire project description before starting Learning Objectives After completing this project you should be able to: Create and manipulate linked lists and stacks Create your own OO design Write to and read from files Program Description Your assignment is to develop a program that implements a simple database program. Your program should be able to insert, delete, save, load, clear, display and edit. This database will hold student information such as, the student s name, G number, and GPA. (Other information would be maintained in another database, such as, the student local and permanent address, phone number, transcripts, and so on. However, for this project that information will not be included since it is a student project.) A fully implemented database (DB) will have the following functionality: Insert, delete and update a student into the DB Save and load the DB display the DB (Display the entire database) sort the DB ( Make this only available as a JMenu item) reverse the DB (Reverse, see notes below) undo operation (multi-undo operations) Remove duplicate (use the G number to determine a duplicate) Also do JUnit testing on your code. Steps 1 6 should be completed as a group. Steps 7 11 should be done after Steps 1 6, and 7-11 can actually be done in any order. Before you turn in your work: use the Java Style Guide to document your project. ( pts) Step 1: Create an Eclipse project named SimpleDatabasePrj Create a package named: package1 Create a class named: GUISimpleDatabase Create a class named: SimpleDatabasePanel // see Step 4 for details Create a class named: SimpleDatabase o Create a class named: Node // see Step 2 for details. o Create a class named: Student // see Step 3 for details. OTHER classes can be created without the instructor s approval. Step 2: Implement the class Student with the following properties. Include get and set methods were needed, and implement required methods from interface Comparable. 1

public class Student implements Comparable<Student> { private String name; private String gnumber; private double gpa; Step 3: Implement the class Node with the following properties. Include get and set methods where needed. private static class Node { public Student data; public Node next;... Actually type this class Node inside class LinkedList (which is specified next). Step 3 3/4: Implement the class "LinkedList" with the following properties: public class LinkedList implements Serializable { private int count; // The number of Nodes in the list private Node head; // a dummy Node at the front of the list... Step 4: Implement the class named: SimpleDatabasePanel. This GUI interface is only used to help demo your program. Make it simple since JUnit testing is the process in which your program will be tested. Using the programs found in chapter 6 of your book as a guide, create a main method that creates a JPanel object (SimpleDatabasePanel). The following is a suggestive screenshot; be sure to have appropriate input boxes, and appropriate scrollable output. Also, there are operations not included in this screen shot in the later steps of this project. Step 5: Java Interface to Implement You must include the following java interface ISimpleDatabase in your project. Important: For this step you are only required to implement: insert, delete, find, display. Have the class called SimpleDatabase that was specified in step 1 implement this ISimpleDatabase interface. interface ISimpleDatabase { /* used to insert a student into the DB, PLACE the STUDENTS in order based up */ /* the student's name */ void insert(student student); /* used to delete a student from the DB, use the to find the student */ boolean delete(string gnumber); 2

/* Use the gnumber to find the student */ /* you may only update the student's name and GPA. Not their gnumber */ boolean update(string gnumber, Student student); /* returns a string of the entire DB */ String tostring(); /* finds a Student, otherwise returns null */ Student find(string gnumber); /* reverses the database (see notes below) */ void reverselist(); /* removes duplicates from the database) */ void removeduplicates(); /* Sort the db using the compareto method contained in the Student class. */ /* Be sure to implement the comparable interface in the Student class */ /* sort by student's name, use the String.compareTo method */ void Sort(); /* undo the previous command */ boolean undo(); } /* Loads/saves using files, JUnit testing will test only these load * and save methods */ void loaddb(string filename); void savedb(string filename); Step 6: Create save and load methods with Serializable files Required: You are to create two versions, /* Loads/saves using String filename and the JUnits test using these methods */ void loaddb(string filename); void savedb(string filename); Step 7: Create many (lots and lots) of JUnit test cases that show your program functioning. JUnit testing is worth pts for your project! You must show through multi-test cases that your program is functioning correctly. Remember, the ISimpleDatabase interface is what the JUnit uses to test methods. For the following steps, please see the instructor if you have any questions, or concerns. Step 8: Implement the reverselist method. You are required to move the references (pointers) and not the data. Hence, a stack is not allowed. Step 9: Implement the removeduplicates. Find all students with the same gnumber, name and GPA. Remove all but one. In other words, one of the students should remain. Step A: Have the Student class implement the Comparable interface, and write a 3

sort() method that sorts the DB using the compareto() method. Specifically, sort the list according to students names using String.compareTo(). Step B: Implement an UNDO button that would be able to undo previous operations. The following operations should be able to be undone: Insert, delete, reverse, remove- Duplicates, sort, update. (NOTE: allow multi undos). Note: When a save or load operation is done, then reset the undo. That is, reset the undo- s stack immediately after a load or a save. Solution: save off the entire database every time a new operation was done. Talk to the instructor about how best to implement this operation. Step C: Re-implement the Node and LinkedList classes to make them a double linked list and have a dummy Node at the end of the list. public class Node { public Student data; public Node next; public Node prev; 4

Project 4: DB Student Name Date Submitted, Days Late, Late Penalty Graded Item Javadoc Comments and Coding Style/Technique (http://www.cis.gvsu.edu/studentsupport/javaguide) Code Indentation (auto format source code in IDE) Naming Conventions (see Java style guide) Proper access modifiers for fields and methods Use of helper (private) methods Using good variable names Header/class comments Every method uses @param and @return Every method uses a /***************** separator Overall layout, readability, No text wrap Using /** / for each Instance variable Has many inner inner comments Step 1-6: Basic operations Functionality void insert(student student); boolean delete(string gnumber); String tostring(); Student find(string gnumber); Save and load serializable; Step 7: Basic operations Functionality JUnit tesing Points Assigned 50 Comments Step 8: Reverse List functionality 5 Step 9: Remove Duplicates functionality 5 Step A: create a sort method / comparable 5 Step B: Undo functionality 5 Step C: Make it a doubly linked list (Keep a backup copy of your single linked list) Max Possible Points 0 Additional Comments: (How many hours did you spend developing this project?) 5