Page 399 - ComputerScience_Class_11
P. 399

27.  Write a Java program to store the elements in two different matrices A and B of order 4 × 4. Find the product of two matrices and
                       store the result in another matrix C.

                        3    2   1    2           -2  -4   -1  0          5   -1   -5  20
                        6    4   5    0     x     3   6    -5  2     =    25  15   -6  38
                        7    -1  0    2           5   3    4   6         -17  -38  2   -8
                        4    3   1    1           0   -2   -2  5          6    3  -13  17
                              A matrix                B Matrix            C(resultant) Matrix
                    28.  A bank intends to design a program to display the denomination of an input amount up to 5 digits. The available denomination
                       with the bank are of rupees 500, 200, 100, 50, 20, 10 and 1.
                        Design a program in Java to accept the amount from the user and display the break-up in descending order of denominations
                       (i.e., preference should be given to the highest denomination available) along with the total number of notes.
                        [Note: Only the denomination used should be displayed].
                        Also, print the amount in words according to the digits.
                        Example 1:
                        Input:
                          14836
                        Output:
                           One Four Eight Three Six
                        Denomination:
                           500 * 29  =   14500
                           200 * 1   =   200
                           100 * 1   =   100
                           20 * 1    =   20
                           10 * 1    =   10
                           1 * 6    =   6
                        Example 2:
                        Input:
                          235001
                        Output:
                           Invalid Amount

































                                                                                                           Arrays  397
   394   395   396   397   398   399   400   401   402   403   404