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
NikAS [45]
3 years ago
7

g If a class named Student has a data member named gpa , and one of its member functions has a parameter also named gpa , how ca

n you refer to the data member inside that member function
Computers and Technology
1 answer:
victus00 [196]3 years ago
5 0

Answer:

By using the this keyword

Explanation:

The this keyword in java is used for pointing the current object or current variable .The this keyword is removing the ambiguity among the characteristics of the class as well as the variables with the similar name.

In the given question if the class student has member variable gpa also we have a method having the argument gpa with the help of this keyword we can refer the gpa variable inside the method .

Following are the implementation of the given question

public class Main // main class

{

 int gpa; // variable declaration

 public Main(int gpa) // constructor

 {

   this.gpa = gpa; // this keyword

 }

 public static void main(String[] args) // Main method

 {

   Main m= new Main(55); // creating object of class

   System.out.println("The Value of gpa is : " + m.gpa); // display value

 }

}

Output:

The Value of gpa is :55

You might be interested in
The four differences between binary and denary​
Andrei [34K]

Explanation:

Binary and denary

A number base indicates how many digits are available within a numerical system. Denary is known as base 10 because there are ten choices of digits between 0 and 9. For binary numbers there are only two possible digits available: 0 or 1. The binary system is also known as base 2.

mark me brainliest please

8 0
3 years ago
If Number = 7, what will be displayed after code corresponding to the following pseudocode is run? (In the answer options, new l
kherson [118]

Answer:

5,10; 6,12; 7,14

Explanation:

We will demonstrate the iteration of the loop:

First iteration: Number = 7, Count = 5 at the beginning. We will check if Count <= Number? Since it is correct, prints 5,10. Increment the Count by 1.

Second iteration: Number = 7, Count = 6. We will check if Count <= Number? Since it is correct, prints 6,12. Increment the Count by 1.

Third iteration: Number = 7, Count = 7. We will check if Count <= Number? Since it is correct, prints 7,14. Increment the Count by 1.

Forth iteration: Number = 7, Count = 8. We will check if Count <= Number? Since it is not correct, the loop stops.

8 0
3 years ago
Answer the question ASAP please
RUDIKE [14]

Answer:

Shows the programming checking if num1 is greater than num2

Explanation:

So num1 and num2 are inputs

for you to code this you would need to put

num1=int(input("What is your first number? ))

and the same for num2 except change num1 for num 2 and first for second

When the input is completed, the computer will check if num 1 is greater than num2

it will do this by using a code something like:

if num1>num2:

    Print("Your first input was greater than your second")

But in this example if it greater it just ends

But if it was less than you would put

if num1>num2:

    Print("Your first input was greater than your second")

elif num1<num2:

    Print("Your first input is less than your second")

So basically this code shows the computer checking if one number is greater than the other or not

3 0
2 years ago
Read 2 more answers
Why are medical coders using encoded software
EastWind [94]
To keep the medical records confidential otherwise, hackers would take advantage of them and sell them to the highest bidder 
3 0
3 years ago
Why is it important to think about the programming language to use?
Sloan [31]
In think is C or B in my opinion
6 0
3 years ago
Other questions:
  • You can create a database using one of the many templates available or by creating a new ______ database.
    9·1 answer
  • What is the purpose of a turbine in a power plant?
    14·1 answer
  • Suppose you have one particular application that is trying to send data on the Internet but none of the data is making it to the
    15·2 answers
  • . What type of device is a computer? Where does it use?​
    14·1 answer
  • Random number between 0 and 5 (inclusive)
    10·2 answers
  • What are the purposes of a good web page design?
    9·2 answers
  • The lines that connect the points of a polygon are called: (1 point)
    6·2 answers
  • Hewo everyone look at me I look ugly don't I<br>​
    6·2 answers
  • Suppose the ESPN website uses 8-bit unsigned integers to store how many points a team has scored in
    12·1 answer
  • Writing queries in sql to compile data from a database is related to the physical level of databases true or false?.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!