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
andriy [413]
3 years ago
6

Consider a classStudent. The following code is used to create objects and access its member functions. Which statement is true a

bout the code? int main() { Student newStud; Student stud; Student oldStud; stud.GetDetails(); return 0; } a. There are three objects created of Student class and they each have their own memory allocations. The GetDetails() function is invoked for all objects of the class Student. b. There are three objects created of Student class and they each have their own memory locations. The GetDetails() function is invoked for only the stud object of the class Student. c. There are three objects created of Student class and the compiler allocates only one memory location. The GetDetails() function is invoked for only the stud object of the class Student. d. There are three objects created of Student class and the compiler allocates only
Computers and Technology
1 answer:
zubka84 [21]3 years ago
8 0

Answer:

b. There are three objects created of Student class and they each have their own memory locations. The GetDetails() function is invoked for only the stud object of the class Student.

Explanation:

When you look at the code, you will see three object of the Student class is created: newStud, stud, and, oldStud, having their own memory locations. Meaning, the value of the data member in Student class can be different for newStud and stud. Even though all the objects can access the GetDetails() function, only the stud object called the GetDetails() function, stud.GetDetails();

You might be interested in
What is the purpose of reading in typography
IgorLugansk [536]

Answer:

The main purpose of typography is to make life easier for your readership by making it easier to read what you've written: It makes it possible to to quickly scan your text. It entices your readers to engage with your text. When done well, it enhances the message it presents

4 0
3 years ago
Write a function DrivingCost() with input parameters drivenMiles, milesPerGallon, and dollarsPerGallon, that returns the dollar
stira [4]

Answer:

// program in C++.

#include <bits/stdc++.h>

using namespace std;

// function to calculate cost

double DrivingCost(double drivenMiles, double milesPerGallon, double dollarsPerGallon){

  double cost;

  //Expression to compute cost

  cost = drivenMiles / milesPerGallon * dollarsPerGallon;

  return cost;

}

// main function

int main()

{

   double drivenMiles, milesPerGallon, dollarsPerGallon;

  //initialise the variables

  drivenMiles = 50;

  milesPerGallon = 20.0;

  dollarsPerGallon = 3.1599;

  //Call function

  double cost = DrivingCost(drivenMiles,milesPerGallon,dollarsPerGallon);

  //Display result

  cout<<"Driven miles : "<<drivenMiles<<endl;

  cout<<"Miles per Gallon : "<<milesPerGallon<<endl;

  cout<<"Dollars per Gallon : "<<dollarsPerGallon<<endl;

  cout << fixed << setprecision(2);

  cout<<"The total driving cost : "<<cost ;

  return 0;

}

Explanation:

Declare and initialize drivenMiles with 50, milesPerGallon with 20.0 and dollarsPerGallon with 3.1599.Call the function DrivingCost() with these parameters,This will calculate the cost and return the value.Print the result after getting the cost.Similarly we can calculate cost for drivenMiles equals to 10 and 400 miles also.

Output:

Driven miles : 50

Miles per Gallon : 20

Dollars per Gallon : 3.1599

The total driving cost : 7.90

5 0
3 years ago
Java uses ____ to implement method lookup.A) a jump tableB) an inheritance treeC) restricted accessD) polymorphism
sashaice [31]

Answer:

D) polymorphism

7 0
4 years ago
I hate these homework it's very hard and I need help
liubo4ka [24]
Ethics is the answer I believe
8 0
3 years ago
Research online and identify two online plagiarism checker tools. Choose such tools that you can use for writing your schoolwork
LenaWriter [7]

This is an essay question, not fit for Brainly - please remove. There is a plagiarism checker by both Grammarly and Quetext, use those to help find your answer.

4 0
4 years ago
Other questions:
  • Which of the following statements is not true about proper tire care? a.If you see a wear bar across the width of the tread whil
    14·2 answers
  • What does technological convergence mean, with examples?
    10·1 answer
  • A _____ defines what must take place, not how it will be accomplished.​
    12·1 answer
  • A television advertisement claiming that a product is "light-years ahead of its time" does not make sense because (a) it doesn’t
    10·1 answer
  • We use a cubic equation in which the variables and coefficients all take on values in the set of integers from 0 through p - 1 a
    8·1 answer
  • What are procedures that help keep a data base current
    7·2 answers
  • Can someone help me calculate this Multimedia math:
    11·1 answer
  • Which object event is an indication that something has been created but not committed into the database?
    13·1 answer
  • What is one of the benefits of using a library in a program?
    5·1 answer
  • Indicate if the statement is true or false False 1. A spreadsheet cannot recalculate after you have changed data in your workshe
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!