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
Copy file name to clipboardExpand all lines: docs/README.md
+110-32
Original file line number
Diff line number
Diff line change
@@ -47,30 +47,25 @@
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:
@@ -156,3 +141,96 @@ Complete the code segment to catch the exception in the following, if any. On th
156
141
[Java Week 7:Q4](https://github.com/bkkothari2255/Programming_In_Java_NPTEL/blob/WEEK-7/Question4.java) 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".
157
142
158
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.
148
+
```text
149
+
For example:
150
+
151
+
input : 5
152
+
output:
153
+
154
+
*
155
+
* * *
156
+
* * * * *
157
+
* * * * * * *
158
+
* * * * * * * * *
159
+
25
160
+
```
161
+
162
+
[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" .
163
+
```text
164
+
For example:
165
+
166
+
input: 8
167
+
168
+
output :
169
+
*
170
+
* *
171
+
* * *
172
+
* * * *
173
+
* * * * *
174
+
* * * * * *
175
+
* * * * * * *
176
+
* * * * * * * *
177
+
```
178
+
179
+
[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