Fiz este programa(DOS)para escola e gostaria de fazer o mesmo programa mas en arrays.
/this program is for Painting & decorator Company
import java.io.*;// The java Input/Output Packages
import java.text.DecimalFormat;//Decimal Format
class jr{
//main method begins execution of java apllication
public static void main(String args[])throws IOException{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Welcome To Painting and Decorating V1.1
By Luis Barbosa
Email:luisbarbossa@hotomail.com");
// First worked hours entered by user.
System.out.print("
Please Enter" + "
Worked Hours of:" + "
Room Number One : ");
double A = Double.parseDouble (reader.readLine());
// Second worked hours of room number entered by user
System.out.print(" Room Number Two : ");
double B = Double.parseDouble(reader.readLine());
//Third worked hours of room number two entered by user
System.out.print(" Room Number Three: ");
double C = Double.parseDouble(reader.readLine());
// First material cost of room number one entered by user
System.out.print("
Material Cost of: " + "
Room Number One : ");
double D = Double.parseDouble(reader.readLine());
// Second material Cost of room number two entered by user
System.out.print(" Room Number Two : ");
double E = Double.parseDouble(reader.readLine());
// Third material cost of room number three entered by user
System.out.print(" Room Number Three: ");
double F = Double.parseDouble(reader.readLine());
// First area of room number one entered by user
System.out.print("
Room Dimensions Number One :
Length: ");
double G = Double.parseDouble(reader.readLine());
// First area of room number one entered by user
System.out.print(" With : ");
double H = Double.parseDouble(reader.readLine());
// First area of room number one entered by user
System.out.print(" Height: ");
double I = Double.parseDouble(reader.readLine());
// First area of room number one entered by user
System.out.print("
Room Dimensions Number Two :
Length: ");
double J = Double.parseDouble(reader.readLine());
// First area of room number one entered by user
System.out.print(" With : ");
double K = Double.parseDouble(reader.readLine());
// First area of room number one entered by user
System.out.print(" Height: ");
double M = Double.parseDouble(reader.readLine());
// First area of room number one entered by user
System.out.print("
Room Dimensions Number Three :
Length: ");
double O = Double.parseDouble(reader.readLine());
// First area of room number one entered by user
System.out.print(" With : ");
double P = Double.parseDouble(reader.readLine());
// First area of room number one entered by user
System.out.print(" Height: ");
double Q = Double.parseDouble(reader.readLine());
double rate = 12.95;//Decorator rate per an hour
double TOne = (A + B + C) * rate;//Total labour cost of all room
double TTwo = D + E + F;//Total cost of all material
double X = 2;
double RDOne = (G * H) * I;
double RDT= (J * K) * M;
double RDThree = (O * P) * Q;
double TThree = (TOne + TTwo);//Grand total(Total of labour + Total of material)
double vat = (TThree * 0.175) + TThree;//grand total plus vat
DecimalFormat Two = new DecimalFormat( "0.00" ); //decimal number
//Dispaly the result the labour cost of room number one
System.out.println("
The total labour Cost Of Room Number
One is : " + Two.format( rate * A) +" Pounds ");
//Display the result the labour cost of room number two
System.out.println( " Two is : " + Two.format(rate * B) + " Pounds ");
//Dispaly the result the labour cost of room number three
System.out.println( " Three is: " + Two.format(rate * C) + " Pounds ");
//Display the results the total labour of all rooms
System.out.println( "
Total Cost of:
Labour is : " + Two.format(TOne) + " Pounds ");
//Display the results the total cost of all materials rooms;
System.out.println( "
Total Cost of:
All Materials is : " + Two.format(D + E + F) +" Pounds " );
//Dispaly the result the total area of room number one
System.out.println("
Total Area of Room:" + "
Number One is : " + Two.format(RDOne * X) + " Square Metres ");
//Display the result the total area of room number two
System.out.println(" Number Two is : " + Two.format(RDT * X) + " Square Metres ");
//Display the result the total area of room number three
System.out.println(" Number Three is : " + Two.format(RDThree * X) + " Square Metres");
//Display the result the grand total(total labour + total materials
System.out.println( "
The Grand Total:
Labour + Materials is : " + Two.format(TOne + TTwo ) + " Pounds " );
//Display the result the grand total(total labour + total materials
System.out.println( "
The Grand Total:
Plus vat is : " + Two.format(vat) + " Pounds");
} // end method main
}// end class Painting