answer.
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]
2 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]2 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
You would like to conduct a survey and ask your web page visitors to indicate the computer operating systems that they use. Each
Rudiy27

Answer:

<em>A. check box </em>

Explanation:

A check box, selection box, or tick box <em>is a small immersive box that the user can switch to demonstrate an affirmative or negative choice</em>.

It is often observed in applications and operating systems ' HTML input forms, dialog boxes, and GUIs.

A check mark appears inside the box when clicked to signify an affirmative (yes) option. The check mark will vanish when clicking again, suggesting a negative option (no).

6 0
2 years ago
Charlotte has set up a home maintenance service that operates out of her city. Workers commit to being available for certain hou
Vinvika [58]

Answer:

MAN

Explanation:

3 0
2 years ago
Which of the following represents the bus topology? Multiple Choice All devices are connected to a central device, called a hub.
Yanka [14]

Answer: All devices are connected to a central cable or backbone.

Explanation:

"All devices are connected to a central cable or backbone". Bus Topology refers to a logical or physical network's design. Bus Topology is also the network setup for a LAN (Local Area Network) nodes connected to a "backbone" or cable. The Bus setup connects every single computer and network to a single cable. Among others, the type of cable implemented for bus topology is usually a coaxial cable.

3 0
2 years ago
The budget process which emphasizes the achievement of goals and competition between alternatives is:
Maslowich

The question has multiple choices;


<span>A) </span>Incremental budgeting.
B) Performance budgeting.
C) Program budgeting.
D) Target based budgeting.


I’d say D is the answer; Target based budgeting


Target based budgeting focuses on the achievement of goals and competition. Prices in Target based budgeting are used as a tool to make or break sales. This method includes researching the markets to decide at what exact price a product will sell.






4 0
2 years ago
A network administrator is setting up a web server for a small advertising office and is concerned with data availability. The a
Aleksandr-060686 [28]

Answer:

RAID 1

Explanation:

RAID (Redundant Array of Inexpensive Disks or Drives, or Redundant Array of Independent Disks) is a data storage virtualisation technology that combines multiple physical disk drive components into one or more logical units for the purposes of data redundancy, performance improvement, or both.

RAID 1

Disk mirroring, also known as RAID 1, is the replication of data to two or more disks. Disk mirroring is a good choice for applications that require high performance and high availability, such as transnational applications, email and operating systems. Disk mirroring also works with solid state drives so “drive monitoring” may be a better term for contemporary storage systems.

8 0
2 years ago
Other questions:
  • If you’d like to have multiple italicized words in your document, how would you change the font of each of these words?
    7·2 answers
  • Becky is preparing a document for her environmental studies project. She wants to check her document for spelling and grammar er
    5·2 answers
  • Ben's team is working on an English project. The members want to see everyone's progress on their part of the project. What tech
    7·2 answers
  • Enter a formula in cell B10 to return a value of 35000 if the Net Profit After Tax (cell B9) is greater than or equal to 470000
    15·2 answers
  • QUESTION 2 of 10: New shoes are on SALE. You find a pair you like for $85 dollars. But you only have $45 with you. So, you pay $
    13·1 answer
  • A user calls the help desk and reports that the workstation, when powering up, displays error messages about an invalid system d
    8·1 answer
  • Information in​ folders, messages,​ memos, proposals,​ emails, graphics, electronic slide​ presentations, and even videos create
    7·1 answer
  • Assume that the population of Mexico is 128 million and that the population increases 1.01 percent annually. Assume that the pop
    7·1 answer
  • Write the definition of a function printAttitude, which has an int parameter and returns nothing. The function prints a message
    14·1 answer
  • To operate a vehicle in Florida, you must _____.
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!