Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Given the class Brand: public class Brand { private String name; / / The name of a brand of clothing that was purchased private String
Given the class Brand: public class Brand
private String name; The name of a brand of clothing that was purchased
private String gender; The person's gender that purchased the clothing
Sets name and gender to the specified values
public BrandString name, String gender
this.name name;
this.gender gender;
Returns the name of the brand of clothing that was purchased
public String getName
return name;
Returns the person's gender that purchased the clothing
public String getGender
return gender;
Returns a D array of Brand objects using the data from the specified text files
public static Brand createBrandsString namesFile, String gendersFile
String namesData FileReader.toStringArraynamesFile; String gendersData FileReader.toStringArraygendersFile;
Brand brandsData new BrandnamesDatalength;
for int index ; index brandsData.length; index
brandsDataindex new BrandnamesDataindex gendersDataindex;
return brandsData;
Within the class Fashion.java, write the method public int countByBrandsString gender which will calculate and return a D array containing the most common brands purchased by the parameter gender.
If the brand is US Polo", increment the value at index in the array by
If the brand is "GAP", increment the value at index in the array by
If the brand is "Kenneth Cole", increment the value at index in the array by
Otherwise, increment the value at index by
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