Computers and Technology

The Rectangle class is provided in the template. First run the program to see what it does. You will need two numbers for input. (1) Add a calculatePerimeter() method to the class (Rectangle. java). calculatePerimeter() has no parameters and returns the perimeter of the rectangle.
(2) In main() in RectangleDemo. java, call the new method and display the results:
Ex:
Enter a length: 7
Enter a width: 5
The area of a 7 by 5 rectangle is 35
The perimeter is 24

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 15:30, DestinyK8033
Why would a programmer use the logical operator and in an if statement? a: when an action is to be taken that requires both conditions to be falseb: when an action is to be taken that requires both conditions to be truec: when an action is to be taken that requires the first condition to be falsed: when an action is to be taken that requires the second condition to be truei took the test and the answer is b.
Answers: 3
image
Computers and Technology, 23.06.2019 08:30, sofigaviria05
All of these are true about using adhesive except: a. dissimilar materials can be joined. b. mixing tips are product and material specific. c. a specific application gun may be required. d. two-part adhesives are dispensed using two mixing tips
Answers: 3
image
Computers and Technology, 23.06.2019 14:00, ava5015
What is html ? give a small description about html
Answers: 2
image
Computers and Technology, 24.06.2019 01:30, BIKRAMlawati5544
Could you find out how im still getting an 83 percent on this in edhesive a = input("enter an animal: ") s = input ("enter a sound: ") e = "e-i-e-i-o" print ("old macdonald had a farm, " + e) print ("and on his farm he had a " + a + "," + e) print ("with a " + s + "-" + s + " here and a " + s + "-" + s + " there") print ("here a " + s+ " there a " + s) print ("everywhere a " + s + "-" + s ) print ("old macdonald had a farm, " + e)
Answers: 2
Do you know the correct answer?
The Rectangle class is provided in the template. First run the program to see what it does. You will...

Questions in other subjects: