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
Linda is searching for a new job. Which information would her potential employers likely review in her social profile?
nasty-shy [4]
The answer will be A they would wanna know about her work history
3 0
3 years ago
Read 2 more answers
Could some please answer the question in the pictures? Thank you!! I will also give your brainliest if you give me the right ans
timama [110]

Answer:

1

Explanation:

per page must have 1 body

8 0
2 years ago
What are 3 possible causes of getting a "network cable unplugged" message on a pc, assuming that the cable is not actually unplu
Nat2105 [25]
I've had that problem before. The cause of my problem was 2 things and that was the age of the cable, and build up of dust on each of the cable.
7 0
4 years ago
Finish the code to search for a 7 in the array.
guapka [62]

Answer:

The complete code is as follows:

from array import *

myArr = array('f',[3, 5, 7,3, 10])

location = myArr.index(7)

print(str("7")+" is at position "+str(location+1))

Explanation:

I made corrections to the third line of the code and I added a line

This line gets the index of 7 from the array myArr using the index keyword

location = myArr.index(7)

This line prints the position of the 7 in the array

print(str("7")+" is at position "+str(location+1))

8 0
3 years ago
Which software development model focuses on refining a software system's current version in each subsequent development cycle?
Firdavs [7]
I think that would be D
 but i may be wrong
6 0
3 years ago
Other questions:
  • What does in-private or incognito browsing do?
    5·1 answer
  • A(n) __________ employs a method called "tunneling" in which each packet from the sending computer is encapsulated within anothe
    8·1 answer
  • Which shape denotes a process to be carried out in a flowchart?
    7·2 answers
  • What are the differences between a trap (aka software interrupt) and an interrupt (hardware interrupt)? What is the use of each
    12·1 answer
  • Which of the following is NOT a strength of monetary policy?
    15·1 answer
  • What is the purpose of using variables in programming?
    11·1 answer
  • Stay at least _____ behind the vehicle ahead of you at all times.
    12·2 answers
  • How do I mark someone brainiest
    9·2 answers
  • What is the difference between Brainly.com and Brainly.in? Ive been wondering because im not signed in under Brainly.in.
    6·2 answers
  • How would you use SQL to change a table's structure? What general types of changes are possible? Which commands are used to impl
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!