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
alisha [4.7K]
3 years ago
14

Write the interface (.h file) of a class ContestResult containing: An data member winner of type string, initialized to the empt

y string. An data member secondPlace of type string, initialized to the empty string. An data member thirdPlace of type string, initialized to the empty string. A member function called setWinner that has one parameter, whose value it assigns to the data member winner. A member function called setSecondPlace that has one parameter, whose value it assigns to the data member secondPlace. A member function called setThirdPlace that has one parameter, whose value it assigns to the data member thirdPlace. A member function called getWinner that has no parameters and that returns the value of the data member winner. A member function called getSecondPlace that has no parameters and that returns the value of the data member secondPlace. A member function called getThirdPlace that has no parameters and that returns the value of the data member thirdPlace.
Computers and Technology
1 answer:
egoroff_w [7]3 years ago
5 0

Answer:

#include <string>

using namespace std;

class ContestResult{

private:

string winner;

string secondPlace;

string thirdPlace;

public:

// default constructor to initialize with empty string

ContestResult();

void setWinner(string);

void setSecondPlace(string);

void setThirdPlace(string);

string getWinner();

string getSecondPlace();

string getThirdPlace();

};

#################### ContestResult.cpp ###################

#include <string>

#include "ContestResult.h"

using namespace std;

ContestResult::ContestResult(){

winner = "";

secondPlace = "";

thirdPlace = "";

}

void ContestResult::setWinner(string theWinner){

winner= theWinner;

}

void ContestResult::setSecondPlace(string theSecondPlace){

secondPlace= theSecondPlace;

}

void ContestResult::setThirdPlace(string theThirdPlace){

thirdPlace= theThirdPlace;

}

string ContestResult::getWinner(){

return winner;

}

string ContestResult::getSecondPlace(){

return secondPlace;

}

string ContestResult::getThirdPlace(){

return thirdPlace;

}

#################### ContestResultTest.cpp ###################

#include <string>

#include <iostream>

#include "ContestResult.h"

using namespace std;

int main(){

// creating object of ContestResult

ContestResult c;

// settinf all members

c.setWinner("The Legend");

c.setSecondPlace("Pravesh");

c.setThirdPlace("Alex");

cout<<"Winner: "<<c.getWinner()<<endl;

cout<<"Second Place: "<<c.getSecondPlace()<<endl;

cout<<"Third Place: "<<c.getThirdPlace()<<endl;

return 0;

}

Explanation:

See answer

You might be interested in
Write two sentences but each one having either computer in it or technology in it. You can use a word more than once in a senten
Ksju [112]

Answer:

Sentences:

1.My computer has a virus

2.Technology may take over the world someday

Explanation:

7 0
2 years ago
Read 2 more answers
According to the Modern Language Association (MLA) style guidelines, which citation is formatted correctly?
aalyn [17]
A) Marian Shelby. “The Fall of Rome.” Military Forces. n.p., 11 Mar 2009. Web.
14 Oct 2012.
4 0
3 years ago
Read 2 more answers
The SQL SELECT built-in function COUNT ____.
tia_tia [17]

The SQL SELECT built-in function COUNT none of the above options.

<h3>What is a SELECT query?</h3>

A select query is known to be a kind of a database object that depicts the information that is shown in Datasheet view.

Note that A query does not save data, it shows data that is saved in tables.  The SELECT statement is known to be one that is often used to select data from what we call a database.

Hence, The data returned is said to be saved in a result table, known to be the result-set.

Based on the above, the SQL SELECT built-in function COUNT none of the above options.

Learn more about  SQL SELECT from

brainly.com/question/10097523

#SPJ1

5 0
2 years ago
What will be the output of the following lines of code and the user's response?
Arte-miy333 [17]

Answer:

The answer is C. 85

Explanation:

The int() function is usually used to turn a float, to an int<em>.</em> When you use the int() function, it just cuts of everything past the decimal. It doesn't round the float. Leaving you with the option C. 85

hope this helped you :D

6 0
2 years ago
Della is a special education teacher. In her classroom, students may use many different types of utility programs to make it eas
Assoli18 [71]

Answer:

accessibility

Explanation:

Della is a special education teacher. In her classroom, students may use many different types of utility programs to make it easier for them to use their computers. This category of utility software is known as accessibility.

6 0
3 years ago
Read 2 more answers
Other questions:
  • Jackie is planning a birthday party for her little brother and is researching different trampoline parks. She receives a pop-up
    12·2 answers
  • Using the _____ model brings sellers and buyers together on the web and collects commissions on transactions between these parti
    5·1 answer
  • What is an example of a governmental influence ?
    9·2 answers
  • So, I have strict parents &amp; need help, if u don’t know how to fix this after u read it, leave. I don’t want u getting points
    11·2 answers
  • What cannot be performed using windows task manager
    10·1 answer
  • What type of account provides the same functions as managed service accounts but can be managed across multiple servers as in a
    8·1 answer
  • Match these step-by-step directions in the order that you will find them in this course.
    9·1 answer
  • Assume that you have the business data in various sources such as Excel, .csv, text files and Access, Oracle databases. Write th
    9·1 answer
  • You use a Windows desktop system to edit and produce audio files. Your system has two hard disks installed. Your applications ar
    10·1 answer
  • Which protocol is often used in conjunction with ipsec to provide a remote access client vpn with user authentication?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!