Explain java programming with commented code

Assignment Help Computer Engineering
Reference no: EM13141244

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;

Reference no: EM13141244

Questions Cloud

Risk of material misstatement in the expenditure cycle : What other factor might influence the risk of material misstatement in the expenditure cycle?
Explain devise a signal conditioning system : Devise a signal conditioning system that will provide an appropriate digital output to a computer. Specify the requirements on the ADC and appropriate analog conditioning to interface your ADC.
Calculate the increase in entropy : Calculate the increase in entropy when 3.50 mol of monatomic perfect gas with Cp = 5/2 R is heated  from 250 K to 700 K and simultaneously expand from 20.0 L to 60.0 L.
Research the concepts : Research the concepts of credit risk and credit scoring in determining whether a financial institution should lend at an appropriate level of risk or not lend to a loan application.
Explain java programming with commented code : 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.
Problem related to marginal tax rate for firm : For the year ending June 30, 2008, the Austin Corporation has current assets of $ 275,000 and total assets of $ 900,000. It also has current liabilities of $ 150,000, equity of $ 200,000, and retained earnings of $ 100,000. The marginal tax rate f..
What is the likely that the negotiations wi end successfully : after a one hour stand-off, what is the likelihood (in percentages) that the negotiation will end successfully? After four hours? After eight hours?
Define a sinusoidal voltage has a maximum value : A sinusoidal voltage has a maximum value of 100V, and the value is 10V at t=0. The period is T=1ms. Determine v(t)
Stock repurchase announcement : If management estimates that a stock repurchase announcement will increase stock price by 5 percent, how many shares should they be prepared to repurchase?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Selecting the operating system

What operating system must the library consider for this facility? And also explain why?

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Access time and cache miss

Explain the access time when there is a cache miss? Suppose that the cache waits till the line has been fetched from the main memory and then re-executes for a hit.

  Make a database in ms access

create a database in MS Access and a set of reports to support a business . The following business rules should be addressed.

  Structured query language

Structured Query Language (SQL) refers to the accepted non-procedural language used in order to communicate with all the relational databases.

  General approach is to encourage timely communication news

The general approach is to encourage timely communication of news (positive or negative) to project stakeholders. However, can you envisage situations where it may be required , or even advantageous, for project management to suppress the dissemin..

  Illustrate a 4-d hypercube network

Illustrate a 4-D hypercube network

  Commercial ids systems

Utilizing the Internet, search for the commercial IDS systems. What are the classification systems and descriptions are used.

  Define problem with criteria range

problem with criteria range. I do not know how to set two different criterias in one column. I need to ADVANCE FILTER all of the Clerks (1 and 2) and the Sect. 1 workers who create more than $5.50/hr. I do not understand how to set the title crite..

  Developing countermeasures against dos attacks

Explain whether the administrators of server systems still have to be concerned about, and take the further countermeasures against DoS attacks, if so, what kinds of attacks may still happen, and what measures can be taken in order to decrease the..

  Write down c program that has declaration in main() to store

Modify this display() function to alter the address in channels. Always use the expression *channels rather than *(channels + i) to retrieve the right elements.

  Estimating the running time of quicksort

The running time of quicksort may be improved in practice by taking the benefit of the fast running time of the insertion sort when its input is "nearly" sorted.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd