-
-
Save folivetti/0a1f6b301ae13814c2a4b33995a89436 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.IOException; | |
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) throws IOException { | |
int cod1, cod2; | |
int unidades1, unidades2; | |
double custo1, custo2, total; | |
Scanner sc = new Scanner(System.in); | |
cod1 = sc.nextInt(); | |
unidades1 = sc.nextInt(); | |
custo1 = sc.nextDouble(); | |
cod2 = sc.nextInt(); | |
unidades2 = sc.nextInt(); | |
custo2 = sc.nextDouble(); | |
total = unidades1*custo1 + unidades2*custo2; | |
System.out.printf("VALOR A PAGAR: R$ %.2f\n", total); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment