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]
2 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]2 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
Please help im not good at computer class ​
Veronika [31]

Answer:

W.

Explanation:

4 0
3 years ago
Read 2 more answers
Switched backbone networks:_____.a. always use a ring topology.b. require much more management that do routed backbone networks.
Gre4nikov [31]

Answer:

c

Explanation:

spongo  

7 0
3 years ago
What setting in Word keeps single lines of a new
Gre4nikov [31]

Answer:

C (Window/Orphan control)

Explanation:

An "orphan" in formatting is a single line of text that is left alone/separated from the rest of the paragraph. Orphan control prevents this from happening by keeping lines together.

3 0
3 years ago
What is the difference between Windows 7 and Windows 10?
Novay_Z [31]
If you have windows 7 and then change to windows 10, you will see a lot of differences like Microsoft account integration, a new start menu, new apps and a windows store, Cortana and a task view bar, you get edge in windows 10, and most important desktop and security improvements
 Hope this helps!
6 0
2 years ago
Which element in the PowerPoint application is not available in the Microsoft Word® application?
mihalych1998 [28]
The element found in powerpoint but not word would be the ability to create slides, or presentations My Source Is google Hope This Helps You!!!!!!
4 0
2 years ago
Read 2 more answers
Other questions:
  • Write a program that determines the price of a movie ticket (similar to the one in the chapter). The program asks for the custom
    9·1 answer
  • The Internet of Things (IoT) is a concept with emphasis on machine-to-machine communications to describe a more complex system t
    10·1 answer
  • Which of these is not a modifier?<br><br> short<br><br> unsigned<br><br> nest<br><br> long
    15·1 answer
  • An administrator needs to set up an authentication server for users connecting to a network through a VPN. What kind of server c
    10·1 answer
  • A software programâs _________ indicates what can legally be done with that program.]
    5·1 answer
  • How to get this on your screen in 2k20 on Xbox
    14·2 answers
  • A law office has been leasing dark fiber from a local telecommunications company to connect a remote office to company headquart
    14·1 answer
  • Sarah's Texas location has a server that is starting to give her trouble. It is needing to be restarted frequently and seems to
    15·1 answer
  • Ask the user to input a number less than 100. Print all the numbers from that number to 100.
    6·2 answers
  • ______allow you to select elements that are in a certain state, such as when the mouse if hovering over an element
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!