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
How are devices connected to each other via Bluetooth? Choose two answers.
Olegator [25]

Answer:

Pairing and Passkey or PIN

Explanation:

8 0
3 years ago
Communication is used to satisfy instrumental goals, which means ________ .
Ann [662]
Communication comes in lots of types, therefore, it also has lots of goals and purposes. One of the purpose of communication is to satisfy instrument goals. Instrument goals here refers to the goal that focuses on convincing others to act in an appropriate way. This is most applicable in situations when someone had to deal with others. 
3 0
3 years ago
Read 2 more answers
If an investigator finds a computer that is turned off during a search with a warrant, the investigator should:___________.
cluponka [151]

Answer:

B. leave the computer turned off.

Explanation:

8 0
3 years ago
The shipping charges per 500 miles are not prorated. For example, if a 2-pound package is shipped 550 miles, the charges would b
Sedbober [7]

Answer:

The solution code is written in Python:

  1. COST_PER_500MI = 1.1
  2. weight = float(input("Enter weight of package: "))
  3. total_cost = weight * COST_PER_500MI
  4. print("The shipping charges is $" + str(round(total_cost,2)))

Explanation:

Based on the information given in the question, we presume the cost per 500 miles is $1.10 per pound ($2.20 / 2 pound).

Create a variable COST_PER_500MI to hold the value of cost per 500 miles (Line 1). Next, prompt user input the weight and assign it to variable weight (Line 3). Calculate the shipping charge and display it using print function (Line 4-5).

4 0
3 years ago
What are some options available when you click File and then Print? (Multiple Choice)
WITCHER [35]

Answer:

Changing Margins

Selecting the Printer

Viewing a preview

Selecting the pages to print

Changing the page orientation

Explanation:

3 0
3 years ago
Other questions:
  • The overall purpose of a food guide is________.
    11·1 answer
  • What needs to be increased in order to increase image size and clarity?
    10·1 answer
  • What food does swiss eat on christmas?
    10·1 answer
  • Need Help!
    9·1 answer
  • Write a program that calculates and displays the amount ofmoney available in a bank account that initially has $8000 deposited i
    9·1 answer
  • Consider the following code segment.
    11·1 answer
  • What is the iterative procedure of recursive and nonrecursive?
    10·1 answer
  • HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HEL
    15·2 answers
  • What is the missing line of code?
    7·2 answers
  • Pls help now the question is very hard someone help me pls​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!