Write the contents of a specification file for a class named ContestResult that contains the following members: An data member winner of type string, initialized to the empty 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.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter10: Classes And Data Abstraction
Section: Chapter Questions
Problem 12SA: Assume the definition of class houseType as given in Exercise 11. Answer the following questions....
icon
Related questions
Question

Write the contents of a specification file for a class named ContestResult that contains the following members:

  • An data member winner of type string, initialized to the empty 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.
  •  
Expert Solution
Theory

A class is a group of objects which have common properties. 

A constructor is a method that is used to initialize objects.  It is called when an object of a class is created. 

trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning