1
Everything was going well until the part where the result should appear.
public static void main( String[] args)
{
Scanner in = new Scanner(System.in);
int num1,num2,resul;
String sinal;
System.out.println("Olá, entre com o primeiro numero: ");
num1 = in.nextInt();
System.out.println("Olá, entre com o segundo numero: ");
num2 = in.nextInt();
System.out.println("Soma (s) Menos (m) Vezes (v) Dividir (d): ");
resul = in.nextInt();
sinal = in.nextLine();
if(sinal.equals ("s"))
{
resul = num1 + num2;
System.out.println("Resultado final "+resul);
}
else if (sinal.equals ("m"))
{
resul = num1 - num2;
System.out.println("Resultado final "+resul);
}
else if (sinal.equals ("v"))
{
resul = num1 * num2;
System.out.println("Resultado final "+resul);
}
else if (sinal.equals("d"))
{
resul = num1 / num2;
System.out.println("Resultado final "+resul);
}
}
I don’t know no haha, first time in java!
– Luiz Felipe Zimbrão
Luiz, you do not need to put "solved" in the title. Only the fact that you have accepted the answer already indicates that it is solved.
– hkotsubo
Ops haha, it was bad and thanks for the tip!
– Luiz Felipe Zimbrão