This document is a coursework for Object-Oriented Programming. It includes an introduction, class diagram, code for extra classes, white box testing, and screenshots of the program working.
Contribute Materials
Your contribution can guide someone’s learning journey. Share your
documents today.
Page0of23 [Your name or enrolment number] University of Greenwich [Date] COMP1752 – Object-Oriented Programming
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
Table of Contents 1Introduction..............................................................................................................................3 2Class Diagram..........................................................................................................................4 2.1The Class Diagram............................................................................................................4 2.2A Brief Explanation of the Diagram.................................................................................4 3The Code for the Extra Classes Created..................................................................................5 3.1Class ….............................................................................................................................5 3.2Class ….............................................................................................................................5 3.3Class ….............................................................................................................................5 3.4Class ….............................................................................................................................5 4White Box Testing...................................................................................................................6 4.1Testing for class …...........................................................................................................6 4.2Testing for class …...........................................................................................................6 4.3Testing for class …...........................................................................................................6 4.4Testing for class …...........................................................................................................6 5Screen Shots of the Program Working....................................................................................7 5.1Screen 1 - ….....................................................................................................................7 5.2Screen 1 – A brief description...........................................................................................7 5.3Screen 2 - ….....................................................................................................................7 5.4Screen 2 – A brief description...........................................................................................7 5.5Screen 3 - ….....................................................................................................................7 5.6Screen 3 – A brief description...........................................................................................7 6The Evaluation.........................................................................................................................8 6.1What went well?................................................................................................................8 6.2What went less well?.........................................................................................................8 6.3What was learned?............................................................................................................8 6.4How would a similar task be completed differently?.......................................................8 6.5How could the course be improved?.................................................................................8 7Self-Grading............................................................................................................................9 Page1of23
1INTRODUCTION The project done is a java based coursework recording system which is used to record classwork notes and save then in form of module, coursework and the date under which the work or lecture took place. The program allows the user to run it on computers which runs on a windows operating system. The application has a very interactive user interface that the users of the system can be able to interact with the program easily and effectively. The features which I have implemented in the system includes the following. 1.The style for programming is java programming language in netbeans IDE. 2.The program is able to record the lectures in the class and save the same on a text file which can even be opened I a word file. 3.The program has a search engine which allows the user to find relevant information easily. 4.The program allows the user to add note whenever they wants to in accordance with the module and the coursework of the notes. 5.The program is a very effective closing and exiting program option where on closure, it only affects the panel under effect and the main panel remains open till next closure. 6.It has an option where the courses can be viewed and chosen before the notes are recorded and saved. Page2of23
2.2A BRIEFEXPLANATIONOFTHEDIAGRAM From the class diagram seen above, the coursework class is taken as the main class since it’s the class that contains the main class. All other classes depends on the main class for execution. In this case, during the execution of the program, the coursework class id first loaded which has the features that allows user of the program to search the keywords of the program, check the courses in the module, open a new note to write the lecture notes on. The class named CWDetails allows he user of the system to choose the files which were previously saved in form on text for easy retrieval. The class is also created on a user interface for easy and quick navigation by the user and also making the system more interactive. The class AllNotes is used for the execution of the read and write of the text files. To read and write on the system as the notes are being saved. The design was chosen this way in order to make it easier for the system to be navigated. The classes and opening of different user interfaces makes it easy for the user to distinguish between the different and various functionalities of the system. Page4of23
3THECODEFORTHEEXTRACLASSESCREATED Add the code you have written for each of the classes implemented here. Copy and paste relevant code - actual code please, not screen shots! Make it easy for the tutor to read. Add explanation if necessary – though your in-code comments should be clear enough. Please DO NOT just DUMP all the code you’ve written! Include and describe the bits that specifically implement the features actually implemented. 3.1CLASSNOTE public class Note extends CommonCode { private int noteID = 0; private String course = ""; private String dayte = ""; private String note = ""; public Note() { } public Note(int max, String crs, String nt) { setNoteID(max); setCourse(crs); setDayte(); setNote(nt); } public Note(int nid, String crs, String dt, String nt) { setNoteID(nid); setCourse(crs); setDayte(dt); setNote(nt); } Page5of23
public int getNoteID() { // Any checking goes here. return noteID; } public final void setNoteID(int n) { int nid = n; noteID = nid; } public String getCourse() { return course; } public final void setCourse(String c) { String crse = c; // Any validation goes here. course = crse; } public String getDayte() { return dayte; } public final void setDayte() { dayte = orderedDate; } public final void setDayte(String dt) { dayte = dt; Page6of23
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
} public final void setNote(String n) { note = n; } public String getNote() { return note; } 3.2CLASSCOURSEWORK CommonCode cc = new CommonCode(); JPanel pnl = new JPanel(new BorderLayout()); JTextArea txtNewNote = new JTextArea(); JTextArea txtDisplayNotes = new JTextArea(); JTextField search = new JTextField(); ArrayList<String> note = new ArrayList<>(); ArrayList<String> course = new ArrayList<>(); JComboBox courseList = new JComboBox(); String crse = ""; AllNotes allNotes = new AllNotes(); public static void main(String[] args) { // This is required for the coursework. //JOptionPane.showMessageDialog(null, "Andy Wicks - wa02"); Coursework prg = new Coursework(); } // Using MVC public Coursework() { model(); Page7of23
view(); controller(); } @Override public void actionPerformed(ActionEvent ae) { if ("Coursework".equals(ae.getActionCommand())) { CWDetails cw = new CWDetails(); } if ("Course".equals(ae.getActionCommand())) { crse = courseList.getSelectedItem().toString(); System.out.println(crse); } if ("Exit".equals(ae.getActionCommand())) { System.exit(0); } if ("NewNote".equals(ae.getActionCommand())) { addNote(txtNewNote.getText()); txtNewNote.setText(""); } if ("SearchKeyword".equals(ae.getActionCommand())) { String lyst = allNotes.searchAllNotesByKeyword("", 0, search.getText()); txtDisplayNotes.setText(lyst); } } 3.3CLASSALLNOTES public void addNote(int maxID, String course, String note) { Note myNote = new Note(maxID, course, note); Page8of23
JMenu fyle; JToolBar toolBar = new JToolBar(); Font fnt = new Font("Georgia", Font.PLAIN, 36); // Setting up the MenuBar menuBar = new JMenuBar(); fyle = new JMenu("File"); fyle.setToolTipText("File tasks"); fyle.setFont(fnt); JMenuItem mnuItem = null; mnuItem = makeMenuItem("New", "New", "Create a new something or other", fnt); fyle.add(mnuItem); fyle.addSeparator(); mnuItem = makeMenuItem("Close", "Close", "Close something or other", fnt); fyle.add(mnuItem); menuBar.add(fyle); mnuItem = makeMenuItem("Exit", "Exit", "Close this program", fnt); menuBar.add(mnuItem); setJMenuBar(menuBar); setLayout(new BorderLayout()); Page10of23
// Use setSize and setLocationRelative for a specific // size of window or setExtendedState to fill the screen. // //setSize(500, 500); //setLocationRelativeTo(null); setExtendedState(JFrame.MAXIMIZED_BOTH); setTitle("This is the title"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPanel lft = new JPanel(); lft.setLayout(new FlowLayout()); JLabel lf = new JLabel("<html><body>West</body></html>"); lf.setFont(fnt); lft.add(lf); add(lft, BorderLayout.WEST); JPanel cen = new JPanel(); cen.setLayout(new FlowLayout()); JLabel cenLbl = new JLabel("<html><body>Hello There :-)</body></html>"); cenLbl.setFont(fnt); cen.add(cenLbl); add(cen, BorderLayout.CENTER); JPanel rgt = new JPanel(); rgt.setLayout(new FlowLayout()); JLabel rt = new JLabel("<html><body>East</body></html>"); rt.setFont(fnt); rgt.add(rt); add(rgt, BorderLayout.EAST); Page11of23
JPanel bot = new JPanel(); bot.setLayout(new FlowLayout()); JLabel copy = new JLabel("<html><body>Copyright (c) XXXXXXXXXX 2019</body></html>"); copy.setFont(fnt); bot.add(copy); add(bot, BorderLayout.SOUTH); setVisible(true); // Setting up the ButtonBar JButton button = null; button = makeNavigationButton("Create", "Return2Notes", "Return to the Notes window", "Notes"); toolBar.add(button); button = makeNavigationButton("closed door", "Close", "Close this thing", "Close"); toolBar.add(button); toolBar.addSeparator(); button = makeNavigationButton("exit", "Exit", "Exit from this program", "Exit"); toolBar.add(button); add(toolBar, BorderLayout.NORTH); } Page12of23
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
private void controller() { // This is the logic of the program. } Page13of23
4WHITEBOXTESTING 4.1TESTINGFORCLASSALLNOTES Test Number ConditionInput TypeResultsRule 01if (!"File not found".equals(readNotes.get(0))) { allNotes.clear(); for (String str : readNotes) { String[] tmp = str.split("\t"); int nid = Integer.parseInt(tmp[0]); Note n = new Note(nid, tmp[1], tmp[2], tmp[3]); allNotes.add(n); if (nid > maxID) { maxID = nid; } } } maxID++; ArrayList<String > readNotes = new ArrayList<>(); No notes found Yes 4.2TESTINGFORCLASSCOMMONCODE Test NumberConditionInput TypeResults 01if ((fileName == null) || (fileName.equals(""))) { System.out.println("No file name specified."); } else { try { BufferedReader in = new BufferedReader(new FileReader(fileName)) public ArrayList<String> readTextFile(String fileName) { ArrayList file = new ArrayList(); String line; The file not specified Yes Page14of23
; if (! in.ready()) { throw new IOException(); } while ((line = in.readLine()) != null) { file.add(line); } in.close(); } catch (IOException e) { System.out.println(e); file.add("File not found"); } } return file; 4.3TESTINGFORCLASSCOURSEWORK Test Number ConditionInput Type Results 01if ("Coursework".equals(ae.getActionCommand())) { CWDetails cw = new CWDetails(); } if ("Course".equals(ae.getActionCommand())) { crse = courseList.getSelectedItem().toString(); System.out.println(crse); } if ("Exit".equals(ae.getActionCommand())) { System.exit(0); } if ("NewNote".equals(ae.getActionCommand())) { addNote(txtNewNote.getText()); txtNewNote.setText(""); } User interface buttons Exits the system Close the panel Create new notes panel Search the information Page15of23
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
if ("SearchKeyword".equals(ae.getActionCommand()) ) { String lyst = allNotes.searchAllNotesByKeyword("", 0, search.getText()); txtDisplayNotes.setText(lyst); } } 4.4TESTINGFORCLASSCWDETAILS Test Numbe r ConditionInput TypeResult s 01JPanel cen = new JPanel(); cen.setLayout(new FlowLayout()); JLabel cenLbl = new JLabel("<html><body>H ello There :-)</body></html>"); cenLbl.setFont(fnt); cen.add(cenLbl); add(cen, BorderLayout.CENTER); setExtendedState(JFrame.MAXIMIZED_BO TH); Hello There Page16of23
5SCREENSHOTSOFTHEPROGRAMWORKING 5.1SCREEN1 -NOTES 5.2SCREEN1 – ABRIEFDESCRIPTION The above screenshot is the user interface which is used by the user to record the notes before it is saved. The panel has a notes tab where the all the notes which are were previously written are able to be retrieved in case its needed. The panel as a close option which allows only the panel under action to be closed. Dispose syntax is used. The exit action is used to close the whole system though it will prompt the user that the system is about to close. Page17of23
5.3SCREEN2 -COURSEWORK 5.4SCREEN2 – ABRIEFDESCRIPTION The above is the main screen or the main panel of the system. It has a add notes button that once its clicked, the new page for the user to record the notes comes out. The user is able to write notes it wished to. The coursework button is used to choose the courses which are to be done. The modules are also found here. The frame has a search engine which allows the user to search all the information which was previously saved. The exit button is also used to close down the whole system. Page18of23
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
6THEEVALUATION 6.1WHATWENTWELL? The program is able to launch well, its able to record new notes and store them in module folder which are again created by the program. Its able to search for information which are stored previously into the system. The program is able to add a module to the list of modules which were previously added. Inside the module the program coursework can also be added. The program is able to add notes into the list of requirements given. 6.2WHATWENTLESSWELL? The only aspect that was not well captured is the auto importation of the text file into processing file. This was the aspect which was to be covered though not part of the requirement. 6.3HOWWOULDYOURATEYOURAPPLICATION? Since all the requirements which was asked were fulfilled, I could personally rate this work at 95% complete and 4.8 star. Which implies that the work was well done though the system can never miss is bugs and runtime downtimes and backtracks. 6.4WHATWASLEARNED(TECHNICALANDOTHERWISE)?COULDYOU APPLYWHATYOU’VELEARNEDTOOTHERPROJECT? So much as this was my target all through, to implement this technical programming skills to other projects which may otherwise need the same skills to be applied. 6.5HOWWOULDASIMILARTASKBECOMPLETEDDIFFERENTLY? This task can be completed using javafx and java gui design techniques. This can be done using netbeans IDE, where the task is first designed and the code is then implemented. With this, the notes can even be stored in form of either pdf using java pdf reporting techniques. Page19of23
7SELF-GRADING Please assess yourself objectively for each section shown below and then enter the total mark you expect to get. Viva 1 (5) Not attended or no work demonstrated – 0 Work demonstrated was not up to the standard expected – 1 to 2 Work demonstrated was up to the standard expected – 3 to 4 Work demonstrated exceeded the standard expected – 5 Viva 2 (5) Not attended or no work demonstrated – 0 Work demonstrated was not up to the standard expected – 1 to 2 Work demonstrated was up to the standard expected – 3 to 4 Work demonstrated exceeded the standard expected – 5 For this section I think I got:out of 10 Features implemented (15) Required features (up to 10) None of the required features implemented – 0 Partial implementation but with some bugs – 1 to 3 Partial implementation that is fully functioning – 4 to 6 All features implemented but with some bugs – 7 to 9 All features implemented and fully functioning – 10 Additional feature (implemented at hackathon) (up to 5) None of the required features implemented – 0 Partial implementation but with some bugs – 1 to 2 Partial implementation that is fully functioning – 2 to 3 All features implemented but with some bugs – 3 to 4 All features implemented and fully functioning – 5 For this section I think I got:out of 15 Professional programming style (5) Coding (up to 2.5) Indenting has not been used – 0 Indenting has been used occasionally – 0.5 Indenting has been used, but not regularly – 1 Indenting has been used regularly – 1.5 to 2 All code has been indented correctly – 2.5 Naming of variables, procedure and classes (up to 2.5) Professional naming has not been used – 0 Professional naming has been used occasionally – 0.5 Professional naming has been used, but not regularly – 1 Professional naming has been used regularly – 1.5 to 2 Page20of23
All items have been named professionally correctly – 2.5 For this section I think I got:out of 10 Use of OOP techniques (40) Abstraction (15) No extra classes or objects have been created – 0 Classes and objects have been created superficially – 1 to 3 Classes and objects have been created and used correctly – 4 to 7 New and useful classes and objects have been created – 8 to 11 The use of classes and objects exceeds the specification – 12 to 15 Encapsulation (10) No encapsulation has been used – 0 Class variables have been encapsulated superficially – 1 to 3 Class variables have been encapsulated correctly – 4 to 6 The use of encapsulation exceeds the specification – 7 to 10 Inheritance (10) No inheritance has been used – 0 Classes have been inherited superficially – 1 to 3 Classes have been inherited correctly – 4 to 6 The use of inheritance exceeds the specification – 7 to 10 Polymorphism (5) No polymorphism has been used – 0 A procedure has been polymorphised – 1 A procedure has been polymorphised and used appropriately – 2 to 3 The use of polymorphism exceeds the specification – 4 to 5 For this section I think I got:out of 40 Testing (10) Testing has not been demonstrated in the documentation – 0 Little white box testing has been documented – 1 to 3 White box testing has been documented for all the coursework – 4 to 6 White box testing has been documented for the whole program – 7 to 10 For this section I think I got:out of 10 Evaluation (10) No evaluation was shown in the documentation – 0 The evaluation shows a lack of thought – 1 to 3 The evaluation shows thought – 4 or 5 The evaluation shows clearly demonstrates increased awareness – 6 to 10 For this section I think I got:out of 10 Page21of23
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Documentation (10) The documentation cannot be understood on first reading – 0 The documentation is readable, but a section(s) are missing – 1 to 3 The documentation is complete – 4 to 6 The documentation is complete and of a high standard – 7 to 10 For this section I think I got:out of 10 I think my overall mark would be:out of 100 Page22of23