Advertisement
Guest User

Untitled

a guest
Nov 4th, 2019
422
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.47 KB | None | 0 0
  1. package com.company;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class CalculateDiscount {
  6.     public static void main(String[] args) {
  7.         Scanner user_input = new Scanner(System.in);
  8.  
  9.         int items =user_input.nextInt();
  10.  
  11.         double price=0.0;
  12.  
  13.         for (int i=0; i<items; i++) {
  14.  
  15.             double inputPrice = user_input.nextDouble();
  16.  
  17.             price = 0.35*inputPrice;
  18.  
  19.             System.out.printf("%.2f\n",price) ;
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement