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
SOVA2 [1]
4 years ago
9

Create a class called MyBoxes with: - 1 instance variable, and array to hold Box objects - a constructor with 1 parameter - the

size of the array -- the constructor will create the array and set it to the size of the parameter - a method called emptyspace with no parameters -- the method returns how many elements of the array are null - a method called add with 3 parameters --- the method takes length, width and height as paremeters --- the method creates a Box object and adds it to the array if there is space left - a method called print with no parameters --- the method loops through the array and prints each element that is not null
Computers and Technology
1 answer:
Veseljchak [2.6K]4 years ago
4 0

Answer:

C++

Explanation:

class MyBoxes {

   private:

       // Pointer to Box object and array size. Required for dynamically creating an array.

       Box* boxes;

       int array_size;

       // Constructor

       MyBoxes(int array_size) {

           self.array_size = array_size;

           boxes = new Box[array_size] ;

       }

   public:

       // Methods

       int emptyspace() {

           int count = 0;

           for (int i=0; i < self.array_size; i++) {

               // Check for null

               if (!boxes[i])

                   count++;

           }

           return count;

       }

       void add(int length, int width, int height) {

           Box box1(length, width, height);

           if (self.emptyspace() == 0)  {

               self.addToArray(box1);

           }

       }

       void print() {

           Box *temporaryBox;

           for (int i=0; i < self.array_size; i++) {

               temporaryBox = boxes[i];

               if (temporaryBox) {

                   cout<<temporaryBox->length<<endl;

                   cout<<temporaryBox->width<<endl;

                   cout<<temporaryBox->height<<endl;

               }

           }

           // Free memory

           delete temporaryBox;  

       }

You might be interested in
Sidney works in the accounting department. His boss just assigned him a task that involves creating budget formulas for the comp
Molodets [167]
The answer is a A. - Excel performs operations based on the order of Precedence
4 0
3 years ago
CPT (Current Procedural Terminology) codes consist of 3-4 numbers representing a unique service. True False
xz_007 [3.2K]
This is in fact false to my knowledge
4 0
3 years ago
The information computers give to users or other computers are called
AfilCa [17]

Answer:

the output processed data

7 0
2 years ago
Which expresses 6y : 9y in its simplest form?
Gwar [14]
<span>This problem is an example of ratio and proportion. You are given 6y:9y. You are required to convert this into its simplest form. The 6y:9y is also equivalent to 6y/9y. The ‘y’ variable can be eliminated since it has the same exponent and base. You are left with 6/9. The common factor for 6 and 9 is 3 so divide each number by 3. So 6/3 is 2 and 9/3 is 3. You get 2/3. This is its simplest form.</span>
6 0
3 years ago
A security risk to email is​ __________, which are fraudulent messages that prompt unwary users to reveal sensitive information
d1i1m1o1n [39]

Answer:

Option C is the correct answer for the above question.

Explanation:

Pishing is a type of attack which is used by the attacker to access the secured information from the system. It is used by the third person assuming for the system that he is the right use of the system and can access the information of the system.

The above question asked about the attack which can access the information to assume that he is the right user and give accessed to the network to been hacked. So the answer is phishing which is described above. Hence option C is the correct while the other is not because:-

  • Option A states about direct mail which is not a type of attack.
  • Option B states about instant messaging which is also not a type of attack.
  • Option D states about spam which is used to send the spam messages.
  • Option 'E' states about the mass mail which is used to send the lots of spam mail.
5 0
3 years ago
Other questions:
  • The speed of a cpu is expressed in cycles called ________.
    14·1 answer
  • Use-Cases are scenarios that describe
    9·1 answer
  • Given two variables , first_place_winner and second_place_winner, write some code that swaps their associated values. use any ad
    12·1 answer
  • You want a class to have access to members ofanother class in the same package. Which is themost restrictive access that accompl
    11·1 answer
  • A student is curious about how a Web site appears on his computer screen. On a piece of paper,
    8·1 answer
  • Information is data converted into useful, meaningful context. What are data characteristics that change or vary over time?
    8·1 answer
  • Can someone help me with these questions it's for drivers ed
    10·1 answer
  • When attaching a file or files in outlook 365 you select the attach command and then select the files location
    5·1 answer
  • The border to the right of a column is called the ____.
    12·1 answer
  • 4.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!