Programming In Java
With the growth of Information and Communication Technology, there is a need to develop large and complex software. Further, those software should be platform independent, Internet enabled, easy to modify, secure, and robust. To meet this requirement object-oriented paradigm has been developed and based on this paradigm the Java programming language emerges as the best programming environment. Now, Java programming language is being used for mobile programming, Internet programming, and many other applications compatible to distributed systems. This course aims to cover the essential topics of Java programming so that the participants can improve their skills to cope with the current demand of IT industries and solve many problems in their own filed of studies.
PREREQUISITES : This course requires that the students are familiar with programming language such as C/C++ and data structures, algorithms.
INDUSTRY SUPPORT : All IT companies.
Nptel Programming in Java Week 1 Assignment Answers
Course layout
Nptel Programming in Java Week 1 Assignment Answers
Week 1 Assignment 1
Week 01 : Programming Assignment 1
Write a Java program to check if a given integer is even or odd.
NOTE:
The code you see is not complete.
Your task is to complete the code as per the question.
Think of it like a programming puzzle.
(Ignore presentation errors
(“passed with presentation error” means
Select the Language for this assignment.
File name for this program :
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1
|
4
|
Even
|
Even
|
Passed
|
Week 01 : Programming Assignment 2
Write a Java program to calculate the volume of a cylinder given its radius and height.
Formula:
V=π×r2×h
�=π×�2×ℎ
You can use Math.PI for the computation.
NOTE:
The code you see is not complete.
Your task is to complete the code as per the question.
Think of it like a programming puzzle.
(This question can be solved in just one line of code)
(Ignore presentation errors
(“passed with presentation error” means
Select the Language for this assignment.
File name for this program :
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1
|
3.5
5.0
|
Volume is: 192.42
|
Volume is: 192.42
|
Passed
|
Week 01 : Programming Assignment 3
Write a Java program to print the multiplication table of a given number up to 5.
NOTE:
Print EXACTLY as shown in the sample output.
DO NOT MISS a single space otherwise you will not be scored.
(Ignore presentation errors
(“passed with presentation error” means
Select the Language for this assignment.
File name for this program :
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1
|
5
|
5 x 1 = 5n
5 x 2 = 10n
5 x 3 = 15n
5 x 4 = 20n
5 x 5 = 25
|
5 x 1 = 5n
5 x 2 = 10n
5 x 3 = 15n
5 x 4 = 20n
5 x 5 = 25
|
Passed
|
Week 01 : Programming Assignment 4
Complete the code fragment that reads two integer inputs from keyboard and compute the quotient and remainder.
(Ignore presentation errors
(“passed with presentation error” means
Select the Language for this assignment.
File name for this program :
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1
|
556
9
|
The Quotient is = 61n
The Remainder is = 7
|
The Quotient is = 61n
The Remainder is = 7
|
Passed
|
Week 01 : Programming Assignment 5
Write a program which will print a pattern of “*” ‘s of height “n”.
For example:
Input:
n = 3
Output:
***
**
*
**
***
NOTE:
Print the pattern EXACTLY, without extra spaces.
(Ignore presentation errors
(“passed with presentation error” means
Select the Language for this assignment.
File name for this program :
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1
|
6
|
******n
*****n
****n
***n
**n
*n
**n
***n
****n
*****n
******
|
******n
*****n
****n
***n
**n
*n
**n
***n
****n
*****n
******
|
Passed
|