Mrgentledolphin

iva fatture (verifica B)

Nov 30th, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.77 KB | None | 0 0
  1. package scuola;
  2. import java.util.*;
  3. public class IVA1 {
  4.  
  5.     public static void main(String[] args) {
  6.         // TODO Auto-generated method stub
  7.         Scanner input;
  8.         input=new Scanner (System.in);
  9.        
  10.         int nfat, iva, cont = 0, fat;
  11.         float tot = 0, ivatot=0, ivaf;
  12.        
  13.         System.out.println("inserire numero fatture ");
  14.         nfat=input.nextInt();
  15.         System.out.println("inserire percentuale iva ");
  16.         iva=input.nextInt();
  17.          while (cont<nfat){
  18.              cont=cont+1;
  19.              System.out.println("inserire fattura ");
  20.              fat=input.nextInt();
  21.              ivaf=fat/100*iva;
  22.              System.out.println("iva sulla fattura: "+ivaf);
  23.              ivatot=ivatot+ivaf;
  24.              tot=tot+fat+ivaf;
  25.          }
  26.         System.out.println("iva calcolata totale: "+ivatot);
  27.         System.out.println("totale fatture: "+tot);
  28.        
  29.        
  30.     }
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment