Does my java code correct and follow all of the criteria

Assignment Help Business Management
Reference no: EM132337597

Question

Does my java code correct and follow all of the criteria? Could you include a class diagram for reference as well. (mine has errors)

If anything is wrong please let me know what I am missing and how i can fix it, Thanks!

The Dress Barn Company sells different dresses, such as spring and winter dresses. Each style of dress is offered in different colors, such as blue and red. Available dress sizes range from 0 to 14. Design an object-oriented computer program by doing the following:

Create the Java for the dress class that contains the style of the dress, the color of the dress, and the size. Examples of valid values for the style are "lace" and "sweater". Examples of valid values for the color are "blue" and "black". Examples of valid values for the size are 0 and 8. 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 the dresses.

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

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.

b. Creat a main application

Write the Javafor the application program for the coat store with a main() module that instantiates two objects of the Dress class.

The first object should be named winterDress and use the default constructor.  2. The second object should be named springDress and use the second constructor to initialize the style to "lace", the color to "green", and the size to 12. Include the following instructions in the main() method, in the order specified below

A call to set the color of the winterDress to "yellow".

A call to set the style of the winterDress" to "sweater".

A call to set the size of the winterDress to 6.

A Statement that displays the style of the springDress, using the appropriate method call.

A call to change the color of the winterDress to "green".

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

A call for the winterDress object to the method that displays all the information about the dress.

class Dress{

  //Attributes

  private String style;

  private String color;

  private int size;

  //constuctor

  public Dress(){

   style="";

   color="";

   size=0;

  }

  public Dress(String newStyle,String newColor,int newSize){

   style=newStyle;

   color=newColor;

   size=newSize;

  }

 

  //Getters

  public String getStyle(){

   return style;

  }

  public String getColor(){

   return color;

  }

  public int getSize(){

   return size;

  }

  //Setters

  public void setStyle(String newStyle){

   style=newStyle;

  }

  public void setColor(String newColor){

   color=newColor;

  }

  public void setSize(int newSize){

   if(newSize>0){

     size=newSize;

   }

   else{

    System.out.println(newSize+" is invalid size.");

    size=0;

   }

  }

  //to string method

  public String toString(){

   return style+" dress, Color of the dress: "+color+", Size of the dress: "+size;

  }

}

 

DressProgram.java

 

class DressProgram{

public static void main(String[] args){

   //1. The first object should be named winterDress and use the default constructor.

   Dress winterDress=new Dress();

   //2. The second object should be named springDress and use the second constructor to initialize the style to "lace", the color to "green", and the size to 12

   Dress springDress=new Dress("lace","green",12);

   //A call to set the color of the winterDress to "yellow".

   winterDress.setColor("Yellow");

   // A call to set the style of the winterDress to "sweater".

   winterDress.setStyle("sweater");

   // A call to set the size of the winterDress to 6.

   winterDress.setSize(6);

  // A Statement that displays the style of the springDress, using the appropriate method call.

  System.out.println(springDress.getStyle()+" dress");

  //A call to change the color of the winterDress to "green".

  winterDress.setColor("green");

  // A statement that displays the style of the winterDress, using the appropriate method call.

   System.out.println(winterDress.getStyle()+" dress");

   //A call for the winterDress object to the method that displays all the information about the dress.

   System.out.println(winterDress);

}

}

Reference no: EM132337597

Questions Cloud

Architecture models of health information exchange : Discuss the advantages and disadvantages of each and the role data ownership plays in each model. Your initial post should include credible/peer-review APA.
Identify the name of the wizard : Choose a design wizard; write observations below as you work through the process of using it to prepare for the initial post.
Implement the spell checker and the hash table : Using classes SpellChecker and HashTable to implement the spell checker and the hash table, respectively
Wilson definition of process of hyperghettoization : What is Wacquant and Wilson's definition of a "process of hyperghettoization"? what is the "class structure" of ghetto neighborhoods?
Does my java code correct and follow all of the criteria : Does my java code correct and follow all of the criteria? Could you include a class diagram for reference as well. (mine has errors)
Mention the seven layers of the osi stack : a. Mention the seven layers of the OSI stack, and describe the basic function of each layer.
Evaluate the clients current situation and identify issues : FNSFPL502 - Conduct financial planning analysis - Mentor Education - develop a Research Report for the practical client situation described in the case study
Computerized on-board diagnostic system : Yin made some readings about the Internet of Things and is concerned that his technicians might have to deal with devices.
Write a brief profile of your chosen organisation : Business Strategy Assignment - TNA67 Pearson BTEC HND in Business (RQF), ICON College of Technology and Management, UK

Reviews

Write a Review

Business Management Questions & Answers

  Caselet on michael porter’s value chain management

The assignment in management is a two part assignment dealing 1.Theory of function of management. 2. Operations and Controlling.

  Mountain man brewing company

Mountain Man Brewing, a family owned business where Chris Prangel, the son of the president joins. Due to increase in the preference for light beer drinkers, Chris Prangel wants to introduce light beer version in Mountain Man. An analysis into the la..

  Mountain man brewing company

Mountain Man Brewing, a family owned business where Chris Prangel, the son of the president joins. An analysis into the launch of Mountain Man Light over the present Mountain Man Lager.

  Analysis of the case using the doing ethics technique

Analysis of the case using the Doing Ethics Technique (DET). Analysis of the ethical issue(s) from the perspective of an ICT professional, using the ACS Code of  Conduct and properly relating clauses from the ACS Code of Conduct to the ethical issue.

  Affiliations and partnerships

Affiliations and partnerships are frequently used to reach a larger local audience? Which options stand to avail for the Hotel manager and what problems do these pose.

  Innovation-friendly regulations

What influence (if any) can organizations exercise to encourage ‘innovation-friendly' regulations?

  Effect of regional and corporate cultural issues

Present your findings as a group powerpoint with an audio file. In addition individually write up your own conclusions as to the effects of regional cultural issues on the corporate organisational culture of this multinational company as it conducts ..

  Structure of business plan

This assignment shows a structure of business plan. The task is to write a business plane about a Diet Shop.

  Identify the purposes of different types of organisations

Identify the purposes of different types of organisations.

  Entrepreneur case study for analysis

Entrepreneur Case Study for Analysis. Analyze Robin Wolaner's suitability to be an entrepreneur

  Forecasting and business analysis

This problem requires you to apply your cross-sectional analysis skills to a real cross-sectional data set with the goal of answering a specific research question.

  Educational instructional leadership

Prepare a major handout on the key principles of instructional leadership

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd