Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Java Programming with Commented Code
A marketing research company has hired you to develop a program. Analytics Nation, Inc. has gathered information from about five different products. They would like to follow up with 1% of these households. Analytics Nation requires a third party to select 1% of the households for one of the products. Choices must be random.

Analytics Nation needs you to develop a program that uses a random number generator to identify 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:

Product 1 (mounth wash)
3,765 households

Product 2 (dental floss)
3,800 households

Product 3 (grass seed)
2,400 households

Product 4 (grass fertilizer)
4,012 households

Product 5 (Blue-Ray DVD unit)
3,580 households

Requirements:

Develop a program to select the households for follow up. The user will be prompted for their selection. The code will randomly select 1% of the households for one of the five products using the random method. Your code would generate numbers for 1% of the available household population. For example, there are 2,400 households on record for product 3. The households are individually numbered from 1 to 2,400. You need to generate 24 random numbers between 1-2,400. A table containing these numbers should be produced and printed to the screen. The table must not contain duplicates. Print 7 numbers 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 numbers 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 three you would set the generator range to 2,400 and generate random numbers for 1% (24) of the households. These numbers should range between 1 and 2,400:

number = (int) ( range * Math.random() ) + 1;

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9431401

Have any Question?


Related Questions in Computer Engineering

Part 1 if false change the incorrect parts to make them

Part 1, If false, change the incorrect parts to make them true. DO NOT NEGATE THE FALSE SENTENCES. 1. According to the weak-form efficient market hypothesis, investors can take advantage of historical information. 2. The ...

Need help with a java program that takes two arrays a and b

Need help with a Java program that takes two arrays a and b of length 5 storing int values, and returns the dot product of a and b. That is, it returns an array c of length n such that c[i]=a[i]*b[i].

Garber and skinner suggest that the large per capital

Garber and Skinner suggest that the large per capital health spending in the US (and relatively low returns to health) are due to productive and allocative inefficiencies. Which inefficiency (if either) do you think char ...

Systems analysis and design project 11 can you answer these

Systems analysis and design project 11: can you answer these 3 questions please 1. Design a generic test plan that describes the testing for an imaginary system. 2. Design a generic post-implementation evaluation form. T ...

A wholesale t-shirt company offers sizes small medium large

A wholesale T-shirt company offers sizes small, medium, large, and extra-large in organic or non-organic cotton and colors white, black, gray, blue, and red. How many different T-shirts are there to choose from?

Think about a good or service for which you believe there

Think about a good or service for which you believe there has been a shift in demand or supply. Explain the reasons behind the shift and how that has influenced the equilibrium price.

Represent each of the following values in the ieee 754

Represent each of the following values in the IEEE 754 32-bit format, truncating inexact values. Indicate the percent error of the value stored compared to the exact value. This will require you to convert the 32 bit flo ...

C programmingneed help with a c program arrayrearrangec

***C PROGRAMMING*** Need help with a C program array_rearrange.c that rearranges an integer array. The array will be split into two sets of integers one by one. A new array will be created by append the first set to the ...

Suppose that alices rsa parameters are ma91 ea7 and da31

Suppose that Alice's RSA parameters are m_A=91, e_A=7, and d_A=31. And suppose that Bob's RSA modulus is m_B=187. a)If Bob's public exponent is e_B=13 and Alice wants to encrypt the message signature pair (x, delta)=(70, ...

Question a small financial focused business is looking to

Question : A small, financial focused business is looking to organize and secure its network. It currently has a single public IP address from a local telecom. Construct an argument as to how you think a company should e ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As