You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Faça um programa que receba a quantidade e o valor de dois produtos, no seguinte formato: quantidade1 valor1 quantidade2 valor2. O programa deve calcular esses valores seguindo a fórmula total = (quantidade1 x valor1) + (quantidade2 x valor2).
O valor total deve ser apresentado no final da execução. */
public class Ex02{
public static void main(String args[]){
int quantidade1 = Integer.parseInt(args[0]);
int valor1 = Integer.parseInt(args[1]);
int quantidade2 = Integer.parseInt(args[2]);
int valor2 = Integer.parseInt(args[3]);
int total = (quantidade1 * valor1) + (quantidade2 * valor2);