Skip to content

Commit ceab783

Browse files
Index
Week 9 Update
1 parent 4070b8d commit ceab783

File tree

1 file changed

+102
-0
lines changed

1 file changed

+102
-0
lines changed

README.md

+102
Original file line numberDiff line numberDiff line change
@@ -234,3 +234,105 @@ output :
234234
|
235235
236236
```
237+
238+
## [WEEK 9](https://github.com/bkkothari2255/Programming_In_Java_NPTEL/tree/WEEK-9)
239+
240+
[Java Week 9:Q1](https://github.com/bkkothari2255/Programming_In_Java_NPTEL/blob/WEEK-9/Question91.java) Complete the code to develop a BASIC CALCULATOR that can perform operations like Addition, Subtraction, Multiplication and Division.
241+
```text
242+
Note the following points carefully:
243+
1. Use only double datatype to store calculated numeric values.
244+
2. Assume input to be of integer datatype.
245+
3. The output should be rounded using Math.round() method.
246+
4. Take care of the spaces during formatting output (e.g., single space each before and after =).
247+
5. The calculator should be able to perform required operations on a minimum of two operands as shown in the below example:
248+
249+
Input:
250+
5+6
251+
252+
Output:
253+
5+6 = 11
254+
```
255+
[Java Week 9:Q2](https://github.com/bkkothari2255/Programming_In_Java_NPTEL/blob/WEEK-9/Question92.java) Complete the code to develop an ADVANCED CALCULATOR that emulates all the functions of the GUI Calculator as shown in the image.
256+
257+
![GUI Calculator](https://storage.googleapis.com/swayam-node1-production.appspot.com/assets/img/noc19_cs84/GUI.JPG)
258+
259+
```text
260+
Note the following points carefully:
261+
1. Use only double datatype to store all numeric values.
262+
2. Each button on the calculator should be operated by typing the characters from 'a' to 'p'.
263+
3. To calculate 25-6, User should input fjhkc (where, f for 2, j for 5, h for '-', k for 6 and c for '=' ).
264+
3. You may use the already defined function gui_map(char).
265+
4. Without '=', operations won't give output as shown in Input_2 and Output_2 example below.
266+
5. The calculator should be able to perform required operations on two operands as shown in the below example:
267+
268+
Input_1:
269+
klgc
270+
271+
Output_1:
272+
18.0
273+
274+
Input_2:
275+
klg
276+
277+
Output_2:
278+
```
279+
280+
[Java Week 9:Q3](https://github.com/bkkothari2255/Programming_In_Java_NPTEL/blob/WEEK-9/Question93.java) Complete the code to perform a 45 degree anti clock wise rotation with respect to the center of a 5 × 5 2D Array as shown below:
281+
```text
282+
INPUT:
283+
00100
284+
00100
285+
11111
286+
00100
287+
00100
288+
289+
OUTPUT:
290+
291+
10001
292+
01010
293+
00100
294+
01010
295+
10001
296+
297+
Note the following points carefully:
298+
1. Here, instead of 0 and 1 any character may be given.
299+
2. The input and output array size must be of dimension 5 × 5 and nothing else.
300+
```
301+
302+
[Java Week 9:Q4](https://github.com/bkkothari2255/Programming_In_Java_NPTEL/blob/WEEK-9/Question94.java) A program needs to be developed which can mirror reflect any 5 × 5 2D character array into its side-by-side reflection. Write suitable code to achieve this transformation as shown below:
303+
```text
304+
INPUT: OUTPUT:
305+
OOXOO OOXOO
306+
OOXOO OOXOO
307+
XXXOO OOXXX
308+
OOOOO OOOOO
309+
XOABC CBAOX
310+
311+
Note the following points carefully:
312+
1. Here, instead of X and O any character may be present.
313+
2. The input and output array size must be of dimension 5 × 5 and nothing else.
314+
3. Only side-by-side reflection should be performed i.e. ABC || CBA.
315+
```
316+
317+
[Java Week 9:Q5](https://github.com/bkkothari2255/Programming_In_Java_NPTEL/blob/WEEK-9/Question95.java) Write suitable code to develop a 2D Flip-Flop Array with dimension 5 × 5, which replaces all input elements with values 0 by 1 and 1 by 0. An example is shown below:
318+
```text
319+
INPUT:
320+
00001
321+
00001
322+
00001
323+
00001
324+
00001
325+
326+
OUTPUT:
327+
328+
11110
329+
11110
330+
11110
331+
11110
332+
11110
333+
334+
Note the following points carefully:
335+
1. Here, the input must contain only 0 and 1.
336+
2. The input and output array size must be of dimension 5 × 5.
337+
3. Flip-Flop: If 0 then 1 and vice-versa.
338+
```

0 commit comments

Comments
 (0)