Question: Write C++ statements to define a class shoeType to store the characteristics of a pair of shoes such as ID (a string), size (double), width

Write C++ statements to define a class shoeType to store the characteristics of a pair of shoes such as ID (a string), size (double), width (char), style (string), and price. Include functions needed to print the shoe characteristics, set the shoe characteristics, and reset the shoe price (using keyboard input). Write the file shoeType.h, including all implementations of the functions of the class shoeType. Write a main program to declare objects of type shoeType, and test the operation of the class functions. In class on April 3, the following class definition and function were created, for class objects representing shoes for sale.

class shoeType

{

public:

void print( ) const;

void setAll(double, double, char, string, string);

void reSetPrice( );

//No parameters; will get keyboard input

shoeType( );

//default constructor

shoeType(double, double, char, string, string);

private:

double size;

double price;

char width;

string style;

tring ID;

};

void shoeType:: reSetPrice( )

{

double p;

cout << Current price: $ << price << endl;

cout << Enter new price: $;

cin >> p;

//Test input for validity before setting price equal to it.

if (p <= 0.0)

cout << Illegal value; price not changed. << endl;

else price = p;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!