Question
JAVA PROGRAMMING: Create a class. Create three methods, all called calculateClothesPrice. The first is just for shirts. It has only one parameter that represents the
JAVA PROGRAMMING:
Create a class. Create three methods, all called calculateClothesPrice. The first is just for shirts. It has only one parameter that represents the number of shirts a customer is ready to purchase. Calculate the total cost and return this value. (To do this, you will first have to decide on the price of a shirt. Use a named constant for this.) The second method has two parameters. The first is the number of shirts, and the second is the number of pairs of pants. (Again, for this method, you have to assign a price for a pair of pants.) And, like the first method, you have to return the total price. The third method has three parameters, the number of shirts, the number of pairs of pants, and the number of sweaters. Create this method in a way similar to the other two, and return the total price. Create appropriate test data. Show that your program is correct by demonstrating that your program produces the same results that your hand calculations predict.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started