Program to find Surface Area and Volume of Octagonal Prism | Java program to find the Surface area and volume of octagonal prism ; Function to find the Volume of octagonal prism ; Formula to calculate volume = ( area * h ) ; Display volume ; Function to find the surface area of octagonal prism ; Formula to calculate Surface area ; Driver Code
public class GFG { static void find_volume ( double area , double h ) { double Volume = ( area * h ) ; System . out . println ( " Volume : ▁ " + Volume ) ; } static void find_Surface_area ( double area , double a , double h ) { double Surface_area = ( 2 * area ) + ( 8 * a * h ) ; System . out . println ( " Surface ▁ area : ▁ " + Surface_area ) ; } public static void main ( String [ ] args ) { double h = 1 ; double a = 6 ; double d = 2 ; double area = 2 * a * d ; find_Surface_area ( area , a , h ) ; find_volume ( area , h ) ; } }