JAVA PROGRAM 3 Write a program to input a number. Count and print the frequency of each digit present in that number. The output should be given as: Sample Input: 44514621 Sample Output: ===================== Digit Frequency ===================== 1 2 2 1 4 3 5 1 6 ...
Posts
Showing posts from August, 2022
- Get link
- X
- Other Apps
JAVA PROGRAM 2 A company manufactures packing cartons in four sizes, i.e. cartons to accommodate 6 boxes, 12 boxes, 24 boxes and 48 boxes. Design a program to accept the number of boxes to be packed (N) by the user (maximum up to 1000 boxes) and display the break-up of the cartons used in descending order of capacity (i.e. preference should be given to the highest capacity available, and if boxes left are less than 6, an extra carton of capacity 6 should be used.) Test your program with the sample data and some random data: Example 1 INPUT : N = 726 OUTPUT : 48 x 15 = 720 6 x 1 = 6 Remaining boxes = 0 Total number of boxes = 726 Total number of cartons = 16 Example 2 INPUT : N = 140 OUTPUT : 48 X 2 = 96 24 x 1 = 24 12 x 1 = 12 6 x 1 = 6 Remaining boxes 2 x 1 = 2 Total number of boxes = 140 Total number of cartons = 5 Example 3 INPUT : N = 4296 OUTPUT : INVALID LENGTH ALGORITHM...
- Get link
- X
- Other Apps
JAVA PROGRAM FOR DENOMINATIONS 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 1000, 500, 100, 50, 20, 10, 5, 2, and 1. Design a program to accept the amount from the user and display the break-up in descending order of denomination. (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]. Example: INPUT : 14788 OUTPUT : DENOMINATIONS: 1000 x 14 = 14000 500 x 1 = 500 100 x 2 = 200 50 x 1 = 50 20 x 1 = 20 10 x ...