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
what are Include the data on usage you gather from your interactions with friends or by listening to people on the radio or on T
borishaifa [10]

Answer:

This has happened many times. I am quite close to my friends. I once asked for making a wood baked Pizza at one of my friends’ houses. Unfortunately. He didn’t have the setup. I was feeling bad as well. However, to add to my relief, he didn’t say he will not make. He also didn’t say he didn’t have the oven. And those double negatives made me happy as I didn’t wanted my friend to take this pain as he had to give an exam after 2 days. However, he even didn’t said he will not order for it. And that double negative confirmed for us a pack of two wood baked pizzas with fountain Pepsi, an hour later. And I was very happy as my friend was able to fulfill the promise.

On TV as well, I have heard a lot of double negatives during NBA matches, and especially on the radio. However, I must say double negatives sometimes happen as certain people are very sensitive, they do not ever want to say no.

Explanation:

Please check the answer.

7 0
3 years ago
What term best describes the way the dns name space is organized?
Andreyy89
The answer would be hierarchical
 <span />
6 0
3 years ago
Write a function that is named times_ten and accepts a number as an argument. When the function is called, it should return the
Stells [14]

It changes a little depending on what programming language you're using, but in C you could say

int times_ten (int num) {

    num = num*10;

    return num;

}

Or, in general terms:

Integer Function times_ten (Integer num)

    Set num = num * 10

    Return num

This is all done assuming the number used as an argument is an integer and that you are returning an integer value, not a decimal. The main thing to notice is that since you have to return a value, you must have two things: a return statement, and a type declaration for the function, otherwise you'll get an error.

4 0
3 years ago
Most of the Desktop games contain a backdoor used to test and update the game.
sveta [45]

A backdoor is a typically covert method of bypassing normal authentication or encryption in a computer, product, embedded device (e.g. a home router), or its embodiment (e.g. part of a cryptosystem, algorithm, chipset, or even a "homunculus computer" —a tiny computer-within-a-computer such as that found in Intel's AMT technology).Backdoors are most often used for securing remote access to a computer, or obtaining access to plaintext in cryptographic systems. From there it may be used to gain access to privileged information like passwords, corrupt or delete data on hard drives, or transfer information within autoschediastic networks.

the answer is True

i hope it will help you

8 0
3 years ago
Write an expression that executes the loop body as long as the user enters a non-negative number.Note: If the submitted code has
Eva8 [605]

Answer:

See attached picture.

Explanation:

See attached picture for explanation.

5 0
3 years ago
Other questions:
  • Create a script that asks for the visitor's weight in pounds and his/her height in inches. The program should then calculate the
    13·1 answer
  • What font is the declaration of independence?
    9·1 answer
  • Consider the clipping of a line segment in two dimensions against a rectangular clipping window. Show that you require only the
    10·1 answer
  • Sheila is using a process of saving files to her desktop and then renaming them. She is
    13·2 answers
  • The Classic Triangle Testing Problem, (Myer's Triangle): A program reads three integer values. The three values are interpreted
    10·1 answer
  • Should there be an agency in charge of the Internet? How would business, government, and education be impacted if the Internet w
    15·1 answer
  • Assume a computer uses pipelining of 9 stages. Each stage demands 3 clock cycles to finish its task. How many clock cycles are n
    9·1 answer
  • 14.
    6·1 answer
  • True or False? Any edition or version of Windows can join a domain.
    14·1 answer
  • 1-List some applications appropriate for each of the display technologies: raster refresh systems,plasma panels, and LCDs.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!