Prachi K.

asked • 03/01/20

Write a class in C++

Create a class named Shirt that has the public data members collarsize and sleeveLength. Create a class named Pants that has the public data members waistSize and inSeam. Write a program that declares one object of each type Shirt and Pants and assigns values to the objects data fields. Write two overloaded functions named displayClothingFacts(). One version of the function takes a Shirt object as an argument; the other version takes a Pants object. Each version displays the facts about the piece of clothing. Your main() function should demonstrate that you can call displayClothingFacts() with either type of clothing.

1 Expert Answer

By:

Patrick B. answered • 03/02/20

Tutor
4.7 (31)

Math and computer tutor/teacher

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.