Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.util.Scanner;
- public class USDtoBGN {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- Double USD = Double.parseDouble(scanner.nextLine());
- Double BGN = USD * 1.79549;
- System.out.printf("%.2f", BGN);
- }
- }
- ---------------------------------------------------------------------------------------------------------------
- package com.company;
- import java.util.Scanner;
- public class RadiansToDegrees {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- Double Radians = Double.parseDouble(scanner.nextLine());
- Double Degrees = Radians * 180 / Math.PI;
- System.out.printf("%.0f", Degrees);
- }
- }
- ----------------------------------------------------------------------------------------------------------------
- package com.company;
- import java.util.Scanner;
- public class RectangleArea {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- Double x1 = Double.parseDouble(scanner.nextLine());
- Double y1 = Double.parseDouble(scanner.nextLine());
- Double x2 = Double.parseDouble(scanner.nextLine());
- Double y2 = Double.parseDouble(scanner.nextLine());
- double length = Math.abs(x1 - x2);
- double width = Math.abs(y1 - y2);
- Double area = length * width;
- Double perimeter = 2 * (length + width);
- System.out.printf("%.2f", area);
- System.out.println();
- System.out.printf("%.2f", perimeter);
- }
- }
- ______________________________________________________________________________
- package com.company;
- import java.util.Scanner;
- public class TailoringWorkshop {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int tables = Integer.parseInt(scanner.nextLine());
- double tablesLength = Double.parseDouble(scanner.nextLine());
- double tablesWidth = Double.parseDouble(scanner.nextLine());
- double CoverArea = (tablesLength + 2 * 0.30)*(tablesWidth + 2 * 0.30);
- double CoachArea = (tablesLength/2)*(tablesLength/2);
- double areaCovers = tables*CoverArea;
- double areaSquares = tables*CoachArea;
- double priceCovers = areaCovers * 7;
- double priceSquares = areaSquares * 9;
- double USD = priceCovers + priceSquares;
- double BGN = USD * 1.85;
- System.out.printf("%.2f USD%n", USD);
- System.out.printf("%.2f BGN", BGN);
- }
- }
- ------------------------------------------------------------------------------------
- package com.company;
- import java.util.Scanner;
- public class RoomForDancing {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- Double length = Double.parseDouble(scanner.nextLine());
- Double width = Double.parseDouble(scanner.nextLine());
- Double WardrobeSide = Double.parseDouble(scanner.nextLine());
- Double RoomInCM = (length * 100) * (width * 100);
- Double WardrobeSize = (WardrobeSide * 100 * WardrobeSide * 100);
- Double BenchSize = RoomInCM/10;
- Double FreeRoomSize = RoomInCM - WardrobeSize - BenchSize;
- Double Dancers = FreeRoomSize/(7040);
- System.out.printf("%.0f", Math.floor(Dancers));
- }
- }
- -----------------------------------------------------------------------------------------------------
- package com.company;
- import java.util.Scanner;
- import java.util.zip.DeflaterOutputStream;
- public class Charity {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- Double Days = Double.parseDouble(scanner.nextLine());
- Double Confectioners = Double.parseDouble(scanner.nextLine());
- Double Cakes = Double.parseDouble(scanner.nextLine());
- Double Wafer = Double.parseDouble(scanner.nextLine());
- Double Pancake = Double.parseDouble(scanner.nextLine());
- Double CakesPrice = Cakes * 45;
- Double WaferPrice = Wafer * 5.80;
- Double PancakePrice = Pancake * 3.20;
- Double TotalPriceForADay = (CakesPrice+WaferPrice+PancakePrice)*Confectioners;
- Double TotalPriceFromCampaign = TotalPriceForADay * Days;
- Double expenses = TotalPriceFromCampaign - (TotalPriceFromCampaign* 0.125);
- System.out.printf("%.2f", expenses);
- }
- }
- ==============================================================================================================
- package com.company;
- import java.util.Scanner;
- public class AlcoholMarket {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- Double WishkeyPrice = Double.parseDouble(scanner.nextLine());
- Double BeerLiters = Double.parseDouble(scanner.nextLine());
- Double WineLiters = Double.parseDouble(scanner.nextLine());
- Double RakijaLiters = Double.parseDouble(scanner.nextLine());
- Double WishkeyLiters = Double.parseDouble(scanner.nextLine());
- Double RakijaPrice = WishkeyPrice * 0.50;
- Double WinePrice = RakijaPrice * 0.60;
- Double BeerPrice = RakijaPrice * 0.20;
- Double TotalPrice = (RakijaPrice * RakijaLiters) + (WinePrice * WineLiters) +
- (BeerPrice*BeerLiters) + (WishkeyPrice * WishkeyLiters);
- System.out.printf("%.2f", TotalPrice);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement