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]
2 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]2 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
To break a text string into several lines, which means that the text string continues on the next line, the _____ character shou
Montano1993 [528]

Answer:

To break a text string into several lines, which means that the text string continues on the next line, the backslash character should be used.

4 0
2 years ago
The amount of money you can charge to a credit card is called
Novosadov [1.4K]
Transfer fee or just fee.
8 0
2 years ago
Write a procedural programming loop.. Your loop should start variable n with a value of 10 and count down to zero. The loop shou
anastassius [24]

Answer:

//Here is the for loop in C.

for(n=10;n>0;n--)

{

   printf("count =%d \n",n);

}

Explanation:

Since C is a procedural programming language.Here if a loop that starts with n=10; It will run till n becomes 0. When n reaches to 0 then loop terminates otherwise it  print the count of n.

// here is code in C++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{  // variables

int n;

// for loop that runs 10 times

// when n==0 then loop terminates

for(n=10;n>0;n--)

{

   cout<<"count ="<<n<<endl;

}

return 0;

}

Output:

count =10

count =9

count =8

count =7

count =6

count =5

count =4

count =3

count =2

count =1

3 0
3 years ago
Martha is developing a software program in C++ and has a question about how to implement a particular feature. She performs an o
VLD [36.1K]

Answer:

A blog

Explanation:

A blog is a regularly updated website or web page, typically one run by an individual or small group, that is organised by posts.

7 0
3 years ago
Programming hooks, or guidelines, published by firms that tell other programs how to get a service to perform a task such as sen
RideAnS [48]

Answer:

"Application programming interface(API)" is the correct answer for the above question.

Explanation:

  • API is an interface which is used to call the different software in the currently developing software by the developer to inbuilt some task of that software.
  • The full of this is the Application programming interface. It is an interface or guidelines which are used to tell the other software, that how a particular service is performed.
  • The above concept is asked by the above question. so the answer is API.
4 0
3 years ago
Other questions:
  • Some financial institutions can be really bad about putting unexpected charges
    12·1 answer
  • Arpanet was developed by the united states so that there was a communication network that would survive a nuclear war. True or F
    11·1 answer
  • There are n tasks to complete. Each task first needs to be preprocessed on a supercomputer and then finished on one of n process
    12·1 answer
  • A. experiment by purposely misconfiguring the gateway address on pc-a to 10.0.0.1. what happens when you try and ping from pc-b
    14·1 answer
  • Mation about which osi layers of connected cisco devices can be verified with the show cdp neighbors comm
    15·1 answer
  • How do I connect my CSS file and HTML page together? it's just not wanting to work for me. I have 3 other HTML pages that have t
    12·1 answer
  • Given the three side lengths, how can you tell if a triangle<br>is a right triangle?​
    5·1 answer
  • _____________ data is what is translated to digital format so it can be stored in a computer.
    10·1 answer
  • True or false there is no relationship between the purpose of the page and the page quality
    13·1 answer
  • ____________ are collected from several entities at the same point in time.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!