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
lys-0071 [83]
3 years ago
10

Person-name: String+setName(String name): void+getName(): String^Student-studentID: long+Student(String sname, long sid)+setID()

: longWhich of these fields or methods are inherited (and accessible) by the Student class?
1. getName(), setName(), name
2. name, getName(), setName(), getID()
3. studentID, name, getName(), setName(), getID()
4. getName(), setName(), toString()
5. None of them
6. getName(), setName(), studentID, getID()
Computers and Technology
1 answer:
ValentinkaMS [17]3 years ago
4 0

Answer and Explanation:

Basically its answer is option 4 where getName(), setName().to String()

let us explained it through  a program where get and set method has been used.

Create  Student class that has marks and grade. Two parameters initialize data member using constructors .Each data member gives values and member function .Show the values of data member.

You can code it in turbo and Dev C++ tool .

# include<iostream.h>

#include<conio.h>

class Student

{

private:

int marks;

String name;

char grade;

public:

Student ( int m , char g)  //get method where it get student marks and grade                                      

{ marks = m ;

grade = g;

}

public void set Name(String a) {

       name = a;

   }

 public String getName() {

       return name;

   }

void set()

{

cout <<"Marks = " <<marks <<endl;

cout<<"Name=" <<name<<endl;

cout <<"Grade = "<< grade <<endl;

}

};

void main ()

{

clrscr();

Student s1(730,'A','ali') s2(621,'B','haider')

cout <<"Recording of student 1 "<<endl;

s1.set();

cout <<"Recording of Student 2:"<<endl;

s2.set();

getch();        

}

for the above program you can see from

//{

cout <<"Marks = " <<marks <<endl;

cout<<"Name=" <<name<<endl;

cout <<"Grade = "<< grade <<endl;

}//

where name marks and grade are inherited from the class Student with get and set methods.But name is take into data type of string because string hold zero ,more letters , space and commas.So it is used to represent the text data.

You might be interested in
After which problem-solving stage should you take action?
Mumz [18]

Answer:

Option: Making a choice

Explanation:

In a problem solving process, it starts with defining a problem which is the first step that we need to identify the issue.

After that, we should gather the information on the issue that we identify. For example, we are root cause of the problem, what are the possible solutions etc.

Next, we evaluate the information that we collect (e.g. pro and cons of a particular solution).

Next, we make a choice on the solution that we are going to take after further evaluation on all the options we have.

Only after we make a choice, then we can take action based on our chosen solution to solve the problem.

4 0
3 years ago
A recent antivirus scan on a server detected a Trojan. A technician removed the Trojan, but a security administrator expressed c
BabaBlast [244]

Answer:

B. Spyware

Explanation:

Spywares are silent software that steals sensitive information such as internet or company data, and other similar information. They are oftentimes unnoticed and supply stolen data to external users, data centers or advertisement companies.

Sophisticated spyware can go as far as installing software to manipulate your settings or use passwords on your behalf.

Even though the Trojan was detected in our scenario, The Trojan would have created a backdoor to allow spyware in. This spyware will not be easily noticed by the technician or the antivirus, however, it could be more devastating than the Trojan.

That is why the security administration expresses concern over a breach despite the removal of the Trojan.

3 0
3 years ago
Which of the following are advantages of using meaningful names for variables when writing a program? Select two answers.
Colt1911 [192]

Answer:

The answer is 2 and 4, please give brainliest award.

8 0
3 years ago
The ____number system is base 10​
evablogger [386]

Answer:

The correct answer to this question is given below in the explanation section.

Explanation:

This is a fill-in-blank question.

The answer is:

The decimal number system is base 10.

In our everyday life, we use a number system that is a Base-10 system. As we know that the base-10 is known as the decimal system and this number has 10 digital starting from 0 to 9 such as:

0,1,2,3,4,5,6,7,8,9

We use this number system in our daily accounting and in daily life and it is a base-10 number system. This number system uses 10 as its base number so it is called a base-10 system. It is also called the decimal number system.

7 0
3 years ago
Java Programming Challenge Description:Write a program that, given two binary numbers represented as strings, prints their sum i
Sunny_sXe [5.5K]

Answer:

import java.util.Scanner;

public class DecimalToBinary {

   public static String convertToBinary(int n) {

       if(n == 0) return "0";

       String binary = "";

       while (n > 0) {

           binary = (n % 2) + binary;

           n /= 2;

       }

       return binary;

   }

   public static int convertToDecimal(String binary) {

       int n = 0;

       char ch;

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

           ch = binary.charAt(i);

           n = n*2 + (ch - '0');

       }

       return n;

   }

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       String[] words = in.nextLine().split(",");

       System.out.println(convertToBinary(convertToDecimal(words[0].trim()) + convertToDecimal(words[1].trim())));

       in.close();

   }

}

Explanation:

8 0
3 years ago
Other questions:
  • TRUE/FALSE: In order to use an object in a program, its class must be defined.
    10·1 answer
  • Which is the most important reason you should properly cite information that you obtain from an Internet search? Question 2 opti
    8·1 answer
  • Can Sombody please help me with this question, I'm struggling!
    7·1 answer
  • Write a setInterval() function that increases the count by 1 and displays the new count in counterElement every 300 milliseconds
    12·1 answer
  • The two key elements of any computer system are the____and the _____.
    7·1 answer
  • Why are ethics important in PR?
    8·1 answer
  • A switch that is configured to use the Spanning Tree Protocol will place a port in ____________ mode if sending traffic to it ma
    11·1 answer
  • What does it mean for a heap to be complete?
    7·1 answer
  • Using complete sentences post a detailed response to the following.
    5·2 answers
  • True or False: Nested elements must be indented with respect to parent elements in
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!