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
vivado [14]
3 years ago
12

Consider the following implementation of a class Square:

Computers and Technology
1 answer:
DaniilM [7]3 years ago
4 0

Answer:

The answer to this question can be given as:

Code:

class Square   //define class Square

{

Private int sideLength;  //define variable  

Square(int length)   //define parameterized constructor.        

{

sideLength = length;        //hold value of the parameter

}

int getArea()                  //define function getArea.

{

Private int area;            //define variable.

area = sideLength * sideLength;          //calculate area.

return area;            //return value.

}

}

Explanation:

In this question it is not a good idea to introduce an instance variable for the area because It may be a different method that defines the same variable with the same name but different variables because they are related to different functions, so it is better to make this variable local in this case.

You might be interested in
A network router connects multiple computers together and allows them to send messages to each other. If two or more computers s
Sedbober [7]

Answer:

C = M0(M1+M2+M3)+M1(M2+M3)+M2M3 is the equation which suits

Explanation:

From the given data we can state that we need to activate only one product i.e 1------>activated 0-------->means inactivated and also only one slot is activated at a time.The resultant will be no data inputs n control bits and 2 to the power n output bits.

8 0
3 years ago
Mr. Yang is a doctor who regards video games as an effective means of staying fit. What type of game would he recommend to his p
LUCKY_DIMON [66]

wii sports, just dance, etc.

Explanation:

3 0
2 years ago
TVBCA has just occupied an old historic building in downtown Pittsburgh in which 15 employees will work.
7nadin3 [17]

Answer:

A. The proposed solution delivers the required result and both optional desired results.

Explanation:

The IEEE 802.11a is the standard code of the wireless communication technology known as WIFI, it is wireless as it requires no cable to connect to a network device. The data transmission rate of the IEEE 802.11a is 1.5 - 54Mbps (mega bit per second). So, the employees in the TVBCA building can wireless connect to the network, which allows them to be mobile and they can also send large CAD files among themselves.

6 0
3 years ago
12. Write C statement(s) that accomplish the following. a. Declare int variables x and y. Initialize x to 25 and y to 18. b. Dec
saul85 [17]

Answer:

a.

int x = 25;

int y = 18;

b.

int temp = 10;

char ch ='a';

c.

x += 5;

d.

double payRate = 12.5;

e.

int tempNum = firstNum;

f.

int tempp = x;

x = y;

y = tempp;

g.

printf("Value of x = %f\n",x);

printf("Value of y = %f\n",y);

printf("Arithmetic = %f\n",(x + 12/y -18));

h.

char grade = 'A';

i.

int a,b,c,d;

a = 5; b = 2; c = 3; d = 6;

j.

int x = round(z);

Explanation:

The answers are straight forward.

However, I'll give a general hint in answering questions like this.

In C, variable declaration is done by:

data-type variable-name;

To declare and initialise the variable, you do;

data-type variable-name = value;

So, for questions that requires that we declare and initialise a variable, we make use of the above syntax..

Take (a) for instance:

int x = 25;

int y = 18;

Same syntax can be applied to (b), (d), (e), (h) & (I)

For question (c);

This can be done in two ways;

x = x + 5;

Or

x+=5;

Both will give the same result.

For question (f):

We start by initialise a temporary variable that stores x.

Then we store the value of x in y.

Then we store the content of the temporary variable to y.

This swaps the values of x and y

For question (g):

When printing a double variable in C, we make use of '\f' as a string format

For question (j):

The round function is used to round up a double variable to integer.

3 0
3 years ago
A media company that has separate, autonomous companies for movies, tv, internet, and print journalism is most likely a ________
Llana [10]
The answer that completes the blank provided above is the term DIVISIONAL. It is most likely that a divisional structure is being utilized when a media company comprises of a separate and autonomous companies for print journalism, tv, movies and the internet.
6 0
3 years ago
Other questions:
  • • What is the difference between primary storage, secondary storage, and off-line storage
    10·1 answer
  • Why must an rodc be able to connect to at least one windows server 2008 or higher domain controller?
    5·1 answer
  • Assume that a picture is represented on a monitor screen by a rectangular array containing 2048 columns and 1536 rows of pixels.
    12·1 answer
  • A Raycast returns a float that tells you how far away an Object is
    8·1 answer
  • The show ip dhcp binding command displays _____. (Points : 5) the MAC table cache information
    7·1 answer
  • If a speaker repeats a point, it is likely _____.
    7·2 answers
  • Which of the following is an easy steps to take to avoid ESSD well working on your computer?
    5·1 answer
  • I really need help in this!!!
    11·1 answer
  • Lab 8-1: Working with Boot Loader and Runlevels what is the root password
    9·1 answer
  • for a given array of integers perform operations on the array return the resulting array after all operations have been applied
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!