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
For which tasks would Excel be useful? Check all that apply.
viktelen [127]

Answer:

Creating charts or graphs

Bringing data together

Storing Financial data

Explanation:

Excel is great at creating charts and graphs

Also good at compiling data

You wouldn't necessarily want to type an essay in excel, so not for writing an essay

You cannot schedule appointments through excel, although I guess if you really wanted to you could organize them in excel

Excel is fine for storing financial data, you can even manipulate it in the program

You cannot draw conclusions using excel directly, although you can organize data in such a way using excel that it makes it easy to identify trends and such for you to draw your conclusions

5 0
3 years ago
A low-level language has a low level of ___________ because it includes commands specific to a particular cpu or microprocessor
Studentka2010 [4]
Command Specifics to a cpu or a microprocessor it is code <span />
7 0
4 years ago
Join my among us <br><br> code GNLMJF
ryzh [129]

Answer:

i cant

Explanation:

i would but im on a chromebook rn

sorry but thanks

take care

8 0
3 years ago
Read 2 more answers
3.What is the difference between SODIMM and UniDIMM?
lorasvet [3.4K]

Answer:

Small Outline Dual Inline Memory Module and Unbuffered Dual Inline Memory Module are two terms that describe types of computer memory. While UDIMM is a generic term that applies to most memory modules, SO-DIMM modules are used almost exclusively in notebook computers

Explanation:

6 0
4 years ago
Which one of the following statements is true regarding the fetch-execute cycle? Each step of the fetch-execute cycle is perform
AfilCa [17]

Answer:

The device responsible for performing the fetch-execute cycle is the CPU.

Explanation:

The fetch execution cycle is the way or method the CPU executes instructions given to it. In this process or cycle, the CPU fetches the instruction, then decodes it, executes it, and stores the information in its database.

The CPU executes one instruction at a time.

8 0
4 years ago
Other questions:
  • A system of interlinked documents that are available on the internet is
    5·1 answer
  • A network engineer arrives at work and discovers that many users are having problems when attempting to connect to the company n
    9·2 answers
  • Anderson uses his computer and internet link to chart the movement of his favorite 46 stocks. He buys and sells according to the
    15·1 answer
  • FREE POINTS JUST ANSWER MY LATEST TWO QUESTIONS PLEASE
    10·2 answers
  • For this lab you will find the area of an irregularly shaped room with the shape as shown above.
    7·1 answer
  • (EASY 15 POINTS) What are two indications in a browser that a secure connection is being used?
    6·1 answer
  • You have an interface on a router with the IP address of 192.168.192.10 /29. What is the broadcast address the hosts will use on
    15·1 answer
  • ___________ is a task pane used to correct grammar errors; opens when you click the Spelling &amp; Grammar button in the Proofin
    15·2 answers
  • What are different ways that celebrities try to connect with fans using the Internet and social media?
    5·1 answer
  • To create a cell reference in another spreadsheet you must need to start with _______ sign.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!