Skip to content

Commit e260abd

Browse files
authored
Fix Is#04
1 parent 85a3706 commit e260abd

File tree

1 file changed

+7
-3
lines changed
  • Source Code Inspection/src/br/calebe/ticketmachine/core

1 file changed

+7
-3
lines changed

Source Code Inspection/src/br/calebe/ticketmachine/core/Troco.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,18 @@
88
*/
99
class Troco {
1010

11-
1211
public Troco(int valor) {
1312
PapelMoeda[] papeisMoeda;
14-
13+
int novoValor;
14+
int valorOriginal=valor;
1515
papeisMoeda = new PapelMoeda[6];
1616
int count = 0;
17-
while (valor % 100 != 0) {
17+
while (true) {
18+
novoValor=valorOriginal-100;
1819
count++;
20+
if(novoValor<100){
21+
break;
22+
}
1923
}
2024
papeisMoeda[5] = new PapelMoeda(100, count);
2125
count = 0;

0 commit comments

Comments
 (0)