Вы находитесь на странице: 1из 1

import java.util.

Scanner;
public class Area3 {
public static void main(String[] args) {
int r;
double pi = 3.1416,aoc;
Scanner jt = new Scanner(System.in);
System.out.println("Enter the radius of a Circle");
r = jt.nextInt();
aoc = pi*r*r;
System.out.println("Area of Circle:" +aoc);
System.out.println();
System.out.println("Enter the Height Square");
double height = jt.nextInt();
System.out.println("Enter the length of a
Square");
double lenght1 = jt.nextInt();
double aos = lenght1*height;
System.out.println("Area of Square:" +aos);
System.out.println();
System.out.println("Enter the lenght of a
Rectangle");
double lenght = jt.nextInt(); import java.util.Scanner;
System.out.println("Enter the width of a import java.text.DecimalFormat;
Rectangle"); public class JavaApplication4 {
double width = jt.nextInt(); public static Scanner jt = new Scanner
double aor = lenght*width; (System.in) ;
System.out.println("Area of Rectangle:" +aor); public static void main(String[] args) {
System.out.println(); DecimalFormat df = new
} DecimalFormat("000.00");
} String name;
String add;
String pi;
double dc = 0.15;
System.out.println("Enter Customer's name");
name=jt.nextLine();
System.out.println("Enter Customers Address");
add=jt.nextLine();
System.out.println("Enter Customer's purchased
Item");
pi = jt.nextLine();
System.out.println("Enter Item's Price");
double price = jt.nextFloat();
System.out.println("Enter Item/s Quantity");
double quantity = jt.nextFloat();
double subtotal = price*quantity;
System.out.println("Total of purchased
Item/s:"+subtotal);
System.out.format("The discounted price is: " +
"" + df.format(subtotal - 0.15* subtotal));
System.out.println();
}
}

Вам также может понравиться