Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE ANSWER IN PSEUDOCODE NOT JAVA 2. The Free People Store sells different makes of sweaters, such as cashmere and cotton sweaters. Each style of

PLEASE ANSWER IN PSEUDOCODE NOT JAVA

2. The Free People Store sells different makes of sweaters, such as cashmere and cotton sweaters. Each style of sweater is offered in different colors, such as brown and black. Available sweater sizes range from size 32 to size 44, 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 Sweater class that contains the style of the Sweater, the color of the sweaters, and the size. Examples of valid values for the style are "cashmere" and "cotton". Examples of valid values for the color are "brown" and "black". Examples of valid values for the size are 32 and 34.5. 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 sweaters.

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 sweaters.

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 Sweater class. The first object should be named nerdSweaters and use the default constructor. The second object should be named coolSweaters and use the second constructor to initialize the style to "cashmere", the color to "brown", and the size to 36. Include the following instructions in the main() method, in the order specified below:

i. A call to set the color of the nerdSweaters to "tan".

ii. A call to set the style of the nerdSweaters to cotton.

iii. A call to set the size of the nerdSweaters to 35.

iv. A statement that displays the style of the nerdSweaters, using the appropriate method call.

v. A call to change the color of the coolSweaters to "gold".

vi. A statement that displays the style of the coolSweaters, using the appropriate method call.

vii. A call for the coolSweaters object to the method that displays all the information about the sweaters.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2014 Nancy France September 15 19 2014 Proceedings Part 2 Lnai 8725

Authors: Toon Calders ,Floriana Esposito ,Eyke Hullermeier ,Rosa Meo

2014th Edition

3662448505, 978-3662448502

More Books

Students also viewed these Databases questions