English, asked by Akari8326, 2 months ago

Cindy Carson is the cashier at Hydra Agro Services. The everyday work of Cindy is to get the change with various denominations from the users and give them back the total amount in cash. It was a time consuming process as the users will be providing very large and distributed denominations.The existing denominations are 25 paise, 50 paise, 1 rupee, 2 rupees, 5 rupees and 10 rupees. Given the count of every denomination (in increasing order from 25 paise to 10 rupees) by the user (0 will be given if the denomination does not exist) display the total amount to be given by Cindy​

Answers

Answered by prabhatiwarisashi
0

Answer:

aaaabbbbccccddddeeefffff

Explanation:

Answered by AmruthGurajala
0

Answer:

package com;

import java.util.Arrays;

import java.util.Scanner;

public class MainClass{

 

public static void main(String[] args) {

 int sum = 0;

 //Eneter 6 numbers of denominations seperated by space:

       System.out.println("Input ");

       Scanner scan=new Scanner(System.in);

       String s=scan.nextLine();

       String[] str = s.split(" ");

       int len = str.length;

       int ints[]=new int[len];

       for(int i=0; i < len; i++){

           ints[i] = Integer.valueOf(str[i]);

       }

       sum = ints[0]*25 + ints[1]*50 + ints[2]*100+ ints[3]*200+ints[4]*500+ ints[5]*1000;

       sum=sum/100;

       System.out.println("Output "+ sum);

      }

}

Explanation:

1. Read the 6 denominations using space.

2. Add those to the array

3. Calculate the sum logic with basic math.

Similar questions