subject
Computers and Technology, 13.05.2021 19:30 tay8963

Public class Square extends Shape{ /**Like with Shape, we will be making a static instance variable
* to keep track of how many squares we have made. It is very
* similar to the one in shape, and it's uses are similar as well.
* It too is initialized to zero.
*
* We may also need additional instance variables, which you should
* declare as needed. They will not need to be static nor initialized
* here though.
**/
/**You may need additional instance variables. Declare them here.
**/
/**The constructor for Square is a little more involved than the
* Shape constructor, as it takes a single double parameter representing
* the side length. It should also call the super constructor, as
* calling it increments the number of shapes made, which we should
* do (as a Square extends Shape). We also need to increment the
* instance variable representing the number of squares made, and handle
* our parameter appropriately.
**/
public Square(double sideLength){
}
/**Like with our other shapes, this is a simple getter method for our
* static instance variable.
**/ public static int getNumSquaresMade(){
return -1;
}
/**As always, we must override getSize() for our Square. A Square's size
* is simply it's side length squared.
**/
}
public class Shape{
private static int numShapesMade = 0;
public Shape(){
numShapesMade++;
}
public static int getNumShapesMade(){
return numShapesMade;
}
public double getSize(){
return 0;
}
}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 06:30
You have a small company and want to keep your costs low, but it is important your employees share data. which network would provide you with the most economical solution?
Answers: 1
question
Computers and Technology, 23.06.2019 15:30
1. ask the user how many questions are in the quiz. 2. ask the user to enter the key (that is, the correct answers). there should be one answer for each question in the quiz, and each answer should be an integer. e.g., 34 7 13 100 81 3 9 10 321 12 might be the key for a 10-question quiz. you will need to store the key in an array. 3. ask the user to enter the answers for the quiz to be graded. there needs to be one answer for each question. note that these answers do not need to be stored; each answer can simply be compared to the key as it is entered. 4. when the user has entered all of the answers to be graded, print the number correct and the percent correct. 5. add a loop so that the user can grade any number of quizzes with a single key. after the results have been printed for each quiz, ask "grade another quiz? (y/n)." note: you only have one array (the key). you are not creating a new key for each set of quiz answers.
Answers: 3
question
Computers and Technology, 23.06.2019 19:40
Use a physical stopwatch to record the length of time it takes to run the program. calculate the difference obtained by calls to the method system.currenttimemillis() just before the start of the algorithm and just after the end of the algorithm. calculate the difference obtained by calls to the method system.currenttimemillis() at the start of the program and at the end of the program so that the elapsed time includes the display of the result. use the value returned by the method system.currenttimemillis() just after the end of the algorithm as the elapsed time.
Answers: 3
question
Computers and Technology, 23.06.2019 20:30
What is the biggest difference between section breaks and regular page breaks
Answers: 1
You know the right answer?
Public class Square extends Shape{ /**Like with Shape, we will be making a static instance variable...
Questions
question
Mathematics, 16.07.2020 06:01
question
Mathematics, 16.07.2020 06:01
question
Biology, 16.07.2020 06:01
question
Spanish, 16.07.2020 06:01
Questions on the website: 13722363