Week 3 : Programming Assignment 1
Due on 2023-08-17, 23:59 IST
This program is related to the generation of Fibonacci numbers.
For example: 0,1, 1,2, 3,5, 8, 13,… is a Fibonacci sequence where 13 is the 8th Fibonacci number.
A partial code is given and you have to complete the code as per the instruction given .
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1 | 8 | 13 | 13\n
| Passed after ignoring Presentation Error |
Private Test cases used for Evaluation | Status |
Test Case 1 | Passed |
Test Case 2 | Passed |
Test Case 3 | Passed |
Week 3 : Programming Assignment 2
Due on 2023-08-17, 23:59 IST
Define a class Point with two fields x and y each of type double. Also, define a method distance(Point p1, Point p2) to calculate the distance between points p1 and p2 and return the value in double.
Complete the code segment given below. Use Math.sqrt( ) to calculate the square root.
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1 | 2.0 3.0
1.0 2.0 | 1.4142135623730951 | 1.4142135623730951 | Passed |
Private Test cases used for Evaluation | Status |
Test Case 1 | Passed |
Week 3 : Programming Assignment 3
Due on 2023-08-17, 23:59 IST
A class Shape is defined with two overloading constructors in it. Another class Test1 is partially defined which inherits the class Shape. The class Test1 should include two overloading constructors as appropriate for some object instantiation shown in main() method. You should define the constructors using the super class constructors. Also, override the method calculate( ) in Test1 to calculate the volume of a Shape.
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1 | 2.0 3.0 4.0 | 16.0\n
24.0 | 16.0\n
24.0\n
| Passed after ignoring Presentation Error |
Private Test cases used for Evaluation | Status |
Test Case 1 | Passed |
Week 3 : Programming Assignment 4
Due on 2023-08-17, 23:59 IST
This program to exercise the call of static and non-static methods. A partial code is given defining two methods, namely sum( ) and multiply ( ). You have to call these methods to find the sum and product of two numbers. Complete the code segment as instructed.
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1 | 3 5 | 8\n
15 | 8\n
15 | Passed |
Private Test cases used for Evaluation | Status |
Test Case 1 | Passed |
Week 3 : Programming Assignment 5
Due on 2023-08-17, 23:59 IST
Complete the code segment to swap two numbers using call by object reference.
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1 | 10 20 | 20 10 | 20 10\n
| Passed after ignoring Presentation Error |
Private Test cases used for Evaluation | Status |
Test Case 1 | Passed |
---------------------------------------------------------------------------
No comments