Class PizzaCost


  • public class PizzaCost
    extends java.lang.Object
    Compute the cost of pizza per square inch
    Author:
    Geoff Sutcliffe
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.Scanner keyboard
      Global Scanner object to use keyboard
      private static double PI
      Pi is 3.14159265
    • Constructor Summary

      Constructors 
      Constructor Description
      PizzaCost()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static double computeUnitCost​(double diameter, double cost)
      Compute the cost per square inch
      static void main​(java.lang.String[] args)
      The main method
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • keyboard

        private static final java.util.Scanner keyboard
        Global Scanner object to use keyboard
    • Constructor Detail

      • PizzaCost

        public PizzaCost()
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)
        The main method
        Parameters:
        args - Passed in from the commend line
      • computeUnitCost

        private static double computeUnitCost​(double diameter,
                                              double cost)
        Compute the cost per square inch
        Parameters:
        diameter - - Diameter of the pizza in inches
        cost - - Cost of the pizza in dollars
        Returns:
        The cost per square inch in dollars