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
Kruka [31]
3 years ago
13

Consider the following class declaration: public class Square { private double sideLength; public double getArea() { return side

Length * sideLength; } public double getSideLength() { return sideLength; } } Assuming that a no-arg constructor already exists, write an overloaded constructor for this class. It should accept an argument that is copied into the sideLength field. The parameter’s name is s.
Computers and Technology
1 answer:
kipiarov [429]3 years ago
4 0

Answer:

Here is the constructor:

public Square(double s) {  //constructor name is same as class name

sideLength = s;  } //s copied into sideLength field

Explanation:

The above constructor is a parameterized constructor which takes a double type variable s as argument. The name of constructor is same as the name of class.This constructor requires one parameters. This means that all declarations of Square objects must pass one argument to the Square() constructor as constructor Square() is called based on the number and types of the arguments passed and the argument passed should be one and of type double.

Here is where the constructor fits:

public class Square {

private double sideLength;

public Square(double s) {  

sideLength = s;  }

public double getArea() {

return sideLength * sideLength;}

public double getSideLength() {

return sideLength; } }

You might be interested in
As a compositional mode for electronic? media, __________ help people find their way through an unfamiliar system or? subject; t
maks197457 [2]
The answer that fills in the blank is orientation. It is because orientation does not provide all the details of what they are doing but a guideline of what they must do, in order for them to be guided on the things that they need to learn as they start. They require proper guidance which is the orientation before performing before hand. Especially when they are not familiar on what they need to do.
3 0
3 years ago
Mary uploaded some images on her website. She chose an image and downloaded it. She found that the image she saw on screen did n
zalisa [80]

Answer:

A.

Some image resolution was lost while uploading it

As she uploaded them on her website not downloading as choice B&D show while E is false and C is rarely occur

7 0
3 years ago
Line 9 and 10
Reika [66]

Answer:

22,332

Explanation:

The taxable income :

Line 8 = Standard deduction or itemized deduction

Line 9 = Qualified business income deduction

Line 7 = Adjusted gross income

Taxable income = Adjusted gross income - (Qualified business income deduction + standard deduction)

Taxable income = 34732 - (12400 + 0)

Taxable income = 34732 - 12400

Taxable income = 22,332

4 0
2 years ago
Suppose that TCP's current estimated values for the round trip time (estimatedRTT) and deviation in the RTT (DevRTT) are 400 mse
Masja [62]

Answer:

617.5 msecs, 580.89 msecs, 582.36 msecs

Explanation:

Lets look at the following formulas:

EstimatedRTT = α * SampleRTT+(1- α) * EstimatedRTT

DevRTT = β * | SampleRTT- EstimatedRTT|+(1- β)* DevRTT

TimeoutInterval = EstimatedRTT +4* DevRTT

Given values are:

EstimatedRTT = 400 msec

DevRTT = 25 msec

α = 0.125

β = 0.25

After the first RTT estimate: (210)

EstimatedRTT = 0.125 * 210 + (1 - 0.125) * 400 = 376.25 msecs

DevRTT = 0.25 * |210 - 376.25| + (1 - 0.25) * 25 = 60.3125 msecs

TimeoutInterval = 376.25 + 4 * 60.3125 = 617.5 msecs

After the second RTT estimate: (400)

EstimatedRTT = 0.125 * 400 + (1 - 0.125) * 376.25 = 379.218 msecs

DevRTT = 0.25 * |400 - 379.218| + (1 - 0.25) * 60.3125 = 50.42 msecs

TimeoutInterval = 379.218 + 4 * 50.42 = 580.89 msecs

After the third RTT estimate: (310)

EstimatedRTT = 0.125 * 310 + (1 - 0.125) * 379.218 = 370.56 msecs

DevRTT = 0.25 * |310 - 370.56| + (1 - 0.25) * 50.42 = 52.95 msecs

TimeoutInterval = 370.56 + 4 * 52.95 = 582.36 msecs

5 0
3 years ago
Which of these are reasons to test code? Check all of the boxes that apply. Most code contains some errors. Beta users expect er
Lady_Fox [76]

Answer:

Most code contains some errors and Users expect software programs to function properly

Explanation:

Beta users will be the ones to find errors before the project is completed, they do not expect it to be perfect, and software developers will not expect a perfect first test.

6 0
3 years ago
Read 2 more answers
Other questions:
  • HELP PLEASE
    5·1 answer
  • When changing the formatting of a spreadsheet to make it more readable, you should use light blue text on a bright blue backgrou
    12·1 answer
  • Two-factor authentication can best be breached by the adversary using:________. a. social engineering attack b. using sniffers l
    10·1 answer
  • Cheri needs to write a small program that interacts with the user. What step will allow her to do this?
    14·2 answers
  • One of the disadvantages of Photoshop Express is that it does not have a Black and White effect. True False
    13·1 answer
  • Irene wants to connect your smart phone wirelessly to her laptop in order to transfer images. which two images could she reasona
    15·1 answer
  • What is Roko's Basilisk?
    7·1 answer
  • 2. Explain the difference between a JMP instruction and CALL instruction
    6·1 answer
  • Match the vocabulary to the appropriate definition.
    13·1 answer
  • You are the IT security administrator for a small corporate network. The HR director is concerned that an employee is doing some
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!