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
salantis [7]
3 years ago
8

Write a method that takes a Rectangle as a parameter, and changes the width so it becomes a square (i.e. the width is set to the

value of the length) (java)
Computers and Technology
1 answer:
Bumek [7]3 years ago
3 0

Answer:

Explanation:

The following code is written in Java, it is a function/method that takes in the length and width of the Rectangle as parameters and then overwrites the width to match the length. Then it prints both the length and width.

   public static void rectangleToSquare(int width, int length) {

       width = length;

       System.out.println("Width: " + width);

       System.out.println("Length: " + length);

       

   }

You might be interested in
You coded the following class: public class N extends String, Integer { }When you compile, you get the following message:N.java:
lidiya [134]

Answer:

Hi DancingGrace! The issue with the code is that it is trying to extend multiple classes which is not a feature in Java programming.

Explanation:

The extends keyword allows a class to use the attributes and properties of the base class it is extending and add more features and properties into it's own class. This is useful in programming where different models share similar properties but are slightly different. An example would be designing a class for Car and Bike. Both have some similar properties like wheels, engine, etc, however they are different forms of transport. A useful implementation would be to define a class called Vehicle with similar attributes, and have the Car and Bike extend it.  

7 0
4 years ago
What is a device driver​
sleet_krkn [62]

Answer:

Explanation:

In computing, a device driver is a computer program that operates or controls a particular type of device that is attached to a computer. ...

4 0
3 years ago
Read 2 more answers
An organization's contact information includes its _____.
lianna [129]
I would say that it probably includes all of these, but if that's not an option, then it's: email address 
3 0
3 years ago
Read 2 more answers
How to create database using access​
timurjin [86]

i think by using python

6 0
3 years ago
2. A computer is using a fully associative cache and has 216 bytes of memory and a cache of 64 blocks, where each block contains
Irina-Kira [14]

Answer:

2048 blocks

Explanation:

From the information given:

The memory size of a computer with fully associative cache = 2¹⁶ bytes

The no. of blocks in a single cache = 64

In which each block size = 32 bytes

The no of blocks in the main memory = memory size ÷ block size

The no of blocks in the main memory = 2¹⁶ ÷ 32

The no of blocks in the main memory = 2¹⁶ ÷  2⁵

The no of blocks in the main memory = 2^{16-5}

The no of blocks in the main memory = 2¹¹

The no of blocks in the main memory = 2048 blocks

4 0
3 years ago
Other questions:
  • What is binary coded decimal,EBCD and ASCII
    15·1 answer
  • When creating a software package, the software must be designed, the code must be written, and then the code must be tested. Thi
    6·1 answer
  • Write the definition of a method dashedLine, with one parameter, an int. If the parameter is negative or zero, the method does n
    8·1 answer
  • What is top down design? a. Top down design is a way of designing your program by starting with the biggest problem and breaking
    7·1 answer
  • CHEMISTRY. metal+water》base+...............​
    12·1 answer
  • Cora is writing a program to make a motorcycle racing game. If Cora wants to speed of the motorcycle to appear on the screen whe
    12·1 answer
  • What is node ? Briefly explain with diagram<br><br>​
    8·1 answer
  • Write an algorithm to sum all numbers between 0 and 1000 that are divisible by ,7​
    8·1 answer
  • A higher resolution image will mean a?
    13·2 answers
  • What dod instruction implements the dod cui program
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!