URI Problem (Simple Calculate) 1010:
Simple Calculate is a basic problem on URI online judge for novice problem solver.
You can find details on this Link.
import java.util.Scanner;
/**
* @Author : Muhammad Harun-Or-Roshid
* @Date : Oct 5, 2016
* @Time : 9:39:55 PM
*/
public class Uri1010 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int c_1_p, c_2_p, n_1_p, n_2_p;
double v_1_p, v_2_p, total;
c_1_p = sc.nextInt();// code of product
n_1_p = sc.nextInt();// units of product
v_1_p = sc.nextDouble();// price for one unit of product
c_2_p = sc.nextInt();// code of product
n_2_p = sc.nextInt();// units of product
v_2_p = sc.nextDouble();// price for one unit of product
total = (n_1_p * v_1_p) + (n_2_p * v_2_p); // total price of products
System.out.printf("VALOR A PAGAR: R$ %.2f\n", total);
}
}
0 Comments