Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Answer in Java...Read Instructions carefully Previously, you have practiced how to draw a UML class diagram from your code. In this activity, you are given

Answer in Java...Read Instructions carefully

Previously, you have practiced how to draw a UML class diagram from your code. In this activity, you are given class diagrams and you are asked to implement their code in CodingRooms.

1) Go to our CodingRooms course.

2) Under Workshops, click on Module 4 - Workshop Activity #2.

3) You will see three files in the activity: Notebook.java, Note.java, NotebookDriver.java,

4) You should implement Note.java using the following class diagram:

image text in transcribed

5) You should implement Notebook.java using the following class diagram:

image text in transcribed

Note: Underlined fields and methods are static. 6) Use NotebookDriver.java to test your implementation in 4 & 5. Uncomment the lines 8 to 19 and run your program to check if it is producing the expected output. --------------------------------------GIVEN:--------------------------------------------

--------------------------NOTEBOOKDRIVER.JAVA----------------

import java.util.*;

public class NotebookDriver {

public static void main(String[] args) {

System.out.println("This is the main method to test Notebook.java");

// Notebook myNotebook = new Notebook();

// Note myNote = new Note();

// myNote.setCategory("ITS1213");

// myNote.setTitle("UML diagrams");

// myNote.setBody("A UML class diagram consists of one or more classes,"

// + " each with sections for the class name, attributes (data), "

// + "and operations (methods)");

// myNote.setDate("2/8/2022");

// myNotebook.addNote(myNote);

// for(Note aNote:myNotebook.getNotes()){

// System.out.println("Note title "+ aNote.getTitle());

}

}

-------------------------------NOTEBOOK.JAVA -------------------

public class Notebook{

public Notebook(){

}

}

---------------------------------NOTE.JAVA--------------------------------------------

public class Note{

public Notes(){

}

}

\begin{tabular}{|l|} \hline \multicolumn{1}{|c|}{ Note } \\ \hline - id: int \\ - category: String \\ - title: String \\ - body: String \\ - date: String \\ + Note() \\ + Note(String,String,String,String) \\ + getCategory(): String \\ + setCategory(String) \\ + getTitle(): String \\ + setTitle(String) \\ + getBody(): String \\ + setBody(String) \\ + getDate(): String \\ + setDate(String) \\ \\ \hline \end{tabular} \begin{tabular}{|l|} \hline \multicolumn{1}{|c|}{ Notebook } \\ \hline - subject: String \\ - owner: String \\ - notes: ArrayList \\ - nextNoteld: int \\ \hline \\ + Notebook() \\ + Notebook(String,String) \\ + Notebook(String,String, ArrayList) \\ + getSubject(): String \\ + setSubject(String) \\ + getOwner(: String \\ + setOwner(String) \\ + getNotes(): ArrayList \\ + setNotes(ArrayList) \\ + addNote(Note) \\ + deleteNote(Note): boolean \\ + updateNote(Note) \\ - updateNextNoteld() \\ + getNextNoteld(): \\ \end{tabular}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Oracle Database Architecture

Authors: Thomas Kyte, Darl Kuhn

3rd Edition

1430262990, 9781430262992

More Books

Students also viewed these Databases questions