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
Execute the command to know which tcp/ip and udp/ip ports are in use in a system whose ip address is 14.102.98.40.
ddd [48]
I think it is command and the key letter I at the same time
4 0
3 years ago
You are able to drag a cell to a new location by pointing to the cell border until the pointer displays a _______ arrow, and the
ivann1987 [24]
I think its D, double-headed if I remember right. If this is brainiest can you mark it, please! I am trying to rank up. Thanks, hun!
7 0
3 years ago
Read 2 more answers
Sean is a computer programmer. He has programmed an application
Mila [183]

Answer:

im pretty sure the answer is B            Hope this helps :)

5 0
2 years ago
61. Select an activity of the Production Phase: a. a web authoring tool is often used b. the graphics, web pages, and other comp
Elodia [21]

Answer:

d. all of the above.

Explanation:

Since the advent of digital technology, production of goods and services have experienced a significant change from the traditional methods of production. This paradigm shift is made possible by the application of various modern technology.

Production processes are generally being facilitated and enhanced by the use of;

1. Computer-integrated manufacturing (CIM).

2. Computer-aided process planning (CAPP).

3. Computer-aided design (CAD).

4. Computer numerical control (CNC).

In the process of selecting an activity of the production phase:

1. A web authoring tool is often used.

2. The graphics, web pages, and other components are created.

3. The web pages are individually tested.

7 0
3 years ago
A service that enables a customer to build and run their own applications but doesn't include extensive access to hardware and m
Musya8 [376]

There are a lot of computer apps. A service that enables a customer to build and run their own applications but doesn't include extensive access to hardware and middleware is PaaS.

<h3>What is PaaS?</h3>

This is known to be one that helps user to install and run their own application on any kind of vendor-supplied hardware and system software.

The Platform-as-a-Service, is said to be a cloud computing model that gives customers a full cloud platform such as hardware, software, and infrastructure that is used for creating, running, and handling applications.

Learn more about PaaS from

brainly.com/question/14364696

8 0
2 years ago
Other questions:
  • Legal counsel has notified the information security manager of a legal matter that will require the preservation of electronic r
    8·1 answer
  • What is the maximum number of columns in a spreadsheet that you can sort in one instance in software like OpenOffice Calc?
    7·2 answers
  • Individuals with desirable traits will be __________ to have young that survive than individuals without these traits. (2 points
    5·2 answers
  • What is the definition of digital literacy?
    7·2 answers
  • Suppose you are given a relation emp(empid, dept, salary) and wish to maintain a materialized view deptsalary(dept, totalsalary)
    10·1 answer
  • Write a program in C/C++ to draw the following points: (0.0,0.0), (20.0,0.0), (20.0,20.0), (0.0,20.0) and (10.0,25.0). For this
    6·1 answer
  • How would you design an adaptive environment for people who are blind?
    10·1 answer
  • when you sent email your email can be set to automatically keep a copy where do you find these copies​
    13·1 answer
  • Help guys thank you =) ​
    7·1 answer
  • 30 POINTS PLS HELLLLPPP WILL GIVE BRAINLIEST What behavior do elements in a stack follow? first in, last out, or FILO behavior l
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!