class Aggregate is incorrect. Choose the correct line so that this program prints Granite: weight-25.0 value-4...
What is output? public abstract class People { protected string name; protected int age; public abstract void PrintInfo(); public void PrintInformation() { System.out.println("In Base Class People"); public class Teacher extends People { private int experience; public void PrintInfo() { System.out.println("In Child Class Teacher"); public class Principal extends Teacher { public void PrintInformation() { System.out.println("In Child Class Principal"); public static void main(String args[]) { Principal tim; tim = new Principal(); tim.PrintInfo(); In Base Class People Error: Compiler error In Child Class...
Could someone re-write this code so that it first prompts the user to choose an option from the calculator (and catches if they enter a string), then prompts user to enter the values, and then shows the answer. Also, could the method for the division be rewritten to catch if the denominator is zero. I have the bulk of the code. I am just having trouble rearranging things. ------ import java.util.*; abstract class CalculatorNumVals { int num1,num2; CalculatorNumVals(int value1,int value2)...
CONVERT THIS JAVA CODE WITH THE JAVA DOC GUIDELINES WHERE APPROPRIATE. DO NOT CHANGE THE CODE. SAME CODE SHOULD BE USED FOR THE DOCUMENTATION PURPOSES. ONLY INSERT THE JAVA DOC. //Vehicle.java public class Vehicle { private String manufacturer; private int seat; private String drivetrain; private float enginesize; private float weight; //create getters for the attributes public String getmanufacturer() { return manufacturer; } public String getdrivetrain() { return drivetrain;...
Copy the program AmusementRide.java to your computer and add your own class that extends class AmusementRide. Note: AmusementRide.java contains two classes (class FerrisWheel and class RollerCoaster) that provide examples for the class you must create. Your class must include the following. Implementations for all of the abstract methods defined in abstract class AmusementRide. At least one static class variable and at least one instance variable that are not defined in abstract class AmusementRide. Override the inherited repair() method following the...
Java help: 1.1) Create a class TA that extends class Student. 1.2) Add a variable to the TA class to represent the course the student is TA'ing. 1.3) Provide a constructor for the class so the code in the PeopleFactory will work as provided. 1.4) Provide a toString() method for the TA class so that TA's will output as shown in the sample code. Provide a class Staff so that you can un-comment the lines of code in the PeopleFactory class that...
Specification Modify a Java application that prints the value of the mathematical constant Pi. Copy the PiDay.java program and do the following: implement the abstract methods that are declared in abstract class Number; implement the two methods marked "TBI (To Be Implemented)" in PiDay.java; answer the three questions/exercises presented in the program's file comment block. ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- /* * PiDay is-a a Number. * * @creator gdt * @created 02017.02.26 * @updated 02019.01.30 * * Answer the following questions here in...
Specification Modify a Java application that prints the value of the mathematical constant Pi. Copy the PiDay.java program and do the following: implement the abstract methods that are declared in abstract class Number; implement the two methods marked "TBI (To Be Implemented)" in PiDay.java; answer the three questions/exercises presented in the program's file comment block. ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- PiDay.java /* * PiDay is-a a Number. * * @creator gdt * @created 02017.02.26 * @updated 02019.01.30 * * Answer the following questions here...
1) Consider the following Java program: 1 public class HelloWorld { 2 // My first program! 3 public static void main(String[] args) { 4 System.out.println("Hello, World!"); 5 } 6 } What is on line 1? a. a variable declaration b. a statement c. a method (subroutine) definition d. a comment e. a class definition 2) Which one of the following does NOT describe an array? a. It can be used in a for-each loop. b. It has a numbered sequence...
Modify the library program as follows: Create a method in the LibraryMaterial class that accepts a string s as a parameter and returns true if the title of the string is equal to s. Create the same method for your library material copies. Note that it will need to be abstract in the LibraryMaterialCopy class MY CODE **************************************************************** LibraryCard: import java.util.List; import java.util.ArrayList; import java.time.LocalDate; import java.time.temporal.ChronoUnit; public class LibraryCard { private String id; private String cardholderName; ...
please help
Question 2 (1 point) Saved Choose the option that best describes what happens when the bolded println() statement is executed: public class Point { public static void main(String[] args) { Point p 1 = new Point(3, 4); System.out.println(p1); } public int x, y; public Point(int xx, int yy) { x = xx; y = yy; } سی Point inherited a toString() method, which is called internally by println(). This is a compile error - println doesn't know how...