Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- *
- * @author Professor Hercio neto
- */
- public class Pedido {
- private Integer[] quantidades;
- private Integer totalItens;
- private Float[] valores, valoresT;
- private Float taxaGarcon, totalGeral, total;
- public Integer[] getQuantidades() {
- return quantidades;
- }
- public void setQuantidades(Integer[] quantidades) {
- this.quantidades = quantidades;
- }
- public Float[] getValores() {
- return valores;
- }
- public Float[] getValoresT() {
- return valoresT;
- }
- public void setValoresT() {
- Float soma = 0f;
- Float[] tot = new Float[]{0f, 0f, 0f, 0f, 0f, 0f};
- for (int i = 0; i < this.quantidades.length; i++) {
- tot[i] = this.quantidades[i] * this.valores[i];
- soma = soma + tot[i];
- }
- this.valoresT = tot;
- this.setTotal(soma);
- this.setTaxaGarcon();
- }
- public void setValores(Float[] valores) {
- this.valores = valores;
- }
- public Integer getTotalItens() {
- return totalItens;
- }
- public void setTotalItens(Integer totalItens) {
- this.totalItens = totalItens;
- }
- public Float getTotal() {
- return total;
- }
- public void setTotal(Float total) {
- this.total = total;
- }
- public Float getTaxaGarcon() {
- return taxaGarcon;
- }
- public void setTaxaGarcon() {
- Float taxa = this.getTotal() * 0.12f;
- this.taxaGarcon = taxa;
- this.setTotalGeral();
- }
- public Float getTotalGeral() {
- return totalGeral;
- }
- public void setTotalGeral() {
- this.totalGeral = this.getTotal() + this.getTaxaGarcon();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement