Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package edu.colorado.collections;
  2. import java.io.*;
  3. import java.util.*;
  4. import java.math.*;
  5. import java.util.Scanner;
  6. import java.io.IOException;
  7.  
  8. public class boardFoot
  9. {
  10.     //Math function to calculate board foot
  11.     public static int bf(int w, int h)
  12.     {
  13.          float m = w * h * 12 / 144;
  14.          return 0;
  15.     }
  16.    
  17.     /**
  18.      * @param args
  19.      * @throws IOException
  20.      */
  21.     public static void main(String[] args) throws IOException
  22.     {
  23.         // TODO Auto-generated method stub
  24.         char key;
  25.        
  26.         Scanner sc = new Scanner(System.in);
  27.         int w;
  28.         int h;
  29.        
  30.         //Greeting text on what this program does
  31.         System.out.println("This program is used to calculate the multiplier");
  32.         System.out.println("for Board Foot of any size of lumber");
  33.         System.out.println("Please enter the Width and Heigth below");
  34.         System.out.println("For examaple 2x6 would be 1.5 and 5.5");
  35.        
  36.         do
  37.          {
  38.         //Where the user can enter the width and height
  39.         System.out.println("Enter the Width: ");
  40.          w = sc.nextInt();
  41.    
  42.         System.out.println("Enter the height: ");
  43.          h = sc.nextInt();
  44.        
  45.         //Do loop to keep the program going
  46.        
  47.             float m = bf(w, h);
  48.             //Shows the user the result in the board foot multiplier calculation
  49.             System.out.println("The multiplier is:" + m ); 
  50.             System.out.println("Would you like to calculate more? (y,n): ");
  51.             key = (char) System.in.read();
  52.         }
  53.         while(key == 'y');
  54.        
  55.     }
  56.  
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement