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
What could be a summary sentence or phrase that captures your writing experience?
Natasha2012 [34]

<u>Answer:</u>

<em>A summary sentence should brief the whole content “what so ever the length of the original content” may be. </em>

For example, if you take a story, <em>moral will be the good example of summary. </em>One another example is when the teacher taught concept in the classroom, in the last few minutes of the class the teacher <em>would brief the whole into smaller points. </em>

Even nowadays, people go and visit movies only after seeing the review online. So once again the review is a small brief about the movie in one or two lines. <em>It should be crisp, use cherry-picked words, etc.</em>

3 0
3 years ago
C2.5 - A group of four pirates has a treasure chest and one unique lock and key for each pirate. Using hardware that is probably
slavikrds [6]

Answer:

Explanation:

All the pirates uses their individual key and lock for the locking down of each the four sides of the lid of to the chest. Among the pirates, if three of them decides to open their latches, they can be able to lift the top by essentially using the fourth (locked) latch as a hinge to open the top. (We have several solutions or ways to do this.)

3 0
3 years ago
Given a collection of n nuts and a collection of n bolts, arranged in an increasing order of size, give an O(n) time algorithm t
kari74 [83]

Answer:

See explaination

Explanation:

Keep two iterators, i (for nuts array) and j (for bolts array).

while(i < n and j < n) {

if nuts[i] == bolts[j] {

We have a case where sizes match, output/return

}

else if nuts[i] < bolts[j] {

this means that size of nut is smaller than that of bolt and we should go to the next bigger nut, i.e., i+=1

}

else {

this means that size of bolt is smaller than that of nut and we should go to the next bigger bolt, i.e., j+=1

}

}

Since we go to each index in both the array only once, the algorithm take O(n) time.

8 0
3 years ago
Which of the following is an example of intellectual property?
Gnesinka [82]

Answer:

B. Programming code for a video game

Explanation:

An item is considered an intellectual property if it is intangible in the sense that the actual property cannot be touched and it does not have a physical presence.

Options A, C and D do not fall in this category because they are tangible and they have physical presence.

Only option A, programming source code does not fall into this category.

Hence, <em>B. Programming code for a video game </em> answers the question

8 0
2 years ago
What engine component is shown in the above Figure?
astra-53 [7]

send attached file with it


5 0
3 years ago
Read 2 more answers
Other questions:
  • SecOps focuses on integrating the need for the development team to provide iterative and rapid improvements to system functional
    11·1 answer
  • PLEASEEE HELPPPP me
    13·1 answer
  • Your company received a call from a historical society inquiring about the possibility of networking a two-century-old building
    15·1 answer
  • The hexadecimal number system uses alphabets A to F to represent values_ to _
    12·2 answers
  • Which statement describes the relationship between science and technology?
    13·2 answers
  • By convention only, either the first usable address or the last usable address in a network is assigned to the router (gateway)
    11·1 answer
  • Match each example to the type of component, either Input, Process, or Output.
    12·1 answer
  • ASAP BRAINLIEST!!!
    10·1 answer
  • How do you delete questions you asked?
    7·2 answers
  • Identify three errors in this HTML code snippet:
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!