You are required to write a program that creates a mini database of HairColor objects..... For this, create a structure HairColor with fields brand – string color - string price - float totalVolume – float currentVolume – float // amount of volume currently available. You need to provide following functions in the struct   Provide a function print() so that when called, this function prints the details about the Hair color in formatted manner. IsAvailable(String Technique) which checks the volume of color in the bottle if available for the required technique then returns true otherwise false. isEmpty() this will check whether the bottle is empty or not. You need to provide the function apply (String technique). This function represents the action of applying hair color to hair based on technique user selects Techniques are (highlight, Bronde, Ombre, Sombre) also note down please check that the color is available because volume required for each type of technique is different as for highlight only 10ml of hair color bottle will be used, for bronde 100ml will be used, for ombre 50ml will be used, and for sombre 40ml will be used. If enough volume is available then color will be applied to the hair otherwise error message will be shown. Now create another class HairDresser having private members Name, Address and an array list of  HairColor. Provide appropriate constructors, getters, setters and to String method as well. Also provide addHairColor (HairColor c) which will add HairColor to the List and removeHairColor (String brand) which will remove that hair color form the list.   Now in the main class do the following Create HairColor objects and add them to list in Hairdresser class. Display all HairColors. Ask the user which color and technique she wants for her hair (highlight, Bronde, Ombre, Sombre). Check that enough color is available or not for the chosen technique then print only that hair color and the amount of volume consumed for the technique

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

You are required to write a program that creates a mini database of HairColor objects..... For this, create a structure HairColor with fields

  • brand – string
  • color - string
  • price - float
  • totalVolume – float
  • currentVolume – float // amount of volume currently available.

You need to provide following functions in the struct

 

  1. Provide a function print() so that when called, this function prints the details about the Hair color in formatted manner.
  2. IsAvailable(String Technique) which checks the volume of color in the bottle if available for the required technique then returns true otherwise false.
  3. isEmpty() this will check whether the bottle is empty or not.
  4. You need to provide the function apply (String technique).

This function represents the action of applying hair color to hair based on technique user selects Techniques are (highlight, Bronde, Ombre, Sombre) also note down please check that the color is available because volume required for each type of technique is different as for highlight only 10ml of hair color bottle will be used, for bronde 100ml will be used, for ombre 50ml will be used, and for sombre 40ml will be used. If enough volume is available then color will be applied to the hair otherwise error message will be shown.

Now create another class HairDresser having private members Name, Address and an array list of  HairColor.

Provide appropriate constructors, getters, setters and to String method as well.

Also provide addHairColor (HairColor c) which will add HairColor to the List and removeHairColor (String brand) which will remove that hair color form the list.

 

Now in the main class do the following

  1. Create HairColor objects and add them to list in Hairdresser class.
  2. Display all HairColors.
  3. Ask the user which color and technique she wants for her hair (highlight, Bronde, Ombre, Sombre). Check that enough color is available or not for the chosen technique then print only that hair color and the amount of volume consumed for the technique.
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY