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
nydimaria [60]
3 years ago
14

Given the following class, what would be the best declaration for a mutator function that allows the user of the class to change

the age?
class Wine

{

public:

Wine();

int getAge();

float getCost();

private:

int age;

float cost;

}

a. int getAge(int newAge);

b. Wine();

c. void setAge();

d. void setAge(int newAge);
Computers and Technology
1 answer:
Inga [223]3 years ago
8 0

Answer:

Option D void setAge(int newAge);

Explanation:

In object oriented programming, mutator method is defined to change the value of the data member(s) in the class. Since the mutator method is aimed to change the value of a class data member, it is required to take in one new value as parameter to overwrite the existing value of data member. The mutator doesn't return any output. Hence, the best declaration for a mutator method to change the age is

void setAge(int newAge);

The new value of age is passed to parameter <em>newAge</em> and the <em>void </em>means the method doesn't return any value as output.

You might be interested in
What is the best game of 2020 in pc​
dybincka [34]

Answer:we have games like alien wars call of duty astro avengers

Explanation:8

8 0
4 years ago
Read 2 more answers
Write a short note on attributes in HTML.<br> If you answer this i will mark you as BRAINLIST
Hunter-Best [27]

Answer:

Explanation:

HTML attributes are a modifier of an HTML element type. An attribute either modifies the default functionality of an element type or provides functionality to certain element types unable to function correctly without them. In HTML syntax, an attribute is added to an HTML start tag.

4 0
3 years ago
Question / UJU
DIA [1.3K]

Answer:

Option D: If it is the month of January, then the temperature is cool.

Explanation:

A conditional statement is the one having an if condition in it that says, if the condition is true proceed to the next statement, else not.

Given statements are:

  • If it is the month of January, then it is winter.

This can be written as: if (January)⇒Winter

  • If it is winter, then the temperature is cool.

This can be written as: if (winter)⇒ Temperature(cool)

So by combining both the statements, the winter clause will be connected  and we get:

if(January)⇒Temperature (cool)

This can be written as:

  • If it is the month of January, then the temperature is cool.

So, Option D is the correct answer.

i hope it will help you!

5 0
3 years ago
The following SQL is which type of join? SELECT CUSTOMER_T. CUSTOMER_ID, ORDER_T. CUSTOMER_ID, NAME, ORDER_ID FROM CUSTOMER_T,OR
Artist 52 [7]

Answer:

Self Join

Explanation:

Required

The type of JOIN

Notice that the given query joins the customer table and the order table without using the keyword join.

SQL queries that join tables without using the keyword is referred to as self join.

<em>Other types of join will indicate the "join type" in the query</em>

6 0
3 years ago
In C++ :
elena-s [515]

Answer::

//Program is written in C++ Programming Language

// Comments are used for explanatory purpose

#include

#include

#include

#include

using namespace std;

int main(){

ifstream file; // File stream object

string name; // To hold the file name

string inputLine; // To hold a line of input

int lines = 0; // Line counter

int lineNum = 1; // Line number to display

// Get the file name.

cout << "Enter the file name: ";

getline(cin, name);// Open the file.

file.open(name.c_str());// Test for errors.

if (!file){

// There was an error so display an error

// message and end the PROGRAM.

cout << "Error opening " << name << endl;

exit(EXIT_FAILURE);

}

// Read the contents of the file and display

// each line with a line number.

// Get a line from the file.

getline(file, inputLine, '\n');

while (!file.fail()){

// Display the line.

cout << setw(3) << right << lineNum<< ":" << inputLine << endl;

// Update the line DISPLAY COUNTER for the next line.

lineNum++;// Update the total line counter.

lines++;// If we've displayed the 24th line, pause the screen.

if (lines == 24){

cout << "Press ENTER to CONTINUE...";

cin.get();

lines = 0;

}

// Get a line from the file.

getline(file, inputLine, '\n');}

//Close the file.

file.close();

return 0;}

8 0
4 years ago
Other questions:
  • Your dad just purchased a new desktop with Windows 8 Professional. He is calling you, informing you that he is unable to remote
    9·1 answer
  • What Software is used to play,create, and modify audio and video files
    7·2 answers
  • Ray has to type an invoice using the QWERTY keyboard. Along with letters and numbers, he also has to insert the dollar sign. Whi
    13·1 answer
  • What should you do before cleaning the top of a storage battery and rinsing it with fresh water?
    12·1 answer
  • IN THE MOVIE BACK TO THE FUTURE 1985 IS 1985 THE PUBLICATION DATE?WHERE CAN I FIND THE MOVIE?
    6·1 answer
  • Letter Frequency Write a function that will take a string and return a count of each letter in the string. For example, "my dog
    5·1 answer
  • Ethics is a way of behaving so that you are
    7·2 answers
  • A large amount of scatter in a scatterplot is a indication that the association between the two variables is
    13·2 answers
  • What is the definition of posture<br>​
    7·1 answer
  • How many dog breed are there
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!