URI Problem (Snack) 1038:
Snack 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 10, 2016 * @Time : 1:47:37 AM */ public class Uri1038 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int x,y; x = sc.nextInt(); y = sc.nextInt(); double price[] = {4.00,4.50,5.00,2.00,1.50}; if(price.length >= x){ System.out.printf("Total: R$ %.2f\n",price[x-1]*y); } } }