Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java Crayon name : String- color: String Crayon + (Crayon (n: String, c : String + setName(n : String): void + setColor(c : String): void

java image text in transcribed
image text in transcribed
Crayon name : String- color: String Crayon + (Crayon (n: String, c : String + setName(n : String): void + setColor(c : String): void + getName():String + getColor():String + Write a class declaration for Crayon class and add the two variables to the class declaration-1 .name: This field is a String variable that holds the crayon's name color: This field is a String variable that holds the crayon's color The class should have the following constructors-2 A constructor that accepts the following value as argument and assigns it to the appropriate fields: name and color A no-arg constructor that assigns an empty strings ("") to the name, and an empty strings ("") to .the color field Write mutator methods that store values in these fields and accessor methods that return the values in-3 these fields as in above UML diagram Once you have written the class, write a separate program that creates two Crayon objects to hold the 4 following data Once you have written the class, write a separate program that creates two Crayon objects to hold the -4 following data name color Yellow Canary Grey Manatee . > III III T (12pt) 3 Arial TTT 0:5

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

Database Design And Relational Theory Normal Forms And All That Jazz

Authors: Chris Date

1st Edition

1449328016, 978-1449328016

More Books

Students also viewed these Databases questions

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago