JAVA CODE.


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).

This method must be called makeSquare() and it must take a Rectangle parameter.

Answers

Answer 1

Solution :

public class Rectangle  

{

int len,bre;

Rectangle(int l,int b)

{

setLength(l);

setBreadth(b);

}

void setLength(int l)

{

len=l;

}

void setBreadth(int b)

{

bre=b;

}

int getLength()

{

return len;

}

int getBreadth()

{

return bre;

}

void makeSquare(Rectangle r)

{

r.setBreadth(len);

System.out.println("Square Parameter");

System.out.println("Length:" +r.getLength() + " Length: ".getBreadth());

}

public static void main(String[] args){

Rectangle r=new Rectangle(10,5);

System.out.println("Rectangle Parameter");

System.out.println("Length:"+r.getLength()+" Breadth:"+r.getBreadth());

r.makeSquare(r);

 }

 }

}


Related Questions

A commonly-used estimate for the number of bytes needed to store one
page of a book is 2K (2,000). Harry Potter books have 800 pages. Each
book is 3 inches in height. How tall would the stack of Harry Potter books
be, in miles, that could be stored in a 32-bit memory space? Now, repeat
the question for a 64-bit memory space.

Answers

Answer:

0.127 miles ; 5.458 *10^8 miles

Explanation:

Number of bytes needed to store a page = 2000

Number of pages (Harry Potter's book) = 800

Total memory required to store entire book = (2000 * 800) = 1600000 = 16 * 10^5 bytes

Hence,

1 byte of memory will store : (height of each book / memory size of each book)

= 3 ÷ 16 * 10^5

= 1.875 * 10^-6

For 32 bit memory space :

(1.875 * 10^-6 * 2^32) = 8053.06368 inches

1 inch = 1.578 * 10^-5 mile

8053.06368 inches = 8053.06368 * (1.578 * 10^-5) = 0.1270773448704 miles

= 0.127 miles

For 64 bit memory size :

(1.875 * 10^-6 * (2^64)) = 3.45876 * 10^13 inches

(3.45876 * 10^13) * (1.578 * 10^-5)

= 5.458 *10^8 miles

What is the result of adding 1234.5674 and
45.67843 if you round to the nearest thousandth BEFORE the addition?

A. 1280.24543

B. 1280.246

C. 1280.245

D. 1280.24

Answers

Answer:

C. 1280.245

Explanation:

1234.567 + 45.678 = 1280.245

One way your program uses object-oriented programming is through polymorphism.

What is one way polymorphism is implemented?

repurposing an operation
created a new class using an existing class
hiding class variables from the programs using instances of the class
changing a variable from a string to a float

Answers

The way polymorphism is implemented is repurposing an operation. Option A

What is polymorphism?

Polymorphism in object-oriented programming allows objects of different classes to be used interchangeably, while performing the same action or operation.

One way polymorphism can be implemented is through the creation of a new class that inherits from an existing class and overrides one or more of its methods to provide a different implementation.

This is known as method overriding. By doing so, objects of the new class can be used in place of objects of the original class, but with the overridden behavior.

This enables more flexibility and extensibility in software design, making it easier to add new features or functionality without modifying existing code.

Read more about polymorphism at: https://brainly.com/question/14201762

#SPJ1

Which of the following is one of the tools in REPL.it that helps prevent syntax errors?
It adds closing quotes and parentheses if you type the opening ones.
It changes your binary input to the decimal system.
It allows you to see the interpreter’s algorithm.
It limits the pixel resolution.

Answers

Answer:

A. It adds closing quotes and parentheses if you type the opening ones.

Explanation:

Answer:

Yes the answer is A got a 100% hope you get a 100% too have a good day:)

Explanation:

Which of the following BEST describes a front-end developer?

Answers

Answer:

plz give me BRAINLIEST answer

Explanation:

Definition: Front end development manages everything that users visually see first in their browser or application. Front end developers are responsible for the look and feel of a site. ... As a front end developer you are responsible for the look, feel and ultimately design of the site.

A front-end developer is a type of software developer who specializes in creating the user interface (UI) and user experience (UX) of a website or application. They are responsible for translating design mock-ups and wireframes into functional code using programming languages such as HTML, CSS, and JavaScript.

Front-end developers work on the client-side of web development, focusing on the visual aspects and interactions that users see and experience directly. They ensure that the website or application is visually appealing, responsive, and user-friendly across different devices and browsers.

In addition to coding, front-end developers collaborate closely with designers and back-end developers to integrate the UI with the back-end systems and databases. They may also be involved in optimizing the performance and accessibility of the front-end code, as well as testing and debugging to ensure smooth functionality.

Learn more about databases on:

https://brainly.com/question/30163202

#SPJ6

Who Likes K-pop? Which group or groups do you like

Answers

Answer:

i like k pop a little and im a blink i also like mother mother and arctic monkeys

Explanation:

Answer:

k-pop & Blackpink

Explanation:

<3

could someone please help me with this?

Answers

Answer:

See explanation

Explanation:

Given

if(fish > 400) {

Required

What is the condition checking?

The above statement is an if conditional statement. Analysing the statement in bits:

if -> This represents the beginning of the conditional statement

fish -.> The variable that is being checked

> 400 -> The condition which the variable is being measured by.

So, the statement above is checking if the value of variable fish is greater than 400.

If the condition is true, the instructions associated to that if statement will be executed.

Exercise 7.2.6: If You're Not First, You're Last
Write the function called end_of_word that takes a string and returns everything but the first character.

end_of_word ("boat")
="oat"
end_of_word ("mice")
="ice"​

Answers

Answer:

end_of_word ("boat")

="oat"

end_of_word ("mice")

="ice"​

Explanation:you need to call out your function in the best way possible

Answer:

def end_of_word(word):

   return word[1:]

print(end_of_word("something"))

Explanation:

Your welcome :D

Write about the history of computer.​

Answers

Answer:

Charles Babbage, an English mechanical engineer and polymath, originated the concept of a programmable computer. Considered the "father of the computer", he conceptualized and invented the first mechanical computer in the early 19th century. ... The machine was about a century ahead of its time.

Explanation:

Hope it is helpful...

What element of a timeline helps to mark progress of the project?
A.
milestones
B.job responsibilities
C.
external deliverables
D.
internal tasks

Answers

The correct answer is A. Milestone

Explanation:

In a timeline, events are organized according to time. This tool can be used as part of projects to organize each of the events or stages that are part of a project. Moreover, in a timeline, there are milestones or important achievements.

For example, if the project is to build a house, one of the milestones or important achievements is to complete the plane of the building. This implies each of the milestones helps to check the progress of the project. After all, if all the milestones are achieved the project will be completed.

Ask one of your parent, grandparent or elder relatives about the popular song during their time they consider their favorite. Ask them why they like the song. Afterwhich, listen to the song yourself, which wordings or lyrics in that song you find interesting and why?​

Answers

Answer:

Babooshka by Kate bush

Explanation:

My dad likes this song because it has a very nice beat

I find this sond interesting because the vocals and pitch end up sounding different than you would expect them to be. Also the range of the singer (Kate bush) is amazing

Use the drop-down menus to identify which vocabulary terms match the definitions. involves participating in activities that enhance self-awareness, developing skills, building employability, improving quality of life, and figuring out dreams and goals. Personal and professional are desirable or useful qualities that a person already possesses. A desired end result is a(n) .

Answers

Answer:

Personal growth, assets, goal

Explanation:

By providing drop-down menus, you may save consumers from scrolling and give them quick access to the information on your website. Drop-down menus on large websites can help users save time by letting them skip one or two levels to the information they're looking for.

What main role of drop-down menus?

A drop-down menu, often known as a pull-down menu or list, is a graphic control element made to make it easier for website users to locate particular pages or features. A top-level menu header that has been clicked or hovered over causes a list of choices to appear.

When a user moves their mouse over a menu item, sub-menus and menus are displayed. Users are used to this navigational pattern from other programs, so switching is simple.

Therefore, By nesting links, the web page design is more streamlined and has fewer links on the home page.

Learn more about drop-down menus here:

https://brainly.com/question/4379717

#SPJ5

describe what is involved in the first four stages of a research project

Answers

Answer:

Step 1: Identify the Problem. ...

Step 2: Review the Literature. ...

Step 3: Clarify the Problem. ...

Step 4: Clearly Define Terms and Concepts. ...

Step 5: Define the Population. ...

Step 6: Develop the Instrumentation Plan. ...

Step 7: Collect Data. ...

Step 8: Analyze the Data.

Write a java program to find the perimeter of a triangle with sides measuring 10cm, 14cm and 15 cm.

Answers

Answer:

The code is shown below.

Explanation:

Consider the provide information.

We need to find the perimeter of the triangle.

The perimeter of the triangle is the sum of all sides.

So the perimeter should be: 10 cm + 14 cm + 15 cm =  39 cm

Now we will write a Java program to find the perimeter.

public class MyClass {

   public static void main(String args[]) {

     int x=10;

     int y=14;

     int z=15;

     int A=x+y+z;

     System.out.println("The perimeter of the triangle is 10 cm + 14 cm + 15 cm = " + A+" cm");

   }

}

Execute the program and you will get a result like this:

The perimeter of the triangle is 10 cm + 14 cm + 15 cm = 39 cm

Refer to the image for better understanding.

Alpha Technologies, a newly established company, wants to share information about its work with people all over the world. Which type of server should this company use to upload their information?

Answers

This answer from the pro IdowShadow

Option A, Web Server, because it is a type of HTTP server used to direct web pages and blogs, as a method of transmitting information through a web platform for personal or business use, to publicize a business or an organization.

Explain the four misconceptions about entrepreneurship.

Answers

Answer:

that is the answer

Explanation:

ok its about succes you business

Computer instructions are converted to binary when executed. Binary numbers use which set of digits?

A, B, C, D, E, F

0 and 1

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F

0, 1, 2, 3, 4, 5, 6, 7, 8, 9

Answers

Answer:

Binary numbers are expressed using only the digits 1 and 0. This is also referred to as base 2 notation.

Computer instructions are converted to binary when executed. Binary numbers use 0 and 1 set of digits. The second option is correct.

What is binary number?

In digital electronics and mathematics, a binary number is defined as a number expressed in the form of base 2 numeral system.

Binary number contains only two digits i.e. 1 and 0.

Thus, 0 and 1 set of digits are used in binary numbers.

Learn more about binary number.

https://brainly.com/question/8649831

#SPJ2

To play the sound repeatedly, the - - - - - - - - is used

Answers

Answer:

autoplay button may be right answer

what do you mean by computer data​

Answers

Answer:

Computer data can be defined as figures, facts or other unprocessed information (raw information) that are stored in a computer database system.

Explanation:

Computer data can be defined as figures, facts or other unprocessed information that are stored in a computer database system.

Basically, computer data are usually in various formats such as texts, images, sounds, videos and are stored only as binary digits by the computer system for processing into useful informations.

Additionally, a database management system (DBMS) can be defined as a collection of software applications that typically enables computer users to create, store, modify, retrieve and manage data or informations in a database.

Answer:

A data can be best defined as a collection of raw facts and figures.

Do you think lossy compression formats will be popular in 20 years? Why or why not?

Answers

Answer:

I think it will be not popular

Explanation:

We are living in a information era and future data will be more important than now so we will need every detail of information and we will need data. Lossy compression is faster but computers are getting powerful so lossless compression will be faster so lossless compression will be popular.

five differences between email and website addresses​

Answers

Answer:

I don't know if there are that many

An email address is an address that you can send mail to online (e-mail)

A website address is an address that you can look around at and do stuff in.

An email address always has the 'at' symbol.

Website addresses and in .com, .org, .gov etc to show that it is a 'company', organization, government website etc.

Answer:

Email:

1. For communication between individuals.

2. Can be personalized.

3. Can be made by everyone easily.

URL/Website Address:

1. For organizations or mass media communications.

2. Not everyone knows how to make a website.

please HELP!!!!
Which term refers to the individual locations within a PowerPoint table?
O units
O sections
O cells
O formulas

Answers

Answer:

cells

Explanation:

Cell is a individual location in PowerPoint table.

Answer: c

Explanation:

Who plays Rblx?? What do yall play?

Answers

Answer:

i play rblx

Explanation:

queenloveadriana (main acc)

AdiosLoca (alt)

Azazel_Iblis (the acc I'll use for my YT channel)

I also play Fn, CofD, Destiny, 2k, Mortal Combat, but my PS4 broke and I'm waiting to get my PS5 that I ordered        

Answer:

i do

Explanation:

why is it important to consider the clients temperature before doing the foot spa services?​

Answers

Answer:

Expecially during these time checkling someone’s tempature could separate you from either getting the virus or not. But without the virus right now, it would be vital due to common things like, if the client has a little fever, you can make the water less hot so it wouldn’t be burning (unless requested). Or with a cold, you can make the water warmer to make it more enjoyable.

List 4 different version of Qbasic ​

Answers

Explanation:

some version of Qbasic are

Dartmouth BASIC.

Tiny BASIC.

Applesoft BASIC.

Atari BASIC.

Sinclair BASIC.

Commodore BASIC.

BBC BASIC.

TI-BASIC.

Supplies/material used in iron​

Answers

The raw materials used to produce pig iron in a blast furnace are iron ore, coke, sinter, and limestone. Iron ores are mainly iron oxides and include magnetite, hematite, limonite, and many other rocks. The iron content of these ores ranges from 70% down to 20% or less.

Which options should they choose during the evaluation
process? Check all that apply
a teacher's aide who creates world population
materials for a class
a professor who publishes world population research
in a journal
a United Nations report that analyzes trends in the
world's population
a nonprofit that tracks how the world's population
affects policy decisions
a local news program that evaluates Why some
countries are overpopulated

Answers

Answer:

B: a professor who publishes world population research

in a journal

C: United Nations report that analyzes trends in the

world's population

D: nonprofit that tracks how the world's population

affects policy decisions

Explanation:

Hope this helps :)

Out of the choices provided above, it can be concluded to state that the options to be chosen during the evaluation process of overpopulated countries, include,

a professor who publishes world population research in a journala United Nations report that analyzes trends in the world's populationa nonprofit that tracks how the world's population affects policy decisions

Therefore, the options B, C and D hold true.

What is the significance of an evaluation process?

An evaluation process can be referred to or considered as a process that relates to the detailed research or analysis related to a particular topic or subject that involves a common interest within the public.

The primary purpose of conducting an evaluation process is to ensure that the solution being taken into consideration is applicable and working effectively for the topic or subject, on which research is being conducted.

Therefore, the options B, C and D hold true and states regarding the significance of an evaluation process.

Learn more about an evaluation process here:

https://brainly.com/question/14084377

#SPJ2

The correctly formatted question has been added below for better reference.

A local news program that evaluates why some countries are overpopulated. Which options should they choose during the evaluation

process? Check all that apply

a teacher's aide who creates world population materials for a classa professor who publishes world population research in a journala United Nations report that analyzes trends in the world's populationa nonprofit that tracks how the world's population affects policy decisions

IM NOT GOING WITH THAT CAT

Answers

Answer:

If you say so.

Explanation:

For sure.

Mi laptop dice the computer restarted unexpectedly or encountered an unexpected error.Windows installation cannot procced.To install Windows,

Answers

Answer:

Explanation:

There are two reasons as to what could have happened with your laptop. The first one is that your laptop was installing a critical windows update which got corrupted when the laptop's battery died causing windows itself to become corrupted. In this case, you would need to format the hard drive and reinstall windows. The second reason could be that your hard drive is failing and not allowing Windows to load or properly be installed on it. In this second scenario you would need to buy and replace the hard drive.

press ctrl+u please tell me if you do

Answers

Answer:

wdym?

Explanation:

Other Questions
-) A sample of oxygen had an initial volume of 25.0L and was at a standard pressure of30atm, what would the new volume be if the pressure was increased to 55.00 atm? Alliance system definition Solve the following equations. Check your work. 1. 5m + 4 = 7m + 62. -5x + 3 = 2x - 1 9-7w=8w+8what is w?? Please help me asap 21. Solve and graph:7(h+3) > 6(h - 3) Some liquid will be poured from a 16 ounce container until it is filled to the percent of the the larger container (87.5%).How many ounces of liquid must be poured from to reach the full 16 ounce container? 6. How does Romeo persuade the apothecary to defy Mantua's law? Do all types of light change materials in the same way This is for ACC 556The Novak Company has just completed a physical inventory count at year end, December 31, 2022. Only the items on the shelves, in storage, and in the receiving area were counted and costed on the FIFO basis. The inventory amounted to $75,500. During the audit, the independent CPA discovered the following additional information:(a) There were goods in transit on December 31, 2022, from a supplier with terms FOB destination, costing $9,700. Because the goods had not arrived, they were excluded from the physical inventory count.(b) On December 27, 2022, a regular customer purchased goods for cash amounting to $950 and had them shipped to a bonded warehouse for temporary storage on December 28, 2022. The goods were shipped via common carrier with terms FOB shipping point. The customer picked the goods up from the warehouse on January 4, 2023. Novak Company had paid $475 for the goods and, because they were in storage, Novak included them in the physical inventory count.(c) Novak Company, on the date of the inventory, received notice from a supplier that goods ordered earlier, at a cost of $3,700, had been delivered to the transportation company on December 28, 2022; the terms were FOB shipping point. Because the shipment had not arrived on December 31, 2022, it was excluded from the physical inventory.(d) On December 31, 2022, there were goods in transit to customers, with terms FOB shipping point, amounting to $770 (expected delivery on January 8, 2023). Because the goods had been shipped, they were excluded from the physical inventory count.(e) On December 31, 2022, Novak Company shipped $3,000 worth of goods to a customer, FOB destination. The goods arrived on January 5, 2023. Because the goods were not on hand, they were not included in the physical inventory count.(f) Novak Company, as the consignee, had goods on consignment that cost $3,300. Because these goods were on hand as of December 31, 2022, they were included in the physical inventory count.Analyze the above information and calculate a corrected amount for the ending inventory.Corrected inventory $enter corrected inventory in dollars The present age of father is thrice as old as the age of daughter 5 years ago. If 5 years hence ,the age of father will be twice the age of his daughter. Find their present ages There is a bag with only red marbles and blue marbles the probability of randomly choosing a red marble is 7/12 there are 42 red marbles in the bag and each is equally likely to be chosen work out how many marbles there must be Solve the following for x The rectangular diagram shows the design for a food court at the zoo. What is the length of the walk way? how do I graph the proportional relationship of y=2.25 What is the best way to put out a small fire in the lab?A. Water hose B. 911C. Soda D. Fire extinguisher 2. Referring to Procedures Completed on the Eyeball (65091-65290):Match the following medical term with the corresponding definition3A. EviscerationB. EnucleationC. ExenterationThe removal of the eye, leaving the muscles and remaining orbital contents intact.The removal of the eyeball and the surrounding tissues, including the eyelids.The removal of the eye's contents, leaving the scleral shell and extraocularmuscles intact.3. Referring to Procedures Completed on they Eyeball (65091-65290): K-3/2=10 then k=??????? Helpppppppppppppppppppp meeeeeeee pls help with this math question using the slope formula, find the slope of the line through the given points (8,0) and (2,-4)