Due on 2023-10-19, 23:59 IST
Create a class called Animal with protected fields and a parameterized constructor to initialize the protected fields.
Fields:
- name (String)
- sound (String)
and Method:
- public void makeSound() - This method should display the name of the animal and the sound it makes.
Create a class called Dog that extends the Animal class.
The Dog class should have a constructor that accepts the name of the dog and sets the sound to "Woof".
The Dog class should have a constructor that accepts the name of the dog and sets the sound to "Woof".
Create a class called Cat that extends the Animal class.
The Cat class should have a constructor that accepts the name of the cat and sets the sound to "Meow".
Follow the naming convention as given in the main method of the suffix code.
The Cat class should have a constructor that accepts the name of the cat and sets the sound to "Meow".
Follow the naming convention as given in the main method of the suffix code.
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1 | Jacky
Tom | Jacky says: Woof\n
Tom says: Meow | Jacky says: Woof\n
Tom says: Meow\n
| Passed after ignoring Presentation Error |
Week 8 : Programming Assignment 2
Program to Generate Harmonic Series.
Follow the naming convention as given in the main method of the suffix code.
Follow the naming convention as given in the main method of the suffix code.
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1 | 6 | Output of Harmonic Series is 2.45 | Output of Harmonic Series is 2.45\n
| Passed after ignoring Presentation Error |
Week 8 : Programming Assignment 3
Write a code to find the Trace of the 2D matrix.
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1 | 5
5
2 3 5 6 7
8 9 10 11 12
13 14 15 16 17
18 1 3 0 6
7 8 11 8 11 | 37.0 | 37.0 | Passed |
Week 8 : Programming Assignment 4
Program to remove duplicate elements from sorted array
Follow the naming convention as given in the main method of the suffix code.
Follow the naming convention as given in the main method of the suffix code.
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1 | 6
1 2 2 3 3 4 | 1 2 3 4 | 1 2 3 4 | Passed after ignoring Presentation Error |
Week 8 : Programming Assignment 5
Write a code to find the Determinant of the 2D matrix.
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1 | 4
1 0 2 -1
3 0 0 5
2 1 4 -3
1 0 5 0 | Determinant of the matrix is : 30 | Determinant of the matrix is : 30 | Passed |
No comments