Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package edu.colorado.collections;
- import java.io.*;
- import java.util.*;
- import java.math.*;
- import java.util.Scanner;
- import java.io.IOException;
- public class boardFoot
- {
- //Math function to calculate board foot
- public static int bf(int w, int h)
- {
- float m = w * h * 12 / 144;
- return 0;
- }
- /**
- * @param args
- * @throws IOException
- */
- public static void main(String[] args) throws IOException
- {
- // TODO Auto-generated method stub
- char key;
- Scanner sc = new Scanner(System.in);
- int w;
- int h;
- //Greeting text on what this program does
- System.out.println("This program is used to calculate the multiplier");
- System.out.println("for Board Foot of any size of lumber");
- System.out.println("Please enter the Width and Heigth below");
- System.out.println("For examaple 2x6 would be 1.5 and 5.5");
- do
- {
- //Where the user can enter the width and height
- System.out.println("Enter the Width: ");
- w = sc.nextInt();
- System.out.println("Enter the height: ");
- h = sc.nextInt();
- //Do loop to keep the program going
- float m = bf(w, h);
- //Shows the user the result in the board foot multiplier calculation
- System.out.println("The multiplier is:" + m );
- System.out.println("Would you like to calculate more? (y,n): ");
- key = (char) System.in.read();
- }
- while(key == 'y');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement