Item | Detail |
---|---|
User | [email protected](desktop1).Username+++ |
Password | [email protected](desktop1).Password+++ |
Complete the following tasks to demonstrate understanding of Java program structure fundamentals
@lab.Activity(CFU1)
Complete the HelloWorld.java file by:
- Adding the correct package declaration
- Adding appropriate comments explaining the program
- Implementing the System.out.println statement
- Adding Javadoc comments above the class
Files to modify:
src/main/java/com/skills/java/HelloWorld.java
Complete the UserInputProgram.java file by:
- Adding the correct package declaration
- Importing the Scanner class
- Implementing user input functionality
- Adding proper variable declarations and calculations
- Including effective commenting
Files to modify:
src/main/java/com/skills/java/UserInputProgram.java
Identify and fix all errors in BrokenCode.java:
- Fix missing semicolons
- Correct method modifiers
- Add missing keywords
- Fix package and import statements
- Ensure proper class structure
Files to modify:
src/main/java/com/skills/java/BrokenCode.java
Execute the test suite to validate your solutions:
- Compile all Java files successfully
- Run the test runner script
- Ensure all tests pass
- Verify program functionality
Commands to run:
# Option 1: Using Maven (if available)
./run-tests.sh
# Option 2: Using simple test runner
./simple-test-runner.sh
- All Java files compile without errors
- Programs execute and produce expected output
- All test cases pass successfully
- Code follows Java best practices and conventions
- Proper use of packages, imports, and class structure
By completing this Skills Application, you will demonstrate:
- Understanding of Java class structure and components
- Knowledge of main method purpose and signature
- Package organization and import statement usage
- Differentiation between statements, blocks, and comments
- Ability to write basic Java programs with proper syntax
- User input/output program creation skills
- Understanding of filename-class relationships
java-program-structure-basics/
├── src/main/java/com/skills/java/
│ ├── HelloWorld.java # Task 1: Basic program structure
│ ├── UserInputProgram.java # Task 2: User input and processing
│ └── BrokenCode.java # Task 3: Error identification and fixing
├── run-tests.sh # Maven-based test runner
├── simple-test-runner.sh # Simple test runner (no Maven required)
└── README.md # This instruction file
- Navigate to the project directory
- Review the TODO comments in each Java file
- Complete the exercises following the instructions
- Test your solutions using the provided test runners
- Ensure all programs compile and run correctly
- Java JDK 8 or higher
- Basic understanding of Java syntax
- Familiarity with command line operations
- Text editor or IDE for code modification