Question

Showy Shiny Shoe Store The Showy Shiny Shoe Store sells different styles of shoes, such as...

Showy Shiny Shoe Store 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: Create a class diagram (a UML diagram) 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: A default constructor that initializes each attribute to some reasonable default value for non-existent shoes. 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. Accessor and mutator methods for each attribute. A method that displays all the data about the shoes. Note, if you are using ArgoUML for the diagram, make sure you use the template. First, download the template, then resave it with a different file name. The template can be found on the main page of this module. For your convenience, you may download it here. ClassDiagramTemplate.zargo Also note, ArgoUML does not have undo feature, please save often. Add a class diagram (a UML diagram) for the application (the one with a main function) to the one you created for the part The application program for the shoe store with a main() module will instantiate 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: A call to set the color of the nerdShoes to "tan". A call to set the style of the nerdShoes to “walking”. A call to set the size of the nerdShoes to 9.5. A statement that displays the style of the nerdShoes, using the appropriate method call. A call to change the color of the coolShoes to "purple". A statement that displays the style of the coolShoes, using the appropriate method call. A call for the coolShoes object to the method that displays all the information about the shoes Write the pseudocode or Java programs base on the UML diagrams you created above. You need to write two programs - a class program and an application program. If you are using Java, do not submit the bytecode - in .class format. Files and file formats: The UML diagram (due the Friday of the first week) file format: .zargo, .docx, .jpg, .png The Class program either pseudocode or Java (due the Friday of the second week) file format: .zip The application program either pseudocode or Java (due the Friday of the second week) file format: .zip

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Dear Student,

I have created shoes class and Driver class.

Shoe class has attributes, it is a class program as per your convention

driver class is an application program. I have written code provided adequate comments for your understanding.

I have created a UML diagram in eclipse, as the question indicates that we may use any tool for generating UML.

In eclipse editor, you can install ObjectAid UML explorer. You can select the java files and generate UML diagram. I am pasting the code, output and UML diagram below. Please refer them,

I have developed a code for all the requirements.

Please use any editor for testing the code

Let me know if you find any difficulties in understanding.

-------------------------------------------------------------------------------

package wearable;

//shoes class which has all attributes and logic
public class Shoes {

   //attributes
   private String style;
   private String color;
   private double size;

   //Default constructor
   public Shoes() {
       this.style = "No Style";//default values
       this.color = "No Color";
       this.size = 0;
   }
   //constructor with paramaters
   public Shoes(String style, String color, double size) {
       this.style = style;
       this.color = color;
       this.size = size;
   }

   @Override// to print data of the object
   public String toString() {
       return "Shoe Details: [style=" + style + ", color=" + color + ", size=" + size + "]";
   }
  
   //Accessor and mutator methods for all attribute
   public String getStyle() {
       return style;
   }

   public void setStyle(String style) {
       this.style = style;
   }

   public String getColor() {
       return color;
   }

   public void setColor(String color) {
       this.color = color;
   }

   public double getSize() {
       return size;
   }

   public void setSize(double size) {
       this.size = size;
   }

}
-----------------------------

package wearable;
//application program as mentioned in the question. This is for manipulating and using shoes objects
public class Driver {

   public static void main(String[] args) {
       //creation of objects
       Shoes nerdShoes=new Shoes();
      
       Shoes coolShoes =new Shoes("sandals","brown",8.5);

       //setting values for nerdShoes object
       nerdShoes.setColor("tan");
       nerdShoes.setStyle("walking");
       nerdShoes.setSize(9.5);
       System.out.println("nerd shoes style: "+nerdShoes.getStyle());
      
       coolShoes.setColor("purple");
       System.out.println("cool shoes style: "+coolShoes.getStyle());
      
       //this will call toString method in the shoes class. Print coolShoes object details
       System.out.println(coolShoes);

      
   }
}
--------------------------------------------

Add a comment
Know the answer?
Add Answer to:
Showy Shiny Shoe Store The Showy Shiny Shoe Store sells different styles of shoes, such as...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • MAKE IT DIFFERENT WAYS TO RUN IT: Design an application for each of the following problems...

    MAKE IT DIFFERENT WAYS TO RUN IT: Design an application for each of the following problems writing the pseudocode for each; include a UML diagram if appropriate. Be sure to follow the CSI 117 Style Criteria for naming conventions, class diagrams, pseudocode, keywords, and operators. 1. Wood Trim, Inc. wants a program that will allow its sales clerks to enter the length (in feet) of the trim ordered by a customer and the price of one foot of trim. Design...

  • The Drive‑Rite Insurance Company provides automobile insurance policies for drivers. Design a single class diagram showing...

    The Drive‑Rite Insurance Company provides automobile insurance policies for drivers. Design a single class diagram showing the class, the application program, the relationship between the two, and multiplicity. Insert the completed class diagram into a Word document. Then write the pseudocode as described below. Be sure to follow the CSI 117 Style Criteria (Links to an external site.)Links to an external site. for naming conventions, class diagrams, pseudocode, keywords, and operators. a.      Create a PolicyHolder class that contains a policy number,...

  • Create a class named BankAccount with data fields for a count number and a balance. Include...

    Create a class named BankAccount with data fields for a count number and a balance. Include a constructor that takes arguments for each field. The constructor sets the balance to 0 if it is below the required $200.00 minimum for an account. Include a method that displays the account details, including an explanation if the balance was reduced to 0. Write the class TestAccount in which you instantiate two BankAccount objects, prompt a user for values of the account number...

  • for Java define a class for a triangle of any size: including two constructors 1) default...

    for Java define a class for a triangle of any size: including two constructors 1) default color 2) accepts 3 parameters (don't forget set and get methods) and include a method for the area of the triangle create a driver program that instantiates two triangles: 1) using the default color 2) using the second constructor sketch the UML diagram

  • Java Programming assignment. 1. Create a class called Square that takes a width parameter in the...

    Java Programming assignment. 1. Create a class called Square that takes a width parameter in the constructor. The Square class should have a draw() method that will draw the square on the screen. Create a class called TestSquare that will take width from the user, create an object of Square, and invoke the draw() method on the square object. Below is a UML diagram for the Square and Rectangle class: 3. Create a zip file that contains your Java programs....

  • I need help writing my main method**** Computer Science 111 Introduction to Algorithms and Programming: Java...

    I need help writing my main method**** Computer Science 111 Introduction to Algorithms and Programming: Java Programming Project #4 – Classes and Objects (20 Points) You will create 3 new classes for this project, two will be chosen from the list below and one will be an entirely new class you invent.Here is the list: Shirt Shoe Wine Book Song Bicycle VideoGame Plant Car FootBall Boat Computer WebSite Movie Beer Pants TVShow MotorCycle Design First Create three (3) UML diagrams...

  • [Continued] Your Course class should have: 1)a getter for the course 'code', so that it is...

    [Continued] Your Course class should have: 1)a getter for the course 'code', so that it is read-only; 2)a getter and setter for the lecturer attribute, so that it is readable and writable; 3)a constructor that creates the associations shown in the UML diagram; 4)an enrolStudent method that adds a given Student object into the 'enrolled' set; 5)a withdrawStudent method that removes a given Student object from the 'enrolled' set and returns true if the student was successfully found and removed,...

  • Assignment Requirements I have also attached a Class Diagram that describes the hierarchy of the inheritance...

    Assignment Requirements I have also attached a Class Diagram that describes the hierarchy of the inheritance and interface behaviors . The link to the PDF of the diagram is below MotorVehical.pdf Minimize File Preview User Define Object Assignment: Create a Intellij Project. The Intellij project will contain three user defined classes. The project will test two of the User Define Classes by using the invoking each of their methods and printing the results. You are required to create three UML...

  • Java Project Requirements: Account class Superclass Instance variables clearPassword String Must be at least 8 characters...

    Java Project Requirements: Account class Superclass Instance variables clearPassword String Must be at least 8 characters long encryptedPassword : String key int Must be between 1 and 10(inclusive) accountId - A unique integer that identifies each account nextIDNum – a static int that starts at 1000 and is used to generate the accountID no other instance variables needed. Default constructor – set all instance variables to a default value. Parameterized constructor Takes in clearPassword, key. Calls encrypt method to create...

  • Computer Science 111 Introduction to Algorithms and Programming: Java Programming Net Beans Project #4 - Classes...

    Computer Science 111 Introduction to Algorithms and Programming: Java Programming Net Beans Project #4 - Classes and Objects (15 Points) You will create 3 new classes for this project, two will be chosen (THE TWO CHOSEN ARE TENNIS SHOE AND TREE) from the list below and one will be an entirely new class you invent. Here is the list: Cellphone Clothes JuiceDrink Book MusicBand Bike GameConsole Tree Automobile Baseball MusicPlayer Laptop TennisShoe Cartoon EnergyDrink TabletComputer RealityShow HalloweenCostume Design First Create...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT