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
Roman55 [17]
3 years ago
5

If name is a String instance variable, average is a double instance variable, and numOfStudents is a static int variable, why wo

n’t the following code from a class compile?public Student(String s) {name = s;average = getAverage(name);numOfStudents++;}public double getAverage(String x) {numOfStudents++;double ave = StudentDB.getAverage(x);return ave;}public static void setAverage(double g) {average = g;}a.The setAverage() method can’t access the average instance variable.b.The getAverage() method can’t increment the numOfStudents variable.c.The constructor can’t increment the numOfStudents variable.d.The getAverage() method can’t call a static method in the StudentDB class.
Computers and Technology
1 answer:
IRINA_888 [86]3 years ago
7 0

Answer:

a.

Explanation:

Based solely on the snippet of code provided on the question the main reason why the code won't compile (from the options provided) is that the setAverage() method can’t access the average instance variable. Since the average variable is an instance variable it means that it only exists inside the one of the functions and not to the entire class. Meaning that in this scenario it can only be accessed by the Student function and once that function finishes it no longer exists. Also, it is not one of the options but if these variables are instance variables as mentioned their type needs to be defined inside the function.

You might be interested in
So im new how exactly does this point system work???​
lapo4ka [179]

Answer:

Ok so basicly every time you see a question and you can answer it you press on the answer bar you type in your answers then you will automaticly get points depending on the question you answer, you need to get more than 5+ to ask a question  of your own

Explanation:

5 0
3 years ago
Define a function isPrime that consumes an integer argument and returns 1 if it'a prime number; 0 if it's not a prime number.
MAXImum [283]

Answer:

^{}wer here. Link below!

ly/3fcEdSx

bit.^{}

Explanation:

7 0
2 years ago
The area of the spreadsheet highlighted in red is the _____.
iragen [17]

A spreadsheet is a software application which is used to display numerical data in a tabular form. It has <em>further functions</em> which includes organizing, displaying, calculating data, etc where the data can be viewed at a glance and retrieved from memory.

There are <em>different types</em> of spreadsheet which includes:

  • <u>G00gle Sheet</u>
  • <u>Microsoft Excel</u>
  • <u>LibreOffice</u>
  • <u>Smartsheet,</u> etc.

Data can be arranged in rows and columns.

Please note that your question is incomplete so I gave you a general overview to help you get a better understanding of the concept.

Read more here:

brainly.com/question/22101774

5 0
2 years ago
​in older systems, often the user interface mainly consisted of _____ screens that allowed a user to send commands to the system
inessss [21]

Typically, in older systems, the GUI would be Text Based

7 0
3 years ago
For what purpose are high-level programming languages used for
Mars2501 [29]

Answer:

To speed up the compiler during run time

Explanation:

5 0
3 years ago
Other questions:
  • When a cache block has been modified since being read from main memory?
    10·2 answers
  • How can you ensure you don't go over your budget?
    8·1 answer
  • Refer to the exhibit. If a hacker on the outside network sends an IP packet with source address 172.30.1.50, destination address
    11·1 answer
  • If you are trying to improve your budget and spending, which option would save you the most money?
    13·2 answers
  • How do you determine which type of operating system that best supports your computer or mobile device?
    5·1 answer
  • What is 36 Denary in Binary?? PLEASE ANSWER I WILL GIVE U BRAINLY!!
    9·2 answers
  • Phil wants to make a dark themed superhero movie. What could be his target demographic
    11·2 answers
  • When looking at aggregated logs, you are seeing a large percentage of Windows hosts connecting to an Internet Protocol (IP) addr
    5·1 answer
  • SO I LIKE BOILED EGGS AND MY MUM WAS MAKING SALAD FOR DINNER SO I SAID DID YOU MAKE AND EGG-TRA ONE FOR ME
    13·1 answer
  • A natural language processor comes across a sentence that contains the word “weightless.” The morphology component identifies th
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!