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
Marina86 [1]
3 years ago
11

A base class named Garden contains a private field width and a property public int Width that contains get and set accessors. A

child class named VegetableGarden 359360does not contain aWidth property. When you write a class in which you declare an object as follows, what statement can you use to access the VegetableGarden's width?VegetableGarden myGarden = new VegetableGarden();
a. myGarden.Width

b. myGarden.base.Width

c. VegetableGarden.Width

d. You cannot use Width with a VegetableGarden object.
Computers and Technology
1 answer:
goblinko [34]3 years ago
4 0

Answer:

a. myGarden.Width

Explanation:

Given: A base class named Garden contains a private field width and a property public int Width that contains get and set accessors. A child class named VegetableGarden does not contain a Width property. So the structure is as follows:

class Garden{

      private int width;

      public int Width;

}

class VegetableGarden extends Garden{

}

In the client class, we create an instance of VegetableGarden as follows:

VegetableGarden myGarden = new VegetableGarden();

From this instance the Width field can be accessed using the following mechanism:

myGarden.Width

You might be interested in
20.
Kazeer [188]

Answer:

Megabyte

Explanation:

Megabytes come before Gigabytes like how Gigabytes come before Terrabytes

8 0
3 years ago
. Write a function definition as follows: it returns the C++ form of a Boolean value, its function identifier is anyTwoTheSame,
Paraphin [41]

Answer:

The c++ code to implement the Boolean function is given. The function definition is shown.

bool anyTwoTheSame(float a, float b, float c)

{

   bool same = false;    

   if(a == b)

       same = true;

   else if(a == c)

       same = true;

   else if(b == c)

       same = true;        

   return same;

}

Explanation:

This function accepts three floating point numbers and returns true if any two numbers are equal else returns false.

The program below shows the implementation of this method.

#include <iostream>

using namespace std;

bool anyTwoTheSame(float a, float b, float c);

bool anyTwoTheSame(float a, float b, float c)

{

   bool same = false;    

   if(a == b)

       same = true;

   else if(a == c)

       same = true;

   else if(b == c)

       same = true;        

   return same;

}

int main() {    

   float one=12.34, two=56.78, three=90.1;    

   cout<<"Two numbers are same : " <<anyTwoTheSame(one, two, three);

}

OUTPUT

Two numbers are same : 0

The method is first declared.

bool anyTwoTheSame(float a, float b, float c);

Next step is method definition which shows what the function is supposed to do. The test to check equality of two numbers is implemented as shown.

bool same = false;    

if(a == b)

       same = true;

   else if(a == c)

       same = true;

   else if(b == c)

       same = true;  

This is the simplest test which can be programmed.

If the numbers are not same, the Boolean variable, same, remains initialized to false.

This function is then called in main method.

No user input is taken as this is not specified in the question.

The three floating variables are declared and initialized inside the main. The values are put inside the program and not taken from the user.

The output shows either 0 or 1. 0 represents false and 1 represents true.

This program can be tested for different values of floating variables.

3 0
3 years ago
4. Refer to the following code the answer the remaining questions. loop: load r1, r5, 40 ; r1  data_memory[r5 + 40] add r1, r1,
Anni [7]

Answer:

See explaination

Explanation:

Loop Unrolling

Assembly code

loop:

load r1, r5, 40 //r1 = Mem[r5 + 40]

load r6, r5, 36 //r6 = Mem[r5 + 36]

add r7, r6, r2 //r7 = r6 + r2

store r7, r5, 36 //Mem[r5 + 36] = r7

add r1, r1,r2 //r1 = r1 + r2

store r1, r5, 40 //Mem[r5 + 40] = r1

addi r5, r5, -8 //r5 = r5 -8

bne r5, 0, loop //if(r5 != 0)branch to loop

4 0
4 years ago
Data validation is the process of a. preventing errors due to invalid data b. preventing errors due to incorrect Transact-SQL sy
professor190 [17]

Answer:

The correct answer to the following question will be "Option A".

Explanation:

Data validation seems to be an important part of every data managing mission unless you are in that area of information or data collection, data processing or planning to deliver the information to stakeholders.

  • Validation could be viewed as something of an integral component of your process instead of as a further move.
  • If your data set isn't correct from the beginning, then your outcomes will undoubtedly not be correct either. That's why the data needs to be checked or tested until it becomes used.

The other three options are not related to the given topic. So Option A is the right answer.

6 0
4 years ago
Research and describe surround sound. What are the different types of surround sound? How is it used? How might surround sound a
Reptile [31]

Surround sound was first application was in movie theaters. Prior to surround sound, theater sound systems commonly had three "screen channels" of sound, from loudspeakers located in front of the audience at the left, center, and right. Surround sound adds one or more channels from loudspeakers behind the listener, able to create the sensation of sound coming from any horizontal direction 360° around the listener. Surround sound formats vary in reproduction and recording methods along with the number and positioning of additional channels.  Multichannel audio techniques may be used to reproduce contents as varied as music, speech, natural or synthetic sounds for cinema, television, broadcasting, or computers.

5 0
3 years ago
Other questions:
  • A network engineer arrives at work and discovers that many users are having problems when attempting to connect to the company n
    9·2 answers
  • "ikev2 requires the use of which of authentication protocol?"
    5·1 answer
  • which of the following uses technical and artistic skills to create visual products that communicate information to an audience?
    14·1 answer
  • Kara has been asked to create an employment application form for her company. Which of the following items can she use to make s
    10·1 answer
  • Describe how spacecraft evolved from the US Mercury to contemporary space shuttles.
    10·1 answer
  • Write a public static method named evens that takes in 1 argument int a, and returns a String containing all positive even numbe
    8·1 answer
  • Jnhj hjibfnufnbfjbnkfv fj v
    11·1 answer
  • Can people survive without technology?
    5·1 answer
  • One of the difficult things about working in game design is that while there are many different roles, most of them only match o
    15·1 answer
  • 16. (PPT) You can use features on the Video Tools Playback tab to adjust how and when the video plays during the slide
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!