Question
2. The Showy Shiny Shoe Store sells different styles of shoes, such as sandals and walking shoes. Each style of shoe is offered in different
2. The Showy Shiny Shoe Store sells different styles of shoes, such as sandals and walking shoes. Each style of shoe is offered in different colors, such as brown and black. Available shoe sizes range from size 5 to size 11, in both whole and half sizes. Design an object-oriented computer program by doing the following:
a. Create the class diagram and pseudocode for the Shoes class that contains the style of the shoes, the color of the shoes, and the size. Examples of valid values for the style are "sandals" and "walking". Examples of valid values for the color are "brown" and "black". Examples of valid values for the size are 6.5 and 9.0. Be sure to choose the most appropriate data type for the attributes. For this class definition, include the following:
i. A default constructor that initializes each attribute to some reasonable default value for non-existent shoes.
ii. Another constructor method that has a parameter for each data member. This constructor initializes each attribute to the value provided when an object of this type is instantiated.
iii. Accessor and mutator methods for each attribute.
iv. A method that displays all the data about the shoes.
b. Add a class diagram for the application to the one you created for part a above, add the correct relationship and multiplicity, and insert the completed diagram immediately before the pseudocode for this problem in the Word document. Write the pseudocode for the application program for the shoe store with a main() module that instantiates two objects of the Shoes class. The first object should be named nerdShoes and use the default constructor. The second object should be named coolShoes and use the second constructor to initialize the style to "sandals", the color to "brown", and the size to 8.5. Include the following instructions in the main() method, in the order specified below:
i. A call to set the color of the nerdShoes to "tan".
ii. A call to set the style of the nerdShoes to walking.
iii. A call to set the size of the nerdShoes to 9.5.
iv. A statement that displays the style of the nerdShoes, using the appropriate method call.
v. A call to change the color of the coolShoes to "purple".
vi. A statement that displays the style of the coolShoes, using the appropriate method call.
vii. A call for the coolShoes object to the method that displays all the information about the shoes.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started