File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Source Code Inspection/src/br/calebe/ticketmachine/core Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 22
33import java .util .Iterator ;
44
5- /**
6- *
7- * @author Calebe de Paula Bianchini
8- */
9- class Troco {
10-
11- public Troco (int valor ) {
5+ public class Troco1 {
6+ public Troco1 (int valor ) {
127 PapelMoeda [] papeisMoeda ;
138 int novoValor ;
149 int valorOriginal =valor ;
@@ -23,8 +18,12 @@ public Troco(int valor) {
2318 }
2419 papeisMoeda [5 ] = new PapelMoeda (100 , count );
2520 count = 0 ;
26- while (valor % 50 != 0 ) {
21+ while (true ) {
22+ novoValor =novoValor -50 ;
2723 count ++;
24+ if (novoValor <50 ){
25+ break ;
26+ }
2827 }
2928 papeisMoeda [4 ] = new PapelMoeda (50 , count );
3029 count = 0 ;
@@ -53,3 +52,4 @@ public Iterator<PapelMoeda> getIterator() {
5352 return new TrocoIterator (this );
5453 }
5554}
55+
You can’t perform that action at this time.
0 commit comments