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
KatRina [158]
2 years ago
12

Which class members should be declared as public?

Computers and Technology
1 answer:
yawa3891 [41]2 years ago
6 0

Answer:

B. Methods and occasionally final attributes

Explanation:

In Computer programming, class members can be defined as the members of a class that typically represents or indicates the behavior and data contained in a class.

Basically, the members of a class are declared in a class, as well as all classes in its inheritance hierarchy except for destructors and constructors.

In a class, member variables are mainly known as its attributes while its member function are seldomly referred to as its methods or behaviors.

One of the main benefits and importance of using classes is that classes helps to protect and safely guard their member variables and methods by controlling access from other objects.

Therefore, the class members which should be declared as public are methods and occasionally final attributes because a public access modifier can be accessed from anywhere such as within the current or external assembly, as there are no restrictions on its access.

You might be interested in
Which statement refers to a computer software
bija089 [108]

You need to see an image, but here's some possible answers.

operating system.

program.

spreadsheet.

freeware.

groupware.

shareware.

application software.

bundled software.

software system. ...

package. ...

sofware (related) ...

hardware (related) ...

software program. ...

software-hardware (related) ...

pc-based (related)

<h2><u><em>Bryannasalaz</em></u></h2>

4 0
2 years ago
Write a program that accepts two integers from the user and perform one of the four arithmetic operations based on user’s choice
madam [21]

Answer:

am i to late or do you still need the answer?

Explanation:

3 0
2 years ago
¿Que es la energía? (una sola respuesta es la correcta)
kozerog [31]

Answer:

es la a ya que la luz actua en un cuerpo

8 0
3 years ago
What are the factors that affect self-confidence?
denis-greek [22]

Answer:

The factors that affect self confidence are not having enough faith in yourself and letting what others say about you put you down

Explanation:

Plz mark brainlest it will help me so much

5 0
2 years ago
Question: 4/8
Gemiola [76]

The generated test cases for the function assuming another developer coded the function is given below in a C++ program.

<h3>THE CODE</h3>

#include <iostream>  

#include <iomanip>

#include <string>

using namespace std;

// define the data type "triangletype" with {values}

enum triangleType { scalene, isosceles, equilateral, noTriangle };

// Prototype function which returns the position of triangleType{value}

// Example: Scalene = 0, isosceles = 1, etc. These are zero indexed.

triangleType triangleShape(double a, double b, double c);

// Prototype function which takes the integer value of the

// triangle type and outputs the name of triangle

string shapeAnswer(int value);

int main() {

   double inputA;

   double inputB;

   double inputC;

   cout << "To determine whether a triangle is either:" << endl;

   cout << setw(50) << " - Scalene" << endl; // Unequal in length

   cout << setw(52) << " - Isosceles" << endl; // Two sides equal length

   cout << setw(54) << " - Equilateral" << endl; // All sides equal

   cout << setw(57) << " - Not a triangle" << endl;

   cout << "Enter side A: ";

   cin >> inputA;

   cout << "Enter side B: ";

   cin >> inputB;

  cout << "Enter side C: ";

   cin >> inputC;

   cout << "The triangle is " << shapeAnswer(triangleShape(inputA, inputB, inputC)) << endl;

}

triangleType triangleShape(double a, double b, double c) {

   triangleType answer;

   if ( c >= (a + b) || b >= (a + c) || a >= (b + c) ) {

       answer = noTriangle;

   }

   else if (a == b && b == c) {

       answer = equilateral;

   }

   // Test the 3 options for Isosceles equality

   else if ( (a == b) && (a != c) || (b == c) && (b != a) || (a == c) && (a != b) ) {

       answer = isosceles;

   }

   else {

       answer = scalene;

   }

   return answer;

}

string shapeAnswer(int value) {

   string answer;

  switch (value) {

   case 0:

       answer = "Scalene";

       break;

   case 1:

       answer = "Isosceles";

       break;

   case 2:

       answer = "Equilateral";

       break;

   case 3:

       answer = "Not a triangle";

       break;

   default:

       break;

   }

   return answer;

}

Read more about C++ programs here:

brainly.com/question/20339175

#SPJ1

8 0
1 year ago
Other questions:
  • Of the different IRT roles, the _______________ is head of the team and issues the ultimate call regarding how to respond to an
    15·1 answer
  • Write a program that can be used to gather statistical data about the number of movies college students see in a month. The prog
    11·1 answer
  • Erick, who is taking an online course, sent an e-mail to his
    14·2 answers
  • )1-bit sign, 8-bit exponent, 23-bit fraction and a bias of127 is used for ___________ Binary Floating PointRepresentation
    11·1 answer
  • The contents of an array of type ______ can be displayed with the cout operator (without specifying an element). - 1 point(s)
    14·1 answer
  • "To take advantage of these developments in the digital world, new approaches, concepts,instruments, and methods are needed, whi
    8·1 answer
  • Which route of entry could chemicals use to enter through the body’s airways?
    8·1 answer
  • Where on the internet can you find a site that will allow you to tour bill gates mansion
    8·2 answers
  • How many passes will it take to find the four in this list? 4, 5, 6, 7, 8, 9, 10 1 2 3 4
    12·2 answers
  • Paul is a baker who wants to improve his recipe for muffins because they turn out with a greasy flavor. What ingredient should h
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!