Skip to content

Instantly share code, notes, and snippets.

@folivetti
Created February 17, 2017 15:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save folivetti/f41f4f5553185d5649ba372fcb76af79 to your computer and use it in GitHub Desktop.
Save folivetti/f41f4f5553185d5649ba372fcb76af79 to your computer and use it in GitHub Desktop.
import java.io.IOException;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws IOException {
int X, Y;
double total = 0.0;
Scanner sc = new Scanner(System.in);
X = sc.nextInt();
Y = sc.nextInt();
if (X==1) {
total = 4*Y;
} else if (X==2) {
total = 4.5*Y;
} else if (X==3) {
total = 5*Y;
} else if (X==4) {
total = 2*Y;
} else if (X==5) {
total = 1.5*Y;
}
System.out.printf("Total: R$ %.2f\n", total);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment