-1
The program shows any amount of coins and their values. I need to create a public method that makes the total sum of coins, I’m not getting.
package primeiro;
public class ControleMoedas {
private String nomeTitular;
private int qtde1c;
private int qtde5c;
private int qtde10c;
private int qtde25c;
private int qtde50c;
private int qtde1r;
///acrescenta as qtde de cada moeda.
public void depositarMoeda1c(int moeda1c) {
this.qtde1c += moeda1c;
}
public void depositarMoeda5c(int moeda5c) {
this.qtde1c += moeda5c;
}
public void depositarMoeda10c(int moeda10c) {
this.qtde1c += moeda10c;
}
public void depositarMoeda25c(int moeda25c) {
this.qtde1c += moeda25c;
}
public void depositarMoeda50c(int moeda50c) {
this.qtde1c += moeda50c;
}
public void depositarMoeda1r(int moeda1r) {
this.qtde1c += moeda1r;
}
//calcular a qtde total das moedas. TRANCADO AQUI
public void somarQtdeMoedas(int totalMoedas) {
}
//não recebem parâmetros e não retornam valores.
public String getNomeTitular() {
return nomeTitular;
}
public void setNomeTitular(String nomeTitular) {
this.nomeTitular = nomeTitular;
}
public int getQtde1c() {
return qtde1c;
}
public int getQtde5c() {
return qtde5c;
}
public int getQtde10c() {
return qtde10c;
}
public int getQtde25c() {
return qtde25c;
}
public int getQtde50c() {
return qtde50c;
}
public int getQtde1r() {
return qtde1r;
}
}
Helped a lot!! Perfectly met and other suggestion tbm.
– En.Fabiano