SlideShare a Scribd company logo
1 of 10
CMSC 350 Project 4
The fourth programming project involves designing, writing and
testing a program that behaves like the Java
command line compiler. Whenever we request that the Java
compiler recompile a particular class, it not only
recompiles that class but every other class that depends upon it,
directly or indirectly, and in a particular order.
To make the determination about which classes need
recompilation, the Java compiler maintains a directed
graph of class dependencies. Any relationship in a UML class
diagram of a Java program such as inheritance
relationships, composition relationships and aggregations
relationships indicate a class dependency.
The main class P4GUI should create the Swing based GUI
shown below:
The GUI must be generated by code that you write. You may
not use a drag-and-drop GUI generator.
Pressing the Build Directed Graph button should cause the
specified input file that contains the class
dependency information to be read in and the directed graph
represented by those dependencies to be built.
The input file should be generated by the students using a
simple text editor such as Notepad. The input file
associated with the above example is shown below:
ClassA ClassC ClassE
ClassB ClassD ClassG
ClassE ClassB ClassF ClassH
ClassI ClassC
Each line of this file specifies classes that have other classes
that depend upon them. The first line, for example,
indicates that ClassA has two classes that depend upon it,
ClassC and ClassE. In the context of
recompilation, it means that when ClassA is recompiled, ClassC
and ClassE must be recompiled as well.
Using graph terminology, the first name on each line is the
name of a vertex and the remaining are its
associated adjacency list of dependent classes. Classes that have
no dependent classes need not appear at the
beginning of a separate line. Notice, for example, that ClassC is
not the first name on any line of the file.
After pressing the Build Directed Graph button, one of
following two messages should be generated depending
upon whether the specified file name could be opened:
Once the graph has been built, the name of a class to be
recompiled can be specified and the
Topological Order button can be pressed. Provided a valid class
name has been supplied, a topological order
algorithm should be executed that will generate (in the text area
at the bottom of the GUI window) the list of
classes in the order they are to be recompiled. The correct
recompilation order is any topological order of the
subgraph that emanates from the specified vertex.
An invalid class name should generate an exception and an
appropriate error message will be displayed in a
JOptionPane. If the graph contains a cycle among the Java
classes, an exception will be thrown and a message
will be displayed in a JOptionPane indicating that a cycle has
been detected.
Note. In the real compiling processes, when circular
dependencies exist in Java programs, the compiler must
make two passes over all the classes in the cycle. For this
program, it will be sufficient to display a message
indicating that a cycle has been detected.
In addition to the main class that defines the GUI, a second
class is needed to define the directed graph. It
should be a generic class allowing for a generic type of its
vertices. In this application the type of the vertices
will be String.
For better processing purposes, integer values will be used to
represent the vertices instead of Strings. The
graph should be represented as an array list of vertices (as
integer values) that contain a linked list of their
associated adjacency lists. The adjacency lists should be lists of
integers that represent the index rather than
vertex name itself. A hash map should be used to associate
vertex names with their index in the list of vertices.
For the input file shown above the array list of linked lists of
integers would be the following:
0 [1, 2]
1 []
2 [3, 6, 7]
3 [4, 5]
4 []
5 []
6 []
7 []
8 [1]
Storing the vertex indices rather than the names simplifies the
topological order algorithm. The hash map would
associate index 0 with ClassA, index 1 with ClassC, index 2
with ClassE and so on.
The directed graph class should define methods for initializing
the graph each time a new file is read in, for
adding a vertex to the graph, for adding an edge to the graph
and for generating a topological order given a
starting index. Other classes / methods could be also defined to
achieve the program requirements and/or to
better structuring the code.
Finally, custom checked exception classes should be defined for
the cases where a cycle occurs and when an
invalid class name is specified.
Your program should compile without errors. All instance
variables should be private and code duplication
should be avoided.
The Google recommended Java style guide
(https://google.github.io/styleguide/javaguide.html) should be
used
to format and document your code. Specifically, the following
style guide attributes should be addressed:
header comments include filename, author, date and brief
purpose of the program; In-line comments used to
describe major functionality of the code; the meaning and the
role of variables and constants are indicated as
code comments; meaningful variable names and prompts
applied; class names are written in UpperCamelCase;
variable names are written in lowerCamelCase; constant names
are in written in All Capitals; braces use K&R
style.
https://google.github.io/styleguide/javaguide.html
Submit the following to the Project 4 assignment area no later
than the due date listed in your LEO classroom.
1. All .java source files (no other file types should be
submitted). The source code should use Java code
conventions and appropriate code layout (white space
management and indents) and comments. All submitted
files may be included in a .zip file.
2. The solution description document P4
Solution
Description (.pdf or .doc / .docx) containing the following:
(1) Assumptions, main design decisions, error handling;
(2) A UML class diagram that includes all classes you wrote.
Do not include predefined classes. You need only
include the class name for each individual class, not the
variables or methods;
(3) A table of test cases including the test cases that you have
created to test the program. The table has 5
columns indicating (i) what aspect is tested, (ii) the input
values, (iii) the expected output, (iv) the actual output
and (v) if the test case passed or failed. Each test case will be
defined in a table row.
(4) Relevant screenshots of program execution;
(5) Lessons learned from the project;
Grading Rubric:
Criteria Meets Does Not Meet
Design
5 points 0 points
GUI is hand coded and matches required
design
GUI is generated by a GUI generator or
does not match required design
Includes generic class for a directed graph Does not include a
generic class a directed
graph
Graph is represented as an array list of
vertices that contain a linked list of their
associated adjacency lists
Graph is not represented as an array list
of vertices that contain a linked list of
their associated adjacency lists
Includes checked exception classes for cycles
and invalid class names
Does not Include checked exception
classes for cycles and invalid class names
Uses good object-oriented design practice
regarding code efficiency, encapsulation and
information hiding, class and code reuse,
high cohesion of classes, avoiding code
duplication.
Does not use good object-oriented design
practice regarding code efficiency,
encapsulation and information hiding,
class and code reuse, high cohesion of
classes, avoiding code duplication.
Functionality
10 points 0 points
Produces correct topological order for all
cases without cycles
Does not produce correct topological
order for all cases without cycles
Produces error message for all cases with
cycles
Does not produce error message for all
cases with cycles
Reports error message when file does not
open
Does not report error message when file
does not open
Reports error message when invalid class
name is entered
Does not report error message when
invalid class name is entered
Generates message confirming that graph
has been built
Does not generate message confirming
graph has been built
Test Cases
5 points 0 points
Test cases table is defined and included in
the P4

More Related Content

Similar to CMSC 350 Project 4 The fourth programming project involves.docx

CIS 406 Inspiring Innovation/tutorialrank.com
 CIS 406 Inspiring Innovation/tutorialrank.com CIS 406 Inspiring Innovation/tutorialrank.com
CIS 406 Inspiring Innovation/tutorialrank.comjonhson112
 
CIS 406 Effective Communication - tutorialrank.com
CIS 406 Effective Communication - tutorialrank.comCIS 406 Effective Communication - tutorialrank.com
CIS 406 Effective Communication - tutorialrank.comBartholomew21
 
Cis 406 Extraordinary Success/newtonhelp.com
Cis 406 Extraordinary Success/newtonhelp.com  Cis 406 Extraordinary Success/newtonhelp.com
Cis 406 Extraordinary Success/newtonhelp.com amaranthbeg148
 
Intro To C++ - Class 07 - Headers, Interfaces, & Prototypes
Intro To C++ - Class 07 - Headers, Interfaces, & PrototypesIntro To C++ - Class 07 - Headers, Interfaces, & Prototypes
Intro To C++ - Class 07 - Headers, Interfaces, & PrototypesBlue Elephant Consulting
 
CIS 406 Imagine Your Future/newtonhelp.com   
CIS 406 Imagine Your Future/newtonhelp.com   CIS 406 Imagine Your Future/newtonhelp.com   
CIS 406 Imagine Your Future/newtonhelp.com   bellflower47
 
CIS 406 Focus Dreams/newtonhelp.com
CIS 406 Focus Dreams/newtonhelp.comCIS 406 Focus Dreams/newtonhelp.com
CIS 406 Focus Dreams/newtonhelp.combellflower87
 
CIS 406 Life of the Mind/newtonhelp.com   
CIS 406 Life of the Mind/newtonhelp.com   CIS 406 Life of the Mind/newtonhelp.com   
CIS 406 Life of the Mind/newtonhelp.com   bellflower5
 
Evolution of c# - by K.Jegan
Evolution of c# - by K.JeganEvolution of c# - by K.Jegan
Evolution of c# - by K.Jegantalenttransform
 
Java interview questions and answers
Java interview questions and answersJava interview questions and answers
Java interview questions and answersKrishnaov
 
Object-oriented programming (OOP) with Complete understanding modules
Object-oriented programming (OOP) with Complete understanding modulesObject-oriented programming (OOP) with Complete understanding modules
Object-oriented programming (OOP) with Complete understanding modulesDurgesh Singh
 
UNIT II STATIC UML DIAGRAMS.pptx
UNIT II STATIC UML DIAGRAMS.pptxUNIT II STATIC UML DIAGRAMS.pptx
UNIT II STATIC UML DIAGRAMS.pptxanguraju1
 
Generics and collections in Java
Generics and collections in JavaGenerics and collections in Java
Generics and collections in JavaGurpreet singh
 
Teaching Case Teaching Software Componentization .docx
  Teaching Case  Teaching Software Componentization  .docx  Teaching Case  Teaching Software Componentization  .docx
Teaching Case Teaching Software Componentization .docxjoyjonna282
 
CIS 406 Entire Course NEW
CIS 406 Entire Course NEWCIS 406 Entire Course NEW
CIS 406 Entire Course NEWshyamuopfive
 
Abap Inicio
Abap InicioAbap Inicio
Abap Iniciounifor
 
Oo abap-sap-1206973306636228-5
Oo abap-sap-1206973306636228-5Oo abap-sap-1206973306636228-5
Oo abap-sap-1206973306636228-5prakash185645
 
Strayer cis 406 week 10 assignment 2 u grade new
Strayer cis 406 week 10 assignment 2 u grade newStrayer cis 406 week 10 assignment 2 u grade new
Strayer cis 406 week 10 assignment 2 u grade newdixonbakerr
 
Strayer cis 406 week 10 assignment 2 u grade new
Strayer cis 406 week 10 assignment 2 u grade newStrayer cis 406 week 10 assignment 2 u grade new
Strayer cis 406 week 10 assignment 2 u grade newshyaminfo40
 

Similar to CMSC 350 Project 4 The fourth programming project involves.docx (20)

CIS 406 Inspiring Innovation/tutorialrank.com
 CIS 406 Inspiring Innovation/tutorialrank.com CIS 406 Inspiring Innovation/tutorialrank.com
CIS 406 Inspiring Innovation/tutorialrank.com
 
CIS 406 Effective Communication - tutorialrank.com
CIS 406 Effective Communication - tutorialrank.comCIS 406 Effective Communication - tutorialrank.com
CIS 406 Effective Communication - tutorialrank.com
 
Cis 406 Extraordinary Success/newtonhelp.com
Cis 406 Extraordinary Success/newtonhelp.com  Cis 406 Extraordinary Success/newtonhelp.com
Cis 406 Extraordinary Success/newtonhelp.com
 
Intro To C++ - Class 07 - Headers, Interfaces, & Prototypes
Intro To C++ - Class 07 - Headers, Interfaces, & PrototypesIntro To C++ - Class 07 - Headers, Interfaces, & Prototypes
Intro To C++ - Class 07 - Headers, Interfaces, & Prototypes
 
CIS 406 Imagine Your Future/newtonhelp.com   
CIS 406 Imagine Your Future/newtonhelp.com   CIS 406 Imagine Your Future/newtonhelp.com   
CIS 406 Imagine Your Future/newtonhelp.com   
 
CIS 406 Focus Dreams/newtonhelp.com
CIS 406 Focus Dreams/newtonhelp.comCIS 406 Focus Dreams/newtonhelp.com
CIS 406 Focus Dreams/newtonhelp.com
 
CIS 406 Life of the Mind/newtonhelp.com   
CIS 406 Life of the Mind/newtonhelp.com   CIS 406 Life of the Mind/newtonhelp.com   
CIS 406 Life of the Mind/newtonhelp.com   
 
Evolution of c# - by K.Jegan
Evolution of c# - by K.JeganEvolution of c# - by K.Jegan
Evolution of c# - by K.Jegan
 
Java interview questions and answers
Java interview questions and answersJava interview questions and answers
Java interview questions and answers
 
Object-oriented programming (OOP) with Complete understanding modules
Object-oriented programming (OOP) with Complete understanding modulesObject-oriented programming (OOP) with Complete understanding modules
Object-oriented programming (OOP) with Complete understanding modules
 
UNIT II STATIC UML DIAGRAMS.pptx
UNIT II STATIC UML DIAGRAMS.pptxUNIT II STATIC UML DIAGRAMS.pptx
UNIT II STATIC UML DIAGRAMS.pptx
 
Generics and collections in Java
Generics and collections in JavaGenerics and collections in Java
Generics and collections in Java
 
Teaching Case Teaching Software Componentization .docx
  Teaching Case  Teaching Software Componentization  .docx  Teaching Case  Teaching Software Componentization  .docx
Teaching Case Teaching Software Componentization .docx
 
CIS 406 Entire Course NEW
CIS 406 Entire Course NEWCIS 406 Entire Course NEW
CIS 406 Entire Course NEW
 
Annotations
AnnotationsAnnotations
Annotations
 
Lecture 8 Library classes
Lecture 8 Library classesLecture 8 Library classes
Lecture 8 Library classes
 
Abap Inicio
Abap InicioAbap Inicio
Abap Inicio
 
Oo abap-sap-1206973306636228-5
Oo abap-sap-1206973306636228-5Oo abap-sap-1206973306636228-5
Oo abap-sap-1206973306636228-5
 
Strayer cis 406 week 10 assignment 2 u grade new
Strayer cis 406 week 10 assignment 2 u grade newStrayer cis 406 week 10 assignment 2 u grade new
Strayer cis 406 week 10 assignment 2 u grade new
 
Strayer cis 406 week 10 assignment 2 u grade new
Strayer cis 406 week 10 assignment 2 u grade newStrayer cis 406 week 10 assignment 2 u grade new
Strayer cis 406 week 10 assignment 2 u grade new
 

More from mccormicknadine86

Option #2Researching a Leader Complete preliminary rese.docx
Option #2Researching a Leader Complete preliminary rese.docxOption #2Researching a Leader Complete preliminary rese.docx
Option #2Researching a Leader Complete preliminary rese.docxmccormicknadine86
 
Option 1 ImperialismThe exploitation of  colonial resources.docx
Option 1 ImperialismThe exploitation of  colonial resources.docxOption 1 ImperialismThe exploitation of  colonial resources.docx
Option 1 ImperialismThe exploitation of  colonial resources.docxmccormicknadine86
 
Option Wireless LTD v. OpenPeak, Inc.Be sure to save an elec.docx
Option Wireless LTD v. OpenPeak, Inc.Be sure to save an elec.docxOption Wireless LTD v. OpenPeak, Inc.Be sure to save an elec.docx
Option Wireless LTD v. OpenPeak, Inc.Be sure to save an elec.docxmccormicknadine86
 
Option A Land SharkWhen is a shark just a shark Consider the.docx
Option A Land SharkWhen is a shark just a shark Consider the.docxOption A Land SharkWhen is a shark just a shark Consider the.docx
Option A Land SharkWhen is a shark just a shark Consider the.docxmccormicknadine86
 
Option 3 Discuss your thoughts on drugs and deviance. Do you think .docx
Option 3 Discuss your thoughts on drugs and deviance. Do you think .docxOption 3 Discuss your thoughts on drugs and deviance. Do you think .docx
Option 3 Discuss your thoughts on drugs and deviance. Do you think .docxmccormicknadine86
 
OPTION 2 Can we make the changes we need to make After the pandemi.docx
OPTION 2 Can we make the changes we need to make After the pandemi.docxOPTION 2 Can we make the changes we need to make After the pandemi.docx
OPTION 2 Can we make the changes we need to make After the pandemi.docxmccormicknadine86
 
Option 1 You will create a PowerPoint (or equivalent) of your p.docx
Option 1 You will create a PowerPoint (or equivalent) of your p.docxOption 1 You will create a PowerPoint (or equivalent) of your p.docx
Option 1 You will create a PowerPoint (or equivalent) of your p.docxmccormicknadine86
 
Option A Description of Dance StylesSelect two styles of danc.docx
Option A Description of Dance StylesSelect two styles of danc.docxOption A Description of Dance StylesSelect two styles of danc.docx
Option A Description of Dance StylesSelect two styles of danc.docxmccormicknadine86
 
Option #2Provide several slides that explain the key section.docx
Option #2Provide several slides that explain the key section.docxOption #2Provide several slides that explain the key section.docx
Option #2Provide several slides that explain the key section.docxmccormicknadine86
 
Option 2 Slavery vs. Indentured ServitudeExplain how and wh.docx
Option 2 Slavery vs. Indentured ServitudeExplain how and wh.docxOption 2 Slavery vs. Indentured ServitudeExplain how and wh.docx
Option 2 Slavery vs. Indentured ServitudeExplain how and wh.docxmccormicknadine86
 
Option 2 ArtSelect any 2 of works of art about the Holocaus.docx
Option 2 ArtSelect any 2 of works of art about the Holocaus.docxOption 2 ArtSelect any 2 of works of art about the Holocaus.docx
Option 2 ArtSelect any 2 of works of art about the Holocaus.docxmccormicknadine86
 
Option #1 Stanford University Prison Experiment Causality, C.docx
Option #1 Stanford University Prison Experiment Causality, C.docxOption #1 Stanford University Prison Experiment Causality, C.docx
Option #1 Stanford University Prison Experiment Causality, C.docxmccormicknadine86
 
Option A  Gender CrimesCriminal acts occur against individu.docx
Option A  Gender CrimesCriminal acts occur against individu.docxOption A  Gender CrimesCriminal acts occur against individu.docx
Option A  Gender CrimesCriminal acts occur against individu.docxmccormicknadine86
 
opic 4 Discussion Question 1 May students express religious bel.docx
opic 4 Discussion Question 1 May students express religious bel.docxopic 4 Discussion Question 1 May students express religious bel.docx
opic 4 Discussion Question 1 May students express religious bel.docxmccormicknadine86
 
Option 1Choose a philosopher who interests you. Research that p.docx
Option 1Choose a philosopher who interests you. Research that p.docxOption 1Choose a philosopher who interests you. Research that p.docx
Option 1Choose a philosopher who interests you. Research that p.docxmccormicknadine86
 
Option #1The Stanford University Prison Experiment Structu.docx
Option #1The Stanford University Prison Experiment Structu.docxOption #1The Stanford University Prison Experiment Structu.docx
Option #1The Stanford University Prison Experiment Structu.docxmccormicknadine86
 
Operationaland Organizational SecurityChapter 3Princ.docx
Operationaland Organizational SecurityChapter 3Princ.docxOperationaland Organizational SecurityChapter 3Princ.docx
Operationaland Organizational SecurityChapter 3Princ.docxmccormicknadine86
 
Open the file (Undergrad Reqt_Individual In-Depth Case Study) for in.docx
Open the file (Undergrad Reqt_Individual In-Depth Case Study) for in.docxOpen the file (Undergrad Reqt_Individual In-Depth Case Study) for in.docx
Open the file (Undergrad Reqt_Individual In-Depth Case Study) for in.docxmccormicknadine86
 
onsider whether you think means-tested programs, such as the Tem.docx
onsider whether you think means-tested programs, such as the Tem.docxonsider whether you think means-tested programs, such as the Tem.docx
onsider whether you think means-tested programs, such as the Tem.docxmccormicknadine86
 
Operations security - PPT should cover below questions (chapter 1 to.docx
Operations security - PPT should cover below questions (chapter 1 to.docxOperations security - PPT should cover below questions (chapter 1 to.docx
Operations security - PPT should cover below questions (chapter 1 to.docxmccormicknadine86
 

More from mccormicknadine86 (20)

Option #2Researching a Leader Complete preliminary rese.docx
Option #2Researching a Leader Complete preliminary rese.docxOption #2Researching a Leader Complete preliminary rese.docx
Option #2Researching a Leader Complete preliminary rese.docx
 
Option 1 ImperialismThe exploitation of  colonial resources.docx
Option 1 ImperialismThe exploitation of  colonial resources.docxOption 1 ImperialismThe exploitation of  colonial resources.docx
Option 1 ImperialismThe exploitation of  colonial resources.docx
 
Option Wireless LTD v. OpenPeak, Inc.Be sure to save an elec.docx
Option Wireless LTD v. OpenPeak, Inc.Be sure to save an elec.docxOption Wireless LTD v. OpenPeak, Inc.Be sure to save an elec.docx
Option Wireless LTD v. OpenPeak, Inc.Be sure to save an elec.docx
 
Option A Land SharkWhen is a shark just a shark Consider the.docx
Option A Land SharkWhen is a shark just a shark Consider the.docxOption A Land SharkWhen is a shark just a shark Consider the.docx
Option A Land SharkWhen is a shark just a shark Consider the.docx
 
Option 3 Discuss your thoughts on drugs and deviance. Do you think .docx
Option 3 Discuss your thoughts on drugs and deviance. Do you think .docxOption 3 Discuss your thoughts on drugs and deviance. Do you think .docx
Option 3 Discuss your thoughts on drugs and deviance. Do you think .docx
 
OPTION 2 Can we make the changes we need to make After the pandemi.docx
OPTION 2 Can we make the changes we need to make After the pandemi.docxOPTION 2 Can we make the changes we need to make After the pandemi.docx
OPTION 2 Can we make the changes we need to make After the pandemi.docx
 
Option 1 You will create a PowerPoint (or equivalent) of your p.docx
Option 1 You will create a PowerPoint (or equivalent) of your p.docxOption 1 You will create a PowerPoint (or equivalent) of your p.docx
Option 1 You will create a PowerPoint (or equivalent) of your p.docx
 
Option A Description of Dance StylesSelect two styles of danc.docx
Option A Description of Dance StylesSelect two styles of danc.docxOption A Description of Dance StylesSelect two styles of danc.docx
Option A Description of Dance StylesSelect two styles of danc.docx
 
Option #2Provide several slides that explain the key section.docx
Option #2Provide several slides that explain the key section.docxOption #2Provide several slides that explain the key section.docx
Option #2Provide several slides that explain the key section.docx
 
Option 2 Slavery vs. Indentured ServitudeExplain how and wh.docx
Option 2 Slavery vs. Indentured ServitudeExplain how and wh.docxOption 2 Slavery vs. Indentured ServitudeExplain how and wh.docx
Option 2 Slavery vs. Indentured ServitudeExplain how and wh.docx
 
Option 2 ArtSelect any 2 of works of art about the Holocaus.docx
Option 2 ArtSelect any 2 of works of art about the Holocaus.docxOption 2 ArtSelect any 2 of works of art about the Holocaus.docx
Option 2 ArtSelect any 2 of works of art about the Holocaus.docx
 
Option #1 Stanford University Prison Experiment Causality, C.docx
Option #1 Stanford University Prison Experiment Causality, C.docxOption #1 Stanford University Prison Experiment Causality, C.docx
Option #1 Stanford University Prison Experiment Causality, C.docx
 
Option A  Gender CrimesCriminal acts occur against individu.docx
Option A  Gender CrimesCriminal acts occur against individu.docxOption A  Gender CrimesCriminal acts occur against individu.docx
Option A  Gender CrimesCriminal acts occur against individu.docx
 
opic 4 Discussion Question 1 May students express religious bel.docx
opic 4 Discussion Question 1 May students express religious bel.docxopic 4 Discussion Question 1 May students express religious bel.docx
opic 4 Discussion Question 1 May students express religious bel.docx
 
Option 1Choose a philosopher who interests you. Research that p.docx
Option 1Choose a philosopher who interests you. Research that p.docxOption 1Choose a philosopher who interests you. Research that p.docx
Option 1Choose a philosopher who interests you. Research that p.docx
 
Option #1The Stanford University Prison Experiment Structu.docx
Option #1The Stanford University Prison Experiment Structu.docxOption #1The Stanford University Prison Experiment Structu.docx
Option #1The Stanford University Prison Experiment Structu.docx
 
Operationaland Organizational SecurityChapter 3Princ.docx
Operationaland Organizational SecurityChapter 3Princ.docxOperationaland Organizational SecurityChapter 3Princ.docx
Operationaland Organizational SecurityChapter 3Princ.docx
 
Open the file (Undergrad Reqt_Individual In-Depth Case Study) for in.docx
Open the file (Undergrad Reqt_Individual In-Depth Case Study) for in.docxOpen the file (Undergrad Reqt_Individual In-Depth Case Study) for in.docx
Open the file (Undergrad Reqt_Individual In-Depth Case Study) for in.docx
 
onsider whether you think means-tested programs, such as the Tem.docx
onsider whether you think means-tested programs, such as the Tem.docxonsider whether you think means-tested programs, such as the Tem.docx
onsider whether you think means-tested programs, such as the Tem.docx
 
Operations security - PPT should cover below questions (chapter 1 to.docx
Operations security - PPT should cover below questions (chapter 1 to.docxOperations security - PPT should cover below questions (chapter 1 to.docx
Operations security - PPT should cover below questions (chapter 1 to.docx
 

Recently uploaded

Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersChitralekhaTherkar
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 

Recently uploaded (20)

Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of Powders
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 

CMSC 350 Project 4 The fourth programming project involves.docx

  • 1. CMSC 350 Project 4 The fourth programming project involves designing, writing and testing a program that behaves like the Java command line compiler. Whenever we request that the Java compiler recompile a particular class, it not only recompiles that class but every other class that depends upon it, directly or indirectly, and in a particular order. To make the determination about which classes need recompilation, the Java compiler maintains a directed graph of class dependencies. Any relationship in a UML class diagram of a Java program such as inheritance relationships, composition relationships and aggregations relationships indicate a class dependency. The main class P4GUI should create the Swing based GUI shown below: The GUI must be generated by code that you write. You may not use a drag-and-drop GUI generator. Pressing the Build Directed Graph button should cause the specified input file that contains the class dependency information to be read in and the directed graph represented by those dependencies to be built. The input file should be generated by the students using a simple text editor such as Notepad. The input file associated with the above example is shown below: ClassA ClassC ClassE
  • 2. ClassB ClassD ClassG ClassE ClassB ClassF ClassH ClassI ClassC Each line of this file specifies classes that have other classes that depend upon them. The first line, for example, indicates that ClassA has two classes that depend upon it, ClassC and ClassE. In the context of recompilation, it means that when ClassA is recompiled, ClassC and ClassE must be recompiled as well. Using graph terminology, the first name on each line is the name of a vertex and the remaining are its associated adjacency list of dependent classes. Classes that have no dependent classes need not appear at the beginning of a separate line. Notice, for example, that ClassC is not the first name on any line of the file. After pressing the Build Directed Graph button, one of following two messages should be generated depending upon whether the specified file name could be opened: Once the graph has been built, the name of a class to be recompiled can be specified and the Topological Order button can be pressed. Provided a valid class name has been supplied, a topological order algorithm should be executed that will generate (in the text area at the bottom of the GUI window) the list of
  • 3. classes in the order they are to be recompiled. The correct recompilation order is any topological order of the subgraph that emanates from the specified vertex. An invalid class name should generate an exception and an appropriate error message will be displayed in a JOptionPane. If the graph contains a cycle among the Java classes, an exception will be thrown and a message will be displayed in a JOptionPane indicating that a cycle has been detected. Note. In the real compiling processes, when circular dependencies exist in Java programs, the compiler must make two passes over all the classes in the cycle. For this program, it will be sufficient to display a message indicating that a cycle has been detected. In addition to the main class that defines the GUI, a second class is needed to define the directed graph. It should be a generic class allowing for a generic type of its vertices. In this application the type of the vertices will be String. For better processing purposes, integer values will be used to represent the vertices instead of Strings. The graph should be represented as an array list of vertices (as integer values) that contain a linked list of their associated adjacency lists. The adjacency lists should be lists of integers that represent the index rather than vertex name itself. A hash map should be used to associate vertex names with their index in the list of vertices. For the input file shown above the array list of linked lists of integers would be the following: 0 [1, 2]
  • 4. 1 [] 2 [3, 6, 7] 3 [4, 5] 4 [] 5 [] 6 [] 7 [] 8 [1] Storing the vertex indices rather than the names simplifies the topological order algorithm. The hash map would associate index 0 with ClassA, index 1 with ClassC, index 2 with ClassE and so on. The directed graph class should define methods for initializing the graph each time a new file is read in, for adding a vertex to the graph, for adding an edge to the graph and for generating a topological order given a starting index. Other classes / methods could be also defined to achieve the program requirements and/or to better structuring the code. Finally, custom checked exception classes should be defined for the cases where a cycle occurs and when an invalid class name is specified.
  • 5. Your program should compile without errors. All instance variables should be private and code duplication should be avoided. The Google recommended Java style guide (https://google.github.io/styleguide/javaguide.html) should be used to format and document your code. Specifically, the following style guide attributes should be addressed: header comments include filename, author, date and brief purpose of the program; In-line comments used to describe major functionality of the code; the meaning and the role of variables and constants are indicated as code comments; meaningful variable names and prompts applied; class names are written in UpperCamelCase; variable names are written in lowerCamelCase; constant names are in written in All Capitals; braces use K&R style. https://google.github.io/styleguide/javaguide.html Submit the following to the Project 4 assignment area no later than the due date listed in your LEO classroom. 1. All .java source files (no other file types should be submitted). The source code should use Java code conventions and appropriate code layout (white space management and indents) and comments. All submitted files may be included in a .zip file. 2. The solution description document P4
  • 6. Solution Description (.pdf or .doc / .docx) containing the following: (1) Assumptions, main design decisions, error handling; (2) A UML class diagram that includes all classes you wrote. Do not include predefined classes. You need only include the class name for each individual class, not the variables or methods; (3) A table of test cases including the test cases that you have created to test the program. The table has 5 columns indicating (i) what aspect is tested, (ii) the input values, (iii) the expected output, (iv) the actual output and (v) if the test case passed or failed. Each test case will be defined in a table row. (4) Relevant screenshots of program execution; (5) Lessons learned from the project; Grading Rubric: Criteria Meets Does Not Meet
  • 7. Design 5 points 0 points GUI is hand coded and matches required design GUI is generated by a GUI generator or does not match required design Includes generic class for a directed graph Does not include a generic class a directed graph Graph is represented as an array list of vertices that contain a linked list of their associated adjacency lists Graph is not represented as an array list of vertices that contain a linked list of their associated adjacency lists Includes checked exception classes for cycles and invalid class names
  • 8. Does not Include checked exception classes for cycles and invalid class names Uses good object-oriented design practice regarding code efficiency, encapsulation and information hiding, class and code reuse, high cohesion of classes, avoiding code duplication. Does not use good object-oriented design practice regarding code efficiency, encapsulation and information hiding, class and code reuse, high cohesion of classes, avoiding code duplication. Functionality 10 points 0 points Produces correct topological order for all cases without cycles
  • 9. Does not produce correct topological order for all cases without cycles Produces error message for all cases with cycles Does not produce error message for all cases with cycles Reports error message when file does not open Does not report error message when file does not open Reports error message when invalid class name is entered Does not report error message when invalid class name is entered Generates message confirming that graph has been built Does not generate message confirming
  • 10. graph has been built Test Cases 5 points 0 points Test cases table is defined and included in the P4