Skip to content

Commit

Permalink
feat: conversion formated results
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Apr 23, 2024
1 parent 1766ebf commit 9a62d72
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
Binary file modified challenge-backend/challenge01-conversormoedas/bin/App.class
Binary file not shown.
Binary file not shown.
8 changes: 6 additions & 2 deletions challenge-backend/challenge01-conversormoedas/src/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,12 @@ public static void main(String[] args) throws Exception , InterruptedException{
novaConversao = Character.toUpperCase(aux);
}

System.out.println("*******************************************");
System.out.println("OBRIGADO POR UTILIZAR O CONVERSOR DE MOEDAS");
System.out.println("************************");
System.out.println("OBRIGADO POR UTILIZAR O ");
System.out.println("CONVERSOR DE MOEDAS. ");
System.out.println(" ");
System.out.println("PROGRAMA ONE 2024 ");
System.out.println("PROGRAMA ONE 2024 ");
System.out.println("*******************************************");
}

Expand Down
23 changes: 13 additions & 10 deletions challenge-backend/challenge01-conversormoedas/src/RenderScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ public void setCurrency(String currency) {
}

public void generateMenu() {
System.out.println("===============================");
System.out.println(" CONVERSOR DE MOEDAS ");
System.out.println("===============================");
System.out.println(" MENU ");
System.out.println("===========================");
System.out.println(" CONVERSOR DE MOEDAS ");
System.out.println("===========================");
System.out.println(" MENU ");
System.out.println("1 = REAL -> DOLAR");
System.out.println("2 = REAL -> EURO");
System.out.println("3 = DOLAR -> REAL");
Expand Down Expand Up @@ -62,12 +62,15 @@ public void selectConversion(int option) {
}

public void printConversion(double value1, double value2) {
System.out.println("===============================");
System.out.println("===========================");
System.out.println(" VALOR = "+value1);
System.out.println("-------------------------------");
System.out.println(" VALOR CONVERTIDO ");
System.out.print(this.currency + value1 + " --> ");
System.out.println(this.currencyConverted + value2);
System.out.println("===============================");
System.out.println("---------------------------");
System.out.println(" VALOR CONVERTIDO ");
System.out.print(this.currency+" = ");
System.out.printf("%.2f %n",value1);
System.out.println(" || ");
System.out.print(this.currencyConverted+" = ");
System.out.printf("%.2f %n",value2);
System.out.println("===========================");
}
}

0 comments on commit 9a62d72

Please sign in to comment.