Assignment 4: Chapter 4 Your Assignment In This Chapter ✓ Solved

Assignment 4: Chapter 4 Your assignment in this chapter is to

Your assignment in this chapter is to solve the programming challenge 14. You need to submit the source code (.java not the project or the .class files) of all the classes you'll implement and the driver program for the problem. Additionally, you must submit your designs, as code without design does not meet the syllabus requirement for all assignments.

Consider the following elements in your submission:

  • You can use relative paths and/or import statements and/or packages for classes.
  • Decimal formatting.
  • Switch receiving string data types.
  • Conditional operator.
  • String formatting with decimal values.
  • Object-oriented solutions (Chapter 3).

Each method will require a docstring. Use the following format:

/**

* @param args

* @return Termination code as int, 0 for normal, anything else is error condition

* @throws Nothing is implemented

*/

All assignments must be submitted on eCampus under Assignments attached as a single compressed file (no hard copy needed), named as follows:

Assignment#Lastname####.zip

Where Assignment# is the applicable assignment number listed in the syllabus and Lastname### is the submitting student’s last name and the last four digits of the student’s student ID. You may submit your assignments early using the assignment link if it is active on eCampus, but no assignments will be accepted after the due date/time. Assignments sent to the instructor via email will not be accepted.

All assignment questions must show design flowcharts/UML and/or pseudo code unless stated otherwise by your instructor; these can be created using applications like DIA or drawn by hand and submitted as photographs.

Paper For Above Instructions

To effectively complete the programming challenge 14, we will follow a structured object-oriented approach that encompasses the principles of design, coding standards, and documentation. This paper aims to outline the implementation process, the importance of design in coding, and the requirements to achieve a functional program.

Understanding Programming Challenge 14

Programming challenges often require a myriad of skills, including problem-solving, knowledge of programming syntax, and the application of logical structures. The challenge we are focusing on in Chapter 4 of the syllabus is designed fundamentally around essential programming concepts such as classes, methods, and object-oriented principles.

Design Documentation

Before jumping into coding, it's crucial to have a clear design laid out. Design documentation should include flowcharts or UML diagrams to give a visual representation of the program structure. In the context of our assignment, we will create a flowchart that outlines the main functionalities of our program, followed by the UML diagram depicting various classes and their relationships.

The Coding Phase

We will develop several classes and methods to fulfill the requirements of the programming challenge. Each class will be responsible for a distinct functionality, adhering to the principles of modular programming where we can test and debug each component independently.

The following is an outline of the classes we may be implementing:

  • Main Class: This will house the main method that runs the driver program and integrates other classes.
  • Utility Class: This may handle all calculation-related methods and formatting services.
  • Data Class: This might encapsulate all relevant data structures, methods for managing data, and perhaps data validation techniques.

As we write our classes, we will adhere to decoupling concepts to ensure flexibility and maintainability throughout the programming lifecycle. Each method created within our classes will include docstrings for clarity, specifying parameters, return types, and any exceptions thrown, even if none are currently implemented.

Example Code Snippet

public class Challenge14 {

public static void main(String[] args) {

// Main program logic here

}

/**

* @param args Command line arguments

* @return int Termination code, 0 = success

* @throws Exception Not implemented

*/

public static int someMethod(String[] args) {

// Method logic here

return 0;

}

}

Testing and Validation

After the coding phase, thorough testing is essential. We need to implement test cases that will validate the functionality of each class and method in varying scenarios. This includes testing edge cases and ensuring that inputs are handled correctly, particularly with string data types and decimal formatting, as specified in the assignment requirements.

Finalizing the Submission

Once all coding and testing are complete, we will compile our source code files and relevant design documentations into a single compressed file. This will include both the flowcharts/UMLs and pseudocode as part of our design documentation to comply with the assessment criteria. Accurate naming conventions, as specified in the assignment guidelines, will be adhered to during the submission process.

In summary, following this structured methodology will ensure that we produce a well-functioning solution to the programming challenge while also fulfilling the academic standards required for the assignment.

References

  • Deitel, P. J., & Deitel, H. M. (2016). Java: How to Program (10th ed.). Pearson.
  • Horstmann, C. S. (2019). Core Java Volume I: Fundamentals (11th ed.). Prentice Hall.
  • Schildt, H. (2018). Java: The Complete Reference (11th ed.). McGraw-Hill Education.
  • Bloch, J. (2018). Effective Java (3rd ed.). Addison-Wesley.
  • Lafore, R. (2018). Data Structures and Algorithms in Java (3rd ed.). Sams Publishing.
  • McKinney, W. (2017). Python for Data Analysis (2nd ed.). O'Reilly Media.
  • Knuth, D. E. (1997). The Art of Computer Programming, Volume 1: Fundamental Algorithms (3rd ed.). Addison-Wesley.
  • Gamma, E., Helm, R., Johnson, R., & Vlissides, J. (1994). Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley.
  • Pressman, R. S., & Maxim, B. R. (2015). Software Engineering: A Practitioner’s Approach (9th ed.). McGraw-Hill.
  • W3Schools. (2023). Java Tutorial. Retrieved from https://www.w3schools.com/java/