Week 06 : Programming Assignment 1
Due on 2024-09-05, 23:59 ISTAn interface Number is defined in the following program.
You have to declare a class A, which will implement the interface Number.
Note that the method findSqr(n) will return the square of the number n.
Public Test Cases Input Expected Output Actual Output Status Test Case 1 12
144
144
Passed
An interface Number is defined in the following program.
You have to declare a class A, which will implement the interface Number.
Note that the method findSqr(n) will return the square of the number n.
You have to declare a class A, which will implement the interface Number.
Note that the method findSqr(n) will return the square of the number n.
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1 | 12 | 144 | 144 | Passed |
Week 06 : Programming Assignment 2
Due on 2024-09-05, 23:59 ISTThis program is to find the GCD (greatest common divisor) of two integers writing a recursive function findGCD(n1,n2).
Your function should return -1, if the argument(s) is(are) negative number(s).
Public Test Cases Input Expected Output Actual Output Status Test Case 1 20 30
10
10
Passed
This program is to find the GCD (greatest common divisor) of two integers writing a recursive function findGCD(n1,n2).
Your function should return -1, if the argument(s) is(are) negative number(s).
Your function should return -1, if the argument(s) is(are) negative number(s).
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1 | 20 30 | 10 | 10 | Passed |
Week 06 : Programming Assignment 3
Due on 2024-09-05, 23:59 ISTComplete the code segment to print the following using the concept of extending the Thread class in Java:-----------------OUTPUT-------------------Thread is Running.-------------------------------------------------
Private Test cases used for Evaluation Status Test Case 1 Passed
Complete the code segment to print the following using the concept of extending the Thread class in Java:
-----------------OUTPUT-------------------
Thread is Running.
-------------------------------------------------
Private Test cases used for Evaluation | Status |
Test Case 1 | Passed |
Week 06 : Programming Assignment 4
Due on 2024-09-05, 23:59 ISTExecution of two or more threads occurs in a random order. The keyword 'synchronized' in Java is used to control the execution of thread in a strict sequence. In the following, the program is expected to print some numbers. Do the necessary use of 'synchronized' keyword, so that, the program prints the output in the following order: -----------------OUTPUT------------------- (this line should not to be printed)510152025100200300400500-------------------------------------------------(this line should not to be printed)
(Remember to match the output given exactly, including the spaces and new lines)(passed with presentation error means you will get full marks)
Private Test cases used for Evaluation Status Test Case 1 Passed
Execution of two or more threads occurs in a random order. The keyword 'synchronized' in Java is used to control the execution of thread in a strict sequence. In the following, the program is expected to print some numbers. Do the necessary use of 'synchronized' keyword, so that, the program prints the output in the following order:
-----------------OUTPUT------------------- (this line should not to be printed)
5
10
15
20
25
100
200
300
400
500
-------------------------------------------------(this line should not to be printed)
(Remember to match the output given exactly, including the spaces and new lines)
(passed with presentation error means you will get full marks)
Private Test cases used for Evaluation | Status |
Test Case 1 | Passed |
Week 06 : Programming Assignment 5
Due on 2024-09-05, 23:59 ISTAdd necessary codes to print the following:
-----------------OUTPUT-------------------Name of thread 't':Thread-0New name of thread 't':NPTELThread is running.-------------------------------------------------Hint: Use the setName() function
Private Test cases used for Evaluation Status Test Case 1 Passed
Add necessary codes to print the following:
-----------------OUTPUT-------------------
Name of thread 't':Thread-0
New name of thread 't':NPTEL
Thread is running.
-------------------------------------------------
Hint: Use the setName() function
Private Test cases used for Evaluation | Status |
Test Case 1 | Passed |
No comments