Microsoft Word - Assign 2 - BCS 345.docx ©Arthur Hoskey, PhD Assignment 2 – BCS 345 Java Programming Due: 10/6/2021 @ 10:50am Submission Guidelines Create a winzip file containing the WHOLE project...

1 answer below »







Microsoft Word - Assign 2 - BCS 345.docx ©Arthur Hoskey, PhD Assignment 2 – BCS 345 Java Programming Due: 10/6/2021 @ 10:50am Submission Guidelines Create a winzip file containing the WHOLE project directory and submit on Blackboard. IMPORTANT – Make sure you properly comment AND properly indent your program. The commenting and indenting documents are on Blackboard. If you fail to properly comment or properly indent points will be deducted. Programs with compile errors will have 50pts automatically taken off!!! Overview There are two main parts to this assignment. 1. Write a package that contains definitions for the SubDate, Student, and Submission classes (see below for specifications). 2. Write a package that uses the above classes (this will contain the Main class). We are writing two layers of software. There will be a business layer and a presentation layer. The presentation layer will use classes in the business layer. Packages ©Arthur Hoskey, PhD Create two packages in your project. The packages should be named com..business and com..presentation. Example Project/Package Setup: com.arthurhoskey.business  Package SubDate.java  Source file Student.java  Source file Submission.java  Source file com.arthurhoskey.presentation  Package Main.java  Source file Git Version Control The project directory you submit must be under Git version control. You should periodically execute commits to save your progress. You must execute at least three commits for this assignment during development. The commits should be spaced out evenly. Do not wait until the end of your development to do all the commits. Class Specifications Class – SubDate Store in business package. Member Variables (all private) Variable Data Type Description Month int Contains the month portion of the date. Day int Contains the day portion of the date. Year int Contains the year portion of the date. ©Arthur Hoskey, PhD Member Method Signatures and Descirptions (all public) Signature Description SubDate() Default constructor. Sets the values of each member variable to a default value. SubDate(int month, int day, int year) Constructor. Sets the values of each member variable to the corresponding parameter values. Get/Set methods Write get/set methods for all member variables. void readJSON(FileReader fr) Read the contents of all member variables from the given instance of FileReader as JSON. Assume the FileReader is open. void writeJSON(PrintStream ps) Write the member variables in JSON format to the given PrintStream. @Override String toString() This method should return a String instance (not print on the screen) that contains a formatted date. Here is an example of a string that gets returned from the method. Example date string: 9/1/2021 Class – Student Store in business package. Member Variables (all private) Variable Data Type Description First String Contains the first name. Last String Contains the last name. Major String Contains the major. ©Arthur Hoskey, PhD Member Method Signatures and Descriptions (all public) Signature Description Student() Default constructor. Sets the values of each member variable to a default value. Student(String first, String last, String major) Constructor. Sets the values of each member variable to the corresponding parameter values. Get/Set methods Write get/set methods for all member variables. void readJSON(FileReader fr) Read the contents of all member variables from the given instance of FileReader as JSON. Assume the FileReader is open. void writeJSON(PrintStream ps) Write the member variables in JSON format to the given PrintStream. @Override String toString() This method should return a string with descriptive text. All member variable should be represented in the string. Class – Submission Store in business package. Member Variables (all private) Variable Data Type Description Date SubDate Contains date. Assignment String Contains the assignment name. Score double Contains the numeric score for the submission. Member Method Signatures and Descirptions (all public) Signature Description Submission() Default constructor. Sets the values of each member variable to a default value. ©Arthur Hoskey, PhD Submission(SubDate d, String assignmentName, double score) Constructor. Sets the values of each member variable to the corresponding parameter values. Get/Set methods Write get/set methods for all member variables. void readJSON(FileReader fr) Read the contents of all member variables from the given instance of FileReader as JSON. Assume the FileReader is open. void writeJSON(PrintStream ps) Write the member variables in JSON format to the given PrintStream. @Override String toString() This method should return a string with descriptive text. Sample JSON File { "date": { "month": 9, "day": 1, "year": 2021 }, "assignment": "Lab 1", "score": 80.0 } Class – Main Store in presentation package. Member Variables (all private) Variable Data Type Description No member variables Member Method Signatures and Descirptions (all public) Signature Description ©Arthur Hoskey, PhD public static void main(String args[]) Code to show menu and process user choices goes here. UI Menu Description Write code in main that will present a menu to the user and then perform an action depending on what the user chooses to do. You should create an instance of Submission inside of main. When the program runs it should display the menu to the user and give them a chance to input a choice. An action should be taken depending on what choice the user makes. Each action should operate on the one instance of Submission that you declared at the top of main (do not declare other instances of Submission). Here is the user menu: Submission UI ------------- 1 – Read submission from file as JSON 2 – Write submission to file as JSON 3 – Show submission info on screen 4 - Exit Enter Choice THE PROGRAM SHOULD KEEP SHOWING THE MENU AND PERFORMING AN ACTION UNTIL THE USER CHOOSES TO EXIT (sample program execution below). ©Arthur Hoskey, PhD Sample Program Execution Submission UI ------------- 1 – Read submission from file as JSON 2 – Write submission to file as JSON 3 – Show submission info on screen 4 - Exit Enter Choice 3 Submission Date = 1/1/2021 Assignment = NO_ASSIGNMENT Score = 0.0 Submission UI ------------- 1 – Read submission from file as JSON 2 – Write submission to file as JSON 3 – Show submission info on screen 4 - Exit Enter Choice 1 Enter input filename submission.json Submission UI ------------- 1 – Read submission from file as JSON 2 – Write submission to file as JSON 3 – Show submission info on screen 4 - Exit Enter Choice 3 Submission Date = 9/1/2021 Assignment = Lab 1 Score = 80.0 Submission UI ------------- 1 – Read submission from file as JSON 2 – Write submission to file as JSON 3 – Show submission info on screen 4 - Exit Enter Choice 2 Enter output filename submission2.json Submission UI ------------- 1 – Read submission from file as JSON 2 – Write submission to file as JSON 3 – Show submission info on screen 4 - Exit Enter Choice 4 Program done
Answered 1 days AfterSep 21, 2021

Answer To: Microsoft Word - Assign 2 - BCS 345.docx ©Arthur Hoskey, PhD Assignment 2 – BCS 345 Java Programming...

Arun Shankar answered on Sep 22 2021
134 Votes
Assignment_02/.classpath

    
        
            
        
    
    
    
Assignment_02/.project

     Assignment_0
2
    
    
    
    
        
             org.eclipse.jdt.core.javabuilder
            
            
        
    
    
        ...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here