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
Scott sends his backups to a company that keeps them in a secure vault. What type of backup solution has he implemented?
Tems11 [23]

Scott has implemented an offline backup scheme.

<h3>What is an offline backup scheme?</h3>
  • A cold backup even called an offline backup, is a database bottleneck during which the database is offline and not available to update.
  • This is the securest way to support up because it bypasses the risk of copying data that may be in the method of being edited.
  • An online backup places your files onto the Light Backup data wait people.
  • It is named an online backup because it utilizes the Internet to transfer your files.
  • The offline backup is a cold backup. A cold backup is a blockage completed while the database is off-line and inaccessible to its users

To learn more about  offline backup scheme, refer to:

brainly.com/question/2396187

#SPJ4

3 0
1 year ago
This program will convert a set of temperatures from Fahrenheit to Celsius and Kelvin. Your program will be reading in three dou
Naily [24]

Answer:

see explaination

Explanation:

#include<iostream>

#include<iomanip>

using namespace std;

int main()

{

double temp1,temp2,inc,cel;

int i=1;

while(i==1)

{

i=0;

cin>>temp1>>temp2>>inc;

if(temp2<temp1||inc<=0)

{

i=1;

cout<<"Starting temperature must be <= ending temperature and increment must be >0.0\n";

}

}

cout<<endl;

cout<<setw(15)<<"Fahrenheit"<<setw(15)<<"Celsius";

while(temp1<=temp2)

{

cel=(temp1-32)/1.8;

cout<<endl;

cout<<fixed<<setprecision(3)<<setw(15)<<temp1<<setw(15)<<cel;

temp1+=inc;

}

}

Please kindly check attachment for output.

8 0
3 years ago
the ratio of length, breadth and height of a room is 4:3:1. If 12m^3 air is contained in a room, find the length , breadth and h
Bumek [7]

Explanation:

The ratio of length, breadth and height of a room is 4:3:1

Let length = 4x

Breadth = 3x

Height = x

Volume of air contained in the room, V = 12 m³

We need to find the length, breadth and height of the room. The room is in the shape of a cubiod. The volume of a cuboid is given by :

V = lbh

4x\times 3x\times x=12\\\\12x^3=12\\\\x=1

Height of the room = 1 m

Breadth of the room = 3x = 3 m

Length of the room = 4x = 4 m

7 0
3 years ago
which of the following sentences uses active voice?(answers to choose from are in the photo)-this is in my computer applications
andrezito [222]
Last week, Nate and I counted all the inventory. answer :A
6 0
3 years ago
Read 2 more answers
What device is used to transmit what is effectively a type of Morse code between stations?
IrinaVladis [17]
<h3>Its B 100% sure.....</h3>

Brainiest Please :)

6 0
3 years ago
Other questions:
  • Our company is only interested in purchasing a software upgrade if it leads to faster connectivity and data sharing. The old sof
    7·1 answer
  • Reinstalling a software package to fix a problem with an inoperative program is an example of which troubleshooting strategy?
    9·1 answer
  • Which one of these tasks best describes the process of localization?
    12·1 answer
  • Complete the statement below with the correct term.
    5·1 answer
  • Match the file extensions to the file types. Some file types may be used more than once.
    11·1 answer
  • Explain the difference between good and bad table structures. How do you recognize the difference between good and bad structure
    14·1 answer
  • Which of the following would not be considered a polymer?
    14·2 answers
  • How do cyber criminals target user’s end devices?
    11·2 answers
  • What has global css rulesets of an angular 8 project mcq.
    8·1 answer
  • after adding a sound to a slide, the audio tools tab will allow you to apply artistic effects and quick styles to your sound ico
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!