Advertisement
Guest User

Exc

a guest
Jan 20th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.46 KB | None | 0 0
  1. package com.company;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class USDtoBGN {
  6. public static void main(String[] args) {
  7. Scanner scanner = new Scanner(System.in);
  8. Double USD = Double.parseDouble(scanner.nextLine());
  9. Double BGN = USD * 1.79549;
  10. System.out.printf("%.2f", BGN);
  11.  
  12. }
  13. }
  14.  
  15. ---------------------------------------------------------------------------------------------------------------
  16. package com.company;
  17.  
  18. import java.util.Scanner;
  19.  
  20. public class RadiansToDegrees {
  21. public static void main(String[] args) {
  22. Scanner scanner = new Scanner(System.in);
  23. Double Radians = Double.parseDouble(scanner.nextLine());
  24. Double Degrees = Radians * 180 / Math.PI;
  25. System.out.printf("%.0f", Degrees);
  26.  
  27. }
  28. }
  29.  
  30. ----------------------------------------------------------------------------------------------------------------
  31.  
  32. package com.company;
  33.  
  34. import java.util.Scanner;
  35.  
  36. public class RectangleArea {
  37. public static void main(String[] args) {
  38. Scanner scanner = new Scanner(System.in);
  39. Double x1 = Double.parseDouble(scanner.nextLine());
  40. Double y1 = Double.parseDouble(scanner.nextLine());
  41. Double x2 = Double.parseDouble(scanner.nextLine());
  42. Double y2 = Double.parseDouble(scanner.nextLine());
  43.  
  44. double length = Math.abs(x1 - x2);
  45. double width = Math.abs(y1 - y2);
  46.  
  47. Double area = length * width;
  48. Double perimeter = 2 * (length + width);
  49. System.out.printf("%.2f", area);
  50. System.out.println();
  51. System.out.printf("%.2f", perimeter);
  52. }
  53. }
  54.  
  55.  
  56. ______________________________________________________________________________
  57.  
  58. package com.company;
  59.  
  60. import java.util.Scanner;
  61.  
  62. public class TailoringWorkshop {
  63. public static void main(String[] args) {
  64. Scanner scanner = new Scanner(System.in);
  65. int tables = Integer.parseInt(scanner.nextLine());
  66. double tablesLength = Double.parseDouble(scanner.nextLine());
  67. double tablesWidth = Double.parseDouble(scanner.nextLine());
  68.  
  69. double CoverArea = (tablesLength + 2 * 0.30)*(tablesWidth + 2 * 0.30);
  70. double CoachArea = (tablesLength/2)*(tablesLength/2);
  71.  
  72. double areaCovers = tables*CoverArea;
  73. double areaSquares = tables*CoachArea;
  74.  
  75. double priceCovers = areaCovers * 7;
  76. double priceSquares = areaSquares * 9;
  77. double USD = priceCovers + priceSquares;
  78.  
  79. double BGN = USD * 1.85;
  80.  
  81. System.out.printf("%.2f USD%n", USD);
  82. System.out.printf("%.2f BGN", BGN);
  83. }
  84. }
  85.  
  86. ------------------------------------------------------------------------------------
  87.  
  88. package com.company;
  89.  
  90. import java.util.Scanner;
  91.  
  92. public class RoomForDancing {
  93. public static void main(String[] args) {
  94. Scanner scanner = new Scanner(System.in);
  95.  
  96. Double length = Double.parseDouble(scanner.nextLine());
  97. Double width = Double.parseDouble(scanner.nextLine());
  98. Double WardrobeSide = Double.parseDouble(scanner.nextLine());
  99.  
  100. Double RoomInCM = (length * 100) * (width * 100);
  101. Double WardrobeSize = (WardrobeSide * 100 * WardrobeSide * 100);
  102. Double BenchSize = RoomInCM/10;
  103. Double FreeRoomSize = RoomInCM - WardrobeSize - BenchSize;
  104. Double Dancers = FreeRoomSize/(7040);
  105.  
  106. System.out.printf("%.0f", Math.floor(Dancers));
  107. }
  108. }
  109.  
  110. -----------------------------------------------------------------------------------------------------
  111.  
  112. package com.company;
  113.  
  114. import java.util.Scanner;
  115. import java.util.zip.DeflaterOutputStream;
  116.  
  117. public class Charity {
  118. public static void main(String[] args) {
  119. Scanner scanner = new Scanner(System.in);
  120.  
  121. Double Days = Double.parseDouble(scanner.nextLine());
  122. Double Confectioners = Double.parseDouble(scanner.nextLine());
  123. Double Cakes = Double.parseDouble(scanner.nextLine());
  124. Double Wafer = Double.parseDouble(scanner.nextLine());
  125. Double Pancake = Double.parseDouble(scanner.nextLine());
  126.  
  127. Double CakesPrice = Cakes * 45;
  128. Double WaferPrice = Wafer * 5.80;
  129. Double PancakePrice = Pancake * 3.20;
  130. Double TotalPriceForADay = (CakesPrice+WaferPrice+PancakePrice)*Confectioners;
  131. Double TotalPriceFromCampaign = TotalPriceForADay * Days;
  132. Double expenses = TotalPriceFromCampaign - (TotalPriceFromCampaign* 0.125);
  133. System.out.printf("%.2f", expenses);
  134.  
  135. }
  136. }
  137.  
  138.  
  139. ==============================================================================================================
  140.  
  141. package com.company;
  142.  
  143. import java.util.Scanner;
  144.  
  145. public class AlcoholMarket {
  146. public static void main(String[] args) {
  147. Scanner scanner = new Scanner(System.in);
  148. Double WishkeyPrice = Double.parseDouble(scanner.nextLine());
  149. Double BeerLiters = Double.parseDouble(scanner.nextLine());
  150. Double WineLiters = Double.parseDouble(scanner.nextLine());
  151. Double RakijaLiters = Double.parseDouble(scanner.nextLine());
  152. Double WishkeyLiters = Double.parseDouble(scanner.nextLine());
  153.  
  154. Double RakijaPrice = WishkeyPrice * 0.50;
  155. Double WinePrice = RakijaPrice * 0.60;
  156. Double BeerPrice = RakijaPrice * 0.20;
  157. Double TotalPrice = (RakijaPrice * RakijaLiters) + (WinePrice * WineLiters) +
  158. (BeerPrice*BeerLiters) + (WishkeyPrice * WishkeyLiters);
  159. System.out.printf("%.2f", TotalPrice);
  160. }
  161. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement