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
You are required to write a program that creates a mini
- 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.
Step by step
Solved in 2 steps with 1 images