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
CLS
marusya05 [52]

Answer:

1 1

2

3

5

8

13

21

34

55

Explanation:

i guess this is the answer

8 0
3 years ago
Write a program that asks the user for three names, then prints the names in reverse order.
sasho [114]

Answer:

The program written in C++ is as follows'

#include<iostream>

using namespace std;

int main()

{

string names[3];

cout<<"Please enter three names: "<<endl;

for (int i = 0; i< 3;i++)

{

cin>>names[i];

}

for (int i = 2; i>= 0;i--)

{

cout<<names[i]<<endl;

}

return 0;

}

Explanation:

This line declares an array for 3 elements

string names[3];

This line prompts user for three names

cout<<"Please enter three names: "<<endl;

This following iteration lets user input the three names

for (int i = 0; i< 3;i++)  {  cin>>names[i];  }

The following iteration prints the three names in reverse order

for (int i = 2; i>= 0;i--)  {  cout<<names[i]<<endl;  }

8 0
3 years ago
Which is an unbound form with menu options for navigating a database?
melisa1 [442]
The answer B. a switchboard
6 0
3 years ago
Read 2 more answers
ROE: what does this represent (in plain terms)? In what range would this number typically be? What type of person/position would
LuckyWell [14K]

Answer:

<em>The ROE in plain terms is called  the return on equity (ROE) is a measure of inflow of profit in business in relation to the equity, also known as assets net worth  or assets of liabilities  ROE is a method  of how l  company generate earnings through investment </em>

Explanation:

<em>The ROE in plain terms is called  the return on equity (ROE) is a measure of inflow of profit in business in relation to the equity, also known as assets net worth  or assets of liabilities  ROE is a method  of how l  company generate earnings through investment </em>

<em>The ROE range number can be of any value or percentage example 15% upwards</em>

<em>The type of person or position with roles to play are usually a professional, such as an accountant, bookkeeper, or payroll processor, who completes ROEs on behalf of your clients in the organisation.</em>

4 0
3 years ago
Select the correct answer from each drop-down menu. What is a distribution list and how is it selected?
Soloha48 [4]
Blank 1 is email, and blank 2 is contacts list
6 0
2 years ago
Other questions:
  • A(n ____________ is considered a named collection of bytes having persistent or lasting storage.
    10·1 answer
  • a supermarket having a sale on canned foods' the sale includes 12 cans of soup for 10.65 what is the unit price per can of soup
    6·2 answers
  • Java languageThe cost to ship a package is a flat fee of 75 cents plus 25 cents per pound.1. Declare a constant named CENTS_PER_
    5·2 answers
  • Hulu suggestions? I just got it and I wanna know what's good :)
    5·2 answers
  • The blank provides access to the internet May also be internal ??
    14·1 answer
  • Write a line of code to convert time to hours. Remember there are 60 minutes in an hour. Then write a line of code to calculate
    9·2 answers
  • Project: Math Tutor Program with Error Handling
    9·2 answers
  • Write a qbasic program to display integer numbers 1 to 100 using the for next loop<br>​
    9·1 answer
  • The best way to take control of the first page of Google is to
    14·1 answer
  • Monster Collector
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!