generate functionSat, 01 Apr 2023

Diseñar el algoritmo correspondiente a un programa que al introducir una cantidad de dinero expresado en pesos nos indique cuántos billetes y monedas se puede tener como mínimo.

class Main { public static void main(String[] args) { int c = 0; int b100 = 0; int b50 = 0; int b20 = 0; int b10 = 0; int b5 = 0; int b2 = 0; int b1 = 0; int m50 = 0; int m25 = 0; int m10 = 0; int m5 = 0; int m1 = 0; System.out.println("Ingrese la cantidad de dinero: "); c = Integer.parseInt(System.console().readLine()); b100 = c / 100; c = c - b100 * 100; b50 = c / 50; c = c - b50 * 50; b20 = c / 20; c = c - b20 * 20; b10 = c / 10; c = c - b10 * 10;

Want to kickstart your project?Use the new AI Studio to create your code