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
Helen [10]
3 years ago
12

I am confused in Java!

Computers and Technology
1 answer:
GarryVolchara [31]3 years ago
3 0
Import java.util.Random;

class Building
{
    private int w, h;
    private int numberOfWins;

    public Building(int width, int height)
    {
        w = width;
        h = height;

        // generating random windows. can be between 1 and 10
        Random rand = new Random();
        numberOfWins = rand.nextInt(9) + 1;
    }

    public int getWidth() { return w; }
    public int getHeight() { return h; }
    public int numberOfWindows() { return numberOfWins; }

    public String toString()
    {
         return "a black building, width: " + width + ", height: " + height +
                    ", has " + numberOfWins + " windows"; 
    }
}

----------------------------------------------------

then you can create some Building objects and output them!
You might be interested in
An ironworker standing 30 feet in the air is safe wearing a full body harness that is not tied off
Nataly_w [17]

Answer

It is FALSE .

Explanation

A full body harness is a  type of safety 'attire' specifically put on for the purposes of protection. Safety harness are necessarily for fall protection. It also provides the user or the worker comfortability and confidence while working on those high risky places. It is advisable that when a worker is exposed to a fall hazard which about six feet and above high to wear a harness that is tied off.

8 0
3 years ago
Read 2 more answers
What is a benefit of starting a new business from scratch?
skad [1K]

Answer:

You can do what you want

Explanation:

The sky is the limit

3 0
3 years ago
You do not need to use any functions beyond the main function in this problem. Initialize an array of int with the values: 4, 6,
zheka24 [161]

Answer:

import java.util.Scanner;

public class Main

{

public static void main(String[] args) {

   

    int[] arr = {4, 6, 9, 12};

    int sum = 0;

   

    for(int i=0; i<arr.length; i++){

        sum += arr[i];

    }

   

    for(int i=0; i<arr.length; i++){

        System.out.print(arr[i] + " ");

    }

    System.out.println("");

 System.out.println("The sum of the numbers: " + sum);

}

}

Explanation:

* The code is written in Java.

- Initialize the array with the given numbers

- Initialize the <em>sum</em> variable as zero

- Calculate the sum in the first for loop

- Print the numbers in the second for loop

- Print the <em>sum</em>

4 0
3 years ago
The _____ is a computer-based test that measures the degree to which you associate particular groups of people with specific cha
scoray [572]

Answer:Implicit Association Test (IAT)

Explanation:Implicit Association Test is the sort of test that is made for the analyzing the thoughts and beliefs of group of people . It is basically performed because of displaying the unknown facts or attitude which people don't want to display or don't want to report.

Implicit Association Test (IAT) is the test that helps in bringing out the hidden and unreported situations or facts about the people.

3 0
3 years ago
HELP! Identify the parts of the table. <br>A) Primary Key<br>B) Field<br>C) Record<br>D) Table<br>​
joja [24]

The primary key is the block under the Movie ID column.

The Field is the Movie Name.

The Record is the block that goes with the first row of data.

The Table is the bottom block in the center.

4 0
3 years ago
Read 2 more answers
Other questions:
  • When creating a software package, the software must be designed, the code must be written, and then the code must be tested. Thi
    6·1 answer
  • What are multiple worksheets
    7·1 answer
  • Don't pat any attention to this
    7·2 answers
  • In project integration management, project ______ and _______ are intertwined and inseparable activities
    14·1 answer
  • 8. A pattern of being late for work or for appointments is usually
    12·1 answer
  • How is the EF​ computed? A. ES​ + Activity time B. LF minusActivity time C. ​Min{LS of all immediate following​ activities} D. ​
    11·1 answer
  • Which software application offers a variety of templates for creating reports, flyers, and newsletters that you can access withi
    7·1 answer
  • In an information systems framework, ________ is the bridge between the computer side on the left and the human side on the righ
    14·1 answer
  • If a filesystem has a block size of 4096 bytes, this means that a file comprised of only one byte will still use 4096 bytes of s
    12·1 answer
  • Brenda has created a Microsoft Excel spreadsheet which has 1000's of cells of data. She is looking for specific information in t
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!