calculateAnswer (circRadi, triBase, lengthRect, widthRect, shapeNum, triHeight); This line, all but shapeNum say may not be initialized, im confused on what to do, they're all declared by user input.
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /** * * @author Logan */ import java.util.Scanner; public class area { public static void main(String[] args) { //Declaring Variables. int triHeight, triBase, lengthRect, widthRect, shapeNum; double circRadi; Scanner reader = new Scanner (System.in); //Receiving Input System.out.println ("Which shape do you want area for?"); System.out.println("1 Triangle 2 Circle 3 Rectangle 0 None"); shapeNum = reader.nextInt (); if (shapeNum == 1) { System.out.println("Base of triangle?"); triBase = reader.nextInt (); System.out.println("Height of triangle"); triHeight = reader.nextInt (); } else if (shapeNum == 2) { System.out.println("Radius of circle?"); circRadi = reader.nextDouble (); } else if (shapeNum == 3) { System.out.println ("Length of rectangle?"); lengthRect = reader.nextInt (); System.out.println("Width of rectangle?"); widthRect = reader.nextInt (); } calculateAnswer (circRadi, triBase, lengthRect, widthRect, shapeNum, triHeight); } public static void calculateAnswer(double circRadi, int triHeight, int triBase, int lengthRect, int widthRect, int shapeNum){ } public static void areaTriangle(int triBase,int triHeight, int triOutput) { triOutput = (triBase*triHeight)/2; } public static void areaCircle (double circOutput,int circRadi ) { circOutput = (circRadi*Math.PI); } public static void areaRectangle(int rectOutput, int lengthRect, int widthRect) { rectOutput = lengthRect*widthRect; } }