You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Java Week 3:Q4](https://github.com/bkkothari2255/Programming_In_Java_NPTEL/blob/WEEK-3/Test3.java) This program to exercise the call of static and non-static methods. A partial code is given defining two methods, namely sum( ) and multiply ( ). You have to call these methods to find the sum and product of two numbers.
39
39
40
40
[Java Week 3:Q5](https://github.com/bkkothari2255/Programming_In_Java_NPTEL/blob/WEEK-3/Question3.java) To swap two numbers using call by object reference.
[Java Week 4:Q1](https://github.com/bkkothari2255/Programming_In_Java_NPTEL/blob/WEEK-4/Question41.java) To execute the following program successfully. You should import the correct package(s) and/or class(s) to complete the code.
46
46
47
47
[Java Week 4:Q2](https://github.com/bkkothari2255/Programming_In_Java_NPTEL/blob/WEEK-4/Question42.java) To print the current year.
48
48
49
49
[Java Week 4:Q3](https://github.com/bkkothari2255/Programming_In_Java_NPTEL/blob/WEEK-4/Question43.java) The program in this assignment is attempted to print the following output:
50
-
51
-
-----------------OUTPUT-------------------
52
-
50
+
51
+
```text
52
+
-----------------OUTPUT-------------------
53
53
This is large
54
-
55
54
This is medium
56
-
57
55
This is small
58
-
59
56
This is extra-large
60
-
61
-
-----------------OUTPUT-------------------
62
-
57
+
------------------------------------------
58
+
```
63
59
[Java Week 4:Q4](https://github.com/bkkothari2255/Programming_In_Java_NPTEL/blob/WEEK-4/Question44.java) To call the default method in the interface First and Second.
64
60
65
61
[Java Week 4:Q5](https://github.com/bkkothari2255/Programming_In_Java_NPTEL/blob/WEEK-4/Question45.java) To print the following output.
In the following program, a thread class ThreadRun is created using the Runnable interface which prints "Thread using Runnable interface". Complete the main class to create a thread object of the class ThreadRun and run the thread,
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:
@@ -159,13 +142,95 @@ Complete the code segment to catch the exception in the following, if any. On th
159
142
160
143
[Java Week 7:Q5](https://github.com/bkkothari2255/Programming_In_Java_NPTEL/blob/WEEK-7/Question5.java) 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.
[Java Week 8:Q1](https://github.com/bkkothari2255/Programming_In_Java_NPTEL/blob/WEEK-8/Pattern1.java) Write a program which will print a pyramid of "*" 's of height "n" and print the number of "*" 's in the pyramid.
[Java Week 8:Q2](https://github.com/bkkothari2255/Programming_In_Java_NPTEL/blob/WEEK-8/Pattern2.java) Write a program which will print a pascal pyramid of "*" 's of height "l" .
[Java Week 8:Q3](https://github.com/bkkothari2255/Programming_In_Java_NPTEL/blob/WEEK-8/Pattern3.java) Write a program which will print a pyramid of "numbers" 's of height "n" and print the sum of all number's in the pyramid.
180
+
```text
181
+
For example:
182
+
183
+
input: 5
184
+
185
+
output:
186
+
187
+
1
188
+
1 2 3
189
+
1 2 3 4 5
190
+
1 2 3 4 5 6 7
191
+
1 2 3 4 5 6 7 8 9
192
+
95
193
+
```
194
+
195
+
[Java Week 8:Q4](https://github.com/bkkothari2255/Programming_In_Java_NPTEL/blob/WEEK-8/Pattern4.java) Write a program to print symmetric Pascal's triangle of "*" 's of height "l" of odd length . If input "l" is even then your program will print "Invalid line number".
196
+
```text
197
+
For example:
198
+
199
+
input : 5
200
+
201
+
output:
202
+
*
203
+
* *
204
+
* * *
205
+
* *
206
+
*
207
+
208
+
input : 6
209
+
210
+
output:
211
+
212
+
Invalid line number
213
+
```
214
+
215
+
[Java Week 8:Q5](https://github.com/bkkothari2255/Programming_In_Java_NPTEL/blob/WEEK-8/Pattern5.java) Write a program to display any digit(n) from 0-9 using "7 segment display".
0 commit comments