Week 7 : Programming Assignment 1
Due on 2023-09-14, 23:59 IST
Complete the following code fragment to read three integer values from the keyboard and find the sum of the values. Declare a variable "sum" of type int and store the result in it.
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1 | 1
1
1 | 3 | 3\n
| Passed after ignoring Presentation Error |
Week 7 : Programming Assignment 2
Due on 2023-09-14, 23:59 IST
Complete the code segment to catch the exception in the following, if any. On the occurrence of such an exception, your program should print “Please enter valid data” .If there is no such exception, it will print the "square of the number".
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1 | 2 | 4 | 4 | Passed |
Test Case 2 | p | Please enter valid data | Please enter valid data | Passed |
Week 7 : Programming Assignment 3
Due on 2023-09-14, 23:59 IST
A byte char array is initialized. You have to enter an index value"n". According to index your program will print the byte and its corresponding char value.
Complete the code segment to catch the exception in the following, if any. On the occurrence of such an exception, your program should print “exception occur” .If there is no such exception, it will print the required output.
Complete the code segment to catch the exception in the following, if any. On the occurrence of such an exception, your program should print “exception occur” .If there is no such exception, it will print the required output.
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1 | 1 | 80\n
P | 80\n
P | Passed |
Test Case 2 | 24 | exception occur | exception occur\n
| Passed after ignoring Presentation Error |
Test Case 3 | 4 | 76\n
L | 76\n
L | Passed |
Week 7 : Programming Assignment 4
Due on 2023-09-14, 23:59 IST
The following program reads a string from the keyboard and is stored in the String variable "s1". You have to complete the program so that it should should print the number of vowels in s1 . If your input data doesn't have any vowel it will print "0".
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1 | sam | 1 | 1\n
| Passed after ignoring Presentation Error |
Test Case 2 | eeE | 3 | 3\n
| Passed after ignoring Presentation Error |
Test Case 3 | 10 | 0 | 0\n
| Passed after ignoring Presentation Error |
Week 7 : Programming Assignment 5
Due on 2023-09-14, 23:59 IST
A string "s1" is already initialized. You have to read the index "n" from the keyboard. Complete the code segment to catch the exception in the following, if any. On the occurrence of such an exception, your program should print “exception occur” .If there is no such exception, your program should replace the char "a" at the index value "n" of the "s1" ,then it will print the modified string.
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1 | -1 | exception occur | exception occur\n
| Passed after ignoring Presentation Error |
Test Case 2 | e | exception occur | exception occur\n
| Passed after ignoring Presentation Error |
Test Case 3 | 4 | NPTEaJAVA | NPTEaJAVA | Passed |
No comments