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
Bess [88]
3 years ago
13

Write a class called SimpleSquare that has the following properties: - public int field called num - private int field called sq

uare - a constructor that takes a single parameter that sets the num, then sets square to num to the second power
Computers and Technology
1 answer:
mezya [45]3 years ago
6 0

Answer:

public class SimpleSquare{

   public int num;

   private int square;

   

   public SimpleSquare(int number){

       num = number;

       square = number * number;

   }

   

   public int getSquare(){

       return square;

   }    

}

Explanation:

*The code is in Java.

Create a class called SimpleSquare

Declare two fields, num and square

Create a constructor that takes an integer number as a parameter, sets the num and sets the square as number * number.

Since the square is a private field, I also added the getSquare() method which returns the value of the square.

You might be interested in
Why does it still say I am ambitious whenever I have the 5 brainliest and almost 700 points?
Galina-37 [17]
Check below your score it should say something out of 5 you need to get more to get 5/5
8 0
3 years ago
Read 2 more answers
Por favor alguem poderia me falar qual PC e melhor: Computador Gamer Fox PC FPS Intel Core i5 8GB (GeForce GTX 1050Ti 4GB GDDR5)
Ivanshal [37]

Eu acredito no primeiro como ele tem uma GTX 1050ti, i5 e 2tb.

3 0
3 years ago
The factorial of an integer N is the product of the integers between 1 and N, inclusive. Write a while loop that computes the fa
alexdok [17]

the function and loop will be

def factorial(x):

   total = 1

   if x != 1 and x != 0:

       for i in range(x,1,-1):

           total *= i

   return total

3 0
4 years ago
Select the correct answer.
Svetradugi [14.3K]

Answer:

C. Universal

Explanation:

7 0
3 years ago
A(n) ______ system is a set of programs that coordinates all the activities among computer or mobile device hardware. a. managem
madreJ [45]

Answer:

Option c is the correct answer for the above answer.

Explanation:

The operating system behaves like the soul of the system. It is because it is used to operate the system. It is also used to operate all the activities of the system. It is also used to manage the resource and can be available on the computer as well as mobile. This is the first software which needs to install on a mobile or computer because without this no software can work on the mobile or computer.

The above question asks about the software which is used to operate the computer as well as mobile. That software is known as the Operating system. So the answer is Option c while the other is not because:-

  • Option 'a' states about the management which is not software.
  • Option b states about the Network which is also not a software.
  • Option d states about the application which is not used to operate the software of the system.
5 0
3 years ago
Other questions:
  • What must you do first in order to change the font type size and colour of a particular text
    13·2 answers
  • Write qbasic code for given pattern<br><br>NEPAL<br>. EPA<br>. P​
    12·1 answer
  • Using the C language, write a function that accepts two parameters: a string of characters and a single character. The function
    11·1 answer
  • Which clauses in the Software Engineering Code of Ethics are upheld by a whistleblower (check all that apply). "Respect confiden
    15·1 answer
  • A(n) _____ is someone who uncovers computer weaknesses and reveals them to manufacturers or system owners, without exploiting th
    15·1 answer
  • The web server administrator at your e-commerce company is concerned about someone using netcat to connect to the company web se
    11·1 answer
  • VOTE: STARWARS, STAR TREK, MARVEL, STRANGER THINGS. OR IT ?
    15·2 answers
  • It is an electronic device that capable of accessing accepting processing product and storing data​
    13·1 answer
  • Changing the color of the text in your document is an example of
    12·2 answers
  • Carmen has met new people online that she enjoys talking to. One of these people has asked her to meet at the park in person and
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!