Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1 | Believe in yourself | The longest word in the text is: yourself | The longest word in the text is: yourself | Passed |
Week 07 : Programming Assignment 2
Write a program to print Swastika Pattern in Java.
Input is 2 numbers.
R
C
(Rows and Columns)
For Example:
Input:
5
5
Output:
* ***
* *
*****
* *
*** *
NOTE: Do not print any spaces between the ‘*’
Output should match exactly as specified by the question
(Remember to match the output given exactly, including the spaces and new lines)
(passed with presentation error means you will get full marks)
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1 | 7
9 | * *****\n
* *\n
* *\n
*********\n
* *\n
* *\n
***** * | * *****\n
* *\n
* *\n
*********\n
* *\n
* *\n
***** *\n
| Passed after ignoring Presentation Error |
Week 07 : Programming Assignment 3
Write a program to remove all occurrences of an element from array in Java.
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1 | 5
12 23 34 23 45
23 | Original Array: [12, 23, 34, 23, 45]\n
Array after removing 23: [12, 34, 45] | Original Array: [12, 23, 34, 23, 45]\n
Array after removing 23: [12, 34, 45] | Passed |
Week 07 : Programming Assignment 4
Write a program to compute the sum of all prime numbers in a given range.
The range value will be positive.
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 | 4
13 | 36 | 36 | Passed |
Week 07 : Programming Assignment 5
Code to create two threads, one printing even numbers and the other printing odd numbers.
§ The PrintNumbers class is declared, and it implements the Runnable interface. This interface is part of Java's concurrency support and is used to represent a task that can be executed concurrently by a thread.
§ Create a constructor of this class that takes two private instance variables (start and end) to represent the range of numbers that will be printed by the thread.
§ Create a run method that is required by the Runnable interface and contains the code that will be executed when the thread is started. In this case, it should prints odd numbers within the specified range (start to end) using a for loop.
§ Hint: Thread.currentThread().getName() returns the name of the currently executing thread, which is useful for identifying which thread is printing the numbers.
Follow the naming convention as given in the main method of the suffix code.
(Remember to match the output given exactly, including the spaces and new lines)
(passed with presentation error means you will get full marks)
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1 | 2
10
3
7 | EvenThread: 2\n
EvenThread: 4\n
EvenThread: 6\n
EvenThread: 8\n
EvenThread: 10\n
OddThread: 3\n
OddThread: 5\n
OddThread: 7 | EvenThread: 2\n
EvenThread: 4\n
EvenThread: 6\n
EvenThread: 8\n
EvenThread: 10\n
OddThread: 3\n
OddThread: 5\n
OddThread: 7\n
| Passed after ignoring Presentation Error |
No comments