lab3-1 - // Write assignment and if statements here as...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
// Lab3_1.java - This program calculates prices for custom made desks. public class Lab3_1 { public static void main(String args[]) { // Declare and initialize variables here. double charge = 0.00; // Charge for this desk. double length = 60; // Length of desk in inches. double width = 48; // Width of desk in inches. double area; // Area of this desk in square inches. String wood = "oak"; // Type of wood. double drawers = 3; // Number of drawers in desk.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: // Write assignment and if statements here as appropriate. area = length * width; if(area > 750) charge += 50.00; if(wood.equals("oak")) charge += 125.00; if(wood.equals("mahogany")) charge += 150.00; if(wood.equals("pine")) charge = charge; charge = charge + 200.00 + (drawers * 30); // Output charge for this desk. System.out.println("The charge for this desk is $" + charge); System.exit(0); } }...
View Full Document

This note was uploaded on 04/30/2008 for the course MNGT 3040 taught by Professor Landrum during the Fall '08 term at Auburn University.

Page1 / 2

lab3-1 - // Write assignment and if statements here as...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online