You have been hired to produce a report for a marketing research company.
Yellow Bird Marketing, Inc. has collected information from across the country regarding five different products.
They would like to follow up with 1% of these households.
Yellow Bird needs a third party to choose 1% of the households for one of the products.
Choices must be random.
You have been hired by Yellow Bird to develop a program that will use a random number generator to select 1% of the households for one product.
Each household is mapped to a unique number ranging from 1 to the number of households as listed below.
Choose one product from the following:
1. Product 1 (toothpaste) 37,650 households
2. Product 2 (vacuum cleaner) 38,135 households
3. Product 3 (motor oil) 36,785 households
4. Product 4 (grass seed) 40,125 households
5.Product 5 (television remote) 35,790 households
Requirements: Develop a program to select the households for follow up. Choose your product.
Create your code to randomly select 1% of the households for one of the five products.
You must use the random method.
Your code would generate houseHoldNumbers for 1% of the available household population.
For example, there are 37,650 households for product one.
The households are individually numbered from 1 to 37,650.
You need to generate 376 random houseHoldNumbers between 1-37,650.
A table containing these houseHoldNumbers should be produced and printed to the screen.
The table must not contain duplicates. Print 10 houseHoldNumbers per row.
You need to use at least one repetition statement, at least one array and the random method in this code.
For generating random houseHoldNumbers you should use the random() static method of class Math.
It returns a double so you will need to cast it as an integer.
If you chose product 1 you would set the generator numberOfHouseHolds to 37,650 and generate random houseHoldNumbers for 1% (376) of the households.