1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Ivenika [448]
3 years ago
10

Write your own accessor and mutator method for the Rectangle class instance variables. You should create the following methods:

getHeight setHeight getWidth setWidth getArea getPerimeter toString- The output of a rectangle with width 10 and height 4 method should be:
Computers and Technology
1 answer:
frozen [14]3 years ago
7 0

Answer:

Public int getHeight(){

return height;

}

public int getWidht(){

return widht;

}

public int setHeight(int change){

height = change;

}

public int setWidht(int change){

widht = change;

}

public int getPerimeter(){

int perimeter = 2 ( getWidht() + getHeight ());

return perimeter;

If the width is 10 and height 4, the perimeter should be 28.

Explanation:

An accessor in Java is a method that is used to get the value of an object variable. The program above has three accessor methods, getHeight, getWidht and getPerimeter.

Mutators are methods that is used to change of mutate the value of object variables. They are denoted or identified by the set prefix in their names. From the class code, the mutator are setHeight and setWidht.

You might be interested in
Which is a good guideline to follow when looking for research material on the Internet?
labwork [276]
Hello,

The answer is option A p<span>ay attention to URL endings, such as .gov and .com.

Reason:

Its A because its a very important guideline to make sure you look for the root words .gov and .com to make sure its professional. Its not option B because using search engines can cause viruses. Its also not option C because anything can look professional just by how the website looks and says.

If you need anymore help feel free to ask me!

Hope this helps!

~Nonportrit</span>
5 0
4 years ago
Read 2 more answers
A _____________ is used to make a deep copy of an object.
lesya [120]
The answer is a 3D Printer
3 0
4 years ago
https://brainly.com/question/10197478#:~:text=Option%20A%20is%20the%20correct,in%20return%20of%20their%20money.
Alex17521 [72]
Thanks for free points
7 0
3 years ago
Which kind of image is indispensable and needs added text to go with it?
madreJ [45]

Answer:

A chart and a graph are kind of image that are indispensable and need added text to go with it.

4 0
3 years ago
Explain with example how does delay marriage help for population management​
nikdorinn [45]

Answer:

Explanation:

The population in western richer countries is decreasing but the population in some poorer developing countries is increasing and normally in the poorer communities where education is minimal or not encouraged then men and women tend to get married young and have many children. Population management is not necessary because when men and women are educated and have good standard of living with a good social system of caring for the old then married couples will tend to have one or two kids or none at all. Population control was practised by PrC and it managed to alleviate 60% of the people out if poverty and reduced the population by implementing one child policy. Now China has more male than female creating social problems of finding a wife. In the West with good social system to care for the elderly more couples are not having children. In the west where living conditions and educational level are better the Caucasian race is not having that many children as the other races in developing countries. Education and financial independence of women will encourage married women to have one or two kids so that they can still pursue their career after marriage. With modern contraception you can delay having children until you are ready for them. The concept of delaying marriage to reduce population does not hold true. However the whites’ population is decreasing every year as compared to the other non white races. The reason is that in the poorer non white countries the population is higher because of subservient position of the women who have no say in birth control

8 0
4 years ago
Other questions:
  • How can I print an int as a char in C?
    13·2 answers
  • To change the caption for a field in a query, click the field in the design grid, click the ____ button on the Design tab, click
    14·1 answer
  • Letm1, m2,···mnbe distinct numbers on the number line, in the increasing order. Your goalis to color all of them blue. You have
    9·1 answer
  • Which of these computers was marketed as a computer/game machine?
    15·2 answers
  • Given that two int variables, total and amount, have been declared, write a sequence of statements that: initializes total to 0
    14·1 answer
  • What are the benefits of Photoshop for graphic editors?
    8·1 answer
  • Fill in the code to complete the following function for computing a Fibonacci number. public static int fib(int index) { if (ind
    6·1 answer
  • TWO MINUTES LEFT<br> ________ __________ is the physical arrangement of devices on a network.
    9·1 answer
  • IMPORTANT!!<br><br> How can you get real answer keys for edmentum (plato) courses as a student?
    11·1 answer
  • Anyone know how to do Calculator program in python ?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!