Question: Please help! I need to fix the following errors in my code. The three classes ConicalFrustrum , ConicalFrustrumApp and ConicalFrustrumList were used for this assignment.
Please help! I need to fix the following errors in my code. The three classes "ConicalFrustrum" , "ConicalFrustrumApp" and ConicalFrustrumList were used for this assignment.
05/Completed Code/Project5Test.java:761: error: cannot find symbol int actual = list.numberOfConicalFrustums(); ^ symbol: method numberOfConicalFrustums() location: variable list of type ConicalFrustumList 05/Completed Code/Project5Test.java:776: error: cannot find symbol int actual = list.numberOfConicalFrustums(); ^ symbol: method numberOfConicalFrustums() location: variable list of type ConicalFrustumList 2 errors









6 import java.text.DecimalFormat; 7 /** 8 *Program to print ConicalFrustrum objects. 9 *Uses a scanner class and DecimalFormat class. 10 */ 11 public class ConicalFrustum 12 { 13 //private member variables 14 private String label = ""; 15 private double radius1 = 0.0; 16 private double radius2 = 0.0; 17 private double height = 0.0; 18 /** 19 *Constructor for the class. 20 *@param labelIn command line arguments not used. 21 *@param radius1In command line arguments not used. 22 *@param radius2In command line arguments not used. 23 *@param heightIn command line arguments not used. 24 */ 25 public ConicalFrustum(String labelIn, double radius1In, 26 double radius2In, double heightIn) 27 { 28 this.setLabel(labelIn); 29 this.setRadius1(radius1In); 30 this.setRadius2(radius2In); 31 this.setHeight(heightIn); 32 } 33 /** 34 *if else boolean statement. 35 *@return true. 36 *@param labelIn comman line arguments not used. 37 */ 38 public boolean setLabel(String labelIn) 39 { 40 //check for empty string 41 String s = labelIn.trim(); 42 if (s.equals("")) 43 { 44 return false; 45 } 46 else 47 { 48 this.label = s; 49 return true; 50 } 51 } 52 /** 53 *check for negative radius1. 54 *@return false. 55 *if else statement used. 56 *@param radius1In command line arguments not used. 57 */ 58 public boolean setRadius1(double radius1In) 59 { 60 if (radius1In
*Class for ConicalFrustum 3 *Used to create objects 4 *private field used along with strings 5 *Accessor and mutator methods 6 */ 7 import java.util.Scanner; 8 /** 9 *Scanner class imported 10 *Gets label, radius1, radius2, and height. 11 *App class for ConicalFrustrumApp. 12 * 13 */ 14 public class ConicalFrustrumApp 15 { 16 /** 17 * 18 *Allows user to enter input for program. 19 *@param args command line arguments not used. 20 */ 21 public static void main(String[] args) 22 { 23 //Scanner class to get user input. 24 Scanner input = new Scanner(System.in); 25 String label; 26 //double used to get radius1, radius2, and height. 27 double radius1, radius2, height; 28 System.out.println("Enter label, radius1, radius2, " 29 + "and height for a conical frustrum."); 30 System.out.print("\tlabel: "); 31 label = input.nextLine(); 32 System.out.print("\tradius1: "); 33 radius1 = input.nextDouble(); 34 if (radius1
3 import java.text.DecimalFormat; 4 import java.util.ArrayList; 5 import java.util.List; 6 /** 7 * 8 * 9 * 10 * 11 * 12 * 13 */ 14 public class ConicalFrustumList { 15 // String variable for List Name 16 private String listName; 17 // List variable for array list 18 private List
Specifications Overview: You will write a program this week that is composed of three classes: the first class defines ConicalFrustum objects, the second class defines ConicalFrustumList objects, and the third, ConicalFrustumListApp, reads in a file name entered by the user then reads the list name and ConicalFrustum data from the file, creates ConicalFrustum objects and stores them in an ArrayList creates a ConicalFrustumList object with the list name and ArrayList, prints the ConicalFrustumList object, and then prints summary information about the ConicalFrustumList object. A Conical Frustum is a Frustum created by slicing the top off a cone (with the cut made parallel to the base), forming a lower base and an upper base that are circular and parallel ri radius of top r2 radius of bottom h height s slant height S lateral surface area V volume A total surface area | S- * (r1 + r2) * s Source for figures and formulas: https://www.calculatorsoup.com/images/frustum001.gif ConicalFrustum.java (assuming that you successfully created this class in Project 4, just copv the file to vour new Project 5 folder and go on to ConicalFrustumList.java on page 4 Otherwise, you will need to create ConicalFrustum.java as part of this project.) Requirements: Create a ConicalFrustum class that stores the label, radius of top, radius of bottom, and height where the radii and height are non-negative. The ConicalFrustum class also includes methods to set and get each of these fields, as well as methods to calculate the volume, slant height, lateral surface area, and total surface area of a ConicalFrustum object, and a method to provide a String value that describes a ConicalFrustum object. Specifications Overview: You will write a program this week that is composed of three classes: the first class defines ConicalFrustum objects, the second class defines ConicalFrustumList objects, and the third, ConicalFrustumListApp, reads in a file name entered by the user then reads the list name and ConicalFrustum data from the file, creates ConicalFrustum objects and stores them in an ArrayList creates a ConicalFrustumList object with the list name and ArrayList, prints the ConicalFrustumList object, and then prints summary information about the ConicalFrustumList object. A Conical Frustum is a Frustum created by slicing the top off a cone (with the cut made parallel to the base), forming a lower base and an upper base that are circular and parallel ri radius of top r2 radius of bottom h height s slant height S lateral surface area V volume A total surface area | S- * (r1 + r2) * s Source for figures and formulas: https://www.calculatorsoup.com/images/frustum001.gif ConicalFrustum.java (assuming that you successfully created this class in Project 4, just copv the file to vour new Project 5 folder and go on to ConicalFrustumList.java on page 4 Otherwise, you will need to create ConicalFrustum.java as part of this project.) Requirements: Create a ConicalFrustum class that stores the label, radius of top, radius of bottom, and height where the radii and height are non-negative. The ConicalFrustum class also includes methods to set and get each of these fields, as well as methods to calculate the volume, slant height, lateral surface area, and total surface area of a ConicalFrustum object, and a method to provide a String value that describes a ConicalFrustum object
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
