SHARE
TWEET

ProgBasics02Simple-Operations-Y06CharityCampaign

galinyotsev123 Jan 11th, 2019 (edited) 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class Y06CharityCampaign {
  4.     public static void main(String[] args) {
  5.  
  6.         Scanner scanner = new Scanner(System.in);
  7.         double NumberDays = Double.parseDouble(scanner.nextLine());
  8.         double NumberSladkari = Double.parseDouble(scanner.nextLine());
  9.         double NumberTorti = Double.parseDouble(scanner.nextLine());
  10.         double NumberGofreti = Double.parseDouble(scanner.nextLine());
  11.         double NumberPalachinki = Double.parseDouble(scanner.nextLine());
  12.  
  13.         double torti = 45;
  14.         double gofreti = 5.80;
  15.         double palachinki = 3.20;
  16.  
  17.         double TotalTorti = torti * NumberTorti;
  18.         double TotalGofreti = gofreti * NumberGofreti;
  19.         double TotalPalachinki = palachinki * NumberPalachinki;
  20.         double TotalSumaZaEdinDen = (TotalTorti + TotalGofreti + TotalPalachinki) * NumberSladkari;
  21.         double  TotalCampaign = TotalSumaZaEdinDen * NumberDays;
  22.         double Net = TotalCampaign - (TotalCampaign / 8);
  23.  
  24.         System.out.printf("%.2f", Net);
  25.  
  26.     }
  27.  
  28. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top