NPTEL » Programming in Java
Please scroll down for latest Programs. 👇
Week 01 : Programming Assignment 1
Write a Java program to print the area and perimeter of a rectangle.
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1 | 5.6 8.5 | Perimeter is 2*(8.5 + 5.6) = 28.20\n
Area is 5.6 * 8.5 = 47.60 | Perimeter is 2*(8.5 + 5.6) = 28.20\n
Area is 5.6 * 8.5 = 47.60 | Passed |
Private Test cases used for Evaluation | Status |
Test Case 1 | Passed |
Week 01 : Programming Assignment 2
Write a Java program and compute the sum of an integer's digits.
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1 | 00020 | The sum of the digits is: 2 | The sum of the digits is: 2 | Passed |
Private Test cases used for Evaluation | Status |
Test Case 1 | Passed |
Week 01 : Programming Assignment 3
Write a Java program to display n terms of natural numbers and their sum.
(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 | 5 | The first 5 natural numbers are : \n
1\n
2\n
3\n
4\n
5\n
The Sum of Natural Number upto 5 terms : 15 | The first 5 natural numbers are : \n
1\n
2\n
3\n
4\n
5\n
The Sum of Natural Number upto 5 terms : 15 | Passed |
Private Test cases used for Evaluation | Status |
Test Case 1 | Passed |
Week 01 : Programming Assignment 4
Write a Java program to make such a pattern like a right angle triangle with the number increased by 1.
(Remember to match the output given exactly, including the spaces and new lines)
(Ignore presentation errors for this and all future programming assignments)
(passed with presentation error means you will get full marks)
for n=3:
1
2 3
4 5 6
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1 | 4 | 1 \n
2 3 \n
4 5 6 \n
7 8 9 10 | 1 \n
2 3 \n
4 5 6 \n
7 8 9 10 \n
| Passed after ignoring Presentation Error |
Private Test cases used for Evaluation | Status |
Test Case 1 | Passed |
Week 01 : Programming Assignment 5
Write a Java program to convert an integer number to a binary number.
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1 | 47 | Binary number is: 101111 | Binary number is: 101111 | Passed |
Private Test cases used for Evaluation | Status |
Test Case 1 | Passed |
No comments