It is an easy java practice( see the attachment).Objectives: To learn to – declare and initialize…

It is an easy java practice( see the attachment).Objectives: To learn to – declare and initialize arrays – process each array element individually – process array elements using a for loop – pass array reference to a method Tasks: Create a Java project called BCS345hw2 and use the default package for it. In the BCS345hw2.java, write statements to complete the following two tasks. Task 1 Write code to simulate rolling a six-sided die. A six-sided die has the values 1-6 on its faces. The program first asks user for the number of rolls and then rolls the die for the specified times. The program

It is an easy java practice( see the attachment).Objectives: To learn to – declare and initialize arrays – process each array element individually – process array elements using a for loop – pass array reference to a method Tasks: Create a Java project called BCS345hw2 and use the default package for it. In the BCS345hw2.java, write statements to complete the following two tasks. Task 1 Write code to simulate rolling a six-sided die. A six-sided die has the values 1-6 on its faces. The program first asks user for the number of rolls and then rolls the die for the specified times. The program displays the face values, the number of occurrences of each value, and the frequency of each value in a neat tabular format. Use an int array to store the number of occurrences of 6 values and a double array to store the frequency of 6 values. Display 5 decimal places for floating-point values. Hints: use java.util.Random class to generate random numbers to simulate rolling a dice (see Chapter 4 Lecture Slides page XXXXXXXXXXTask 2 Use a two-dimensional array to solve the following application problem: A company has four salespeople (1 to 4) who sell five different products (1 to 5). The data file hw2data.txt contains all salespeoples sales information for five products for last month. Each row represents a particular product and each column represents a salesperson. Write an application that will read all this information from the file, display the raw data on the screen, process the data, and summarize the following information: 1) The total sales by product. 2) The total sales by salesperson. 3) The highest sales by product. 4) The highest sales by salesperson. 5) The total sales by all salesperson for last month. After processing all the information, display the results in a neat tabular format, with each column representing a salesperson and each row representing a particular product. Display the total sales by product and the highest sales by product to the right of the rows and display the total sales by salesperson and the highest sales by salesperson to the bottom of the columns. You must write the following six methods and call them in Task 2. 1. printArray. This method should accept a two-dimensional array as its argument and display the contents of the array on the screen. The header of the method is: public static void printArray(double[][] array) 2. getTotal. This method should accept a two-dimensional array as its argument and return the total of all the values in the array. The header of the method is: public static double getTotal(double[][] array) 3. getRowTotal. This method should accept a two-dimensional array as its first argument and an integer as its second argument. The second argument is the subscript of a row in the array. The method should return the total of the values in the specified row of the array. The header of the method is: public static double getRowTotal(double[][] array, int row) 4. getColumnTotal. This method should accept a two-dimensional array as its first argument and an integer as its second argument. The second argument is the subscript of a column in the array. The method should return the total of the values in the specified column. The header of the method is: public static double getColumnTotal(double[][] array, int col) 5. getHighestInRow. This method should accept a two-dimensional array as its first argument and an integer as its second argument. The second argument is the subscript of a row in the array. The method should return the highest value in the specified row of the array. 6. getHighestInColumn. This method should accept a two-dimensional array as its first argument and an integer as its second argument. The second argument is the subscript of a column in the array. The method should return the highest value in the specified column of the array. Hints: Consider using 4 double arrays to store total sales for each person, total sales for each product, the highest sales for each person, and the highest sales for each product. Please refer to Topic 6 Arrays lecture slides for examples of processing two-dimensional arrays. To create a text file and place it in your project folder: In NetBeans, right click on the BCS345hw2 project name in the left sidebar, choose New – other. Select Other in the Categories window and select Empty File in the File Types window. Click Next. Name the file as hw2data.txt and click Finish. The data file hw2data.txt will be created and located in your BCS345hw2 project folder. Copy and paste the following data into hw2data.txt and save the file: XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXXSubmission: Submit your source code file on Blackboard, not the whole project. The file name must be BCS345hw2.java. Be sure to include the integrity statement I certify that this submission is my own original work with your name in your source file.

Custom Paper Help
Calculate your paper price
Pages (550 words)
Approximate price: -

Why Work with Us

Top Quality and Well-Researched Papers

We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university or professional, and we will assign a writer who has a respective degree.

Professional and Experienced Academic Writers

We have a team of professional writers with experience in academic and business writing. Many are native speakers and able to perform any task for which you need help.

Free Unlimited Revisions

If you think we missed something, send your order for a free revision. You have 10 days to submit the order for review after you have received the final document. You can do this yourself after logging into your personal account or by contacting our support.

Prompt Delivery and 100% Money-Back-Guarantee

All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.

Original & Confidential

We use several writing tools checks to ensure that all documents you receive are free from plagiarism. Our editors carefully review all quotations in the text. We also promise maximum confidentiality in all of our services.

24/7 Customer Support

Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.

Try it now!

Calculate the price of your order

Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Services

No need to work on your paper at night. Sleep tight, we will cover your back. We offer all kinds of writing services.

Essays

Essay Writing Service

No matter what kind of academic paper you need and how urgent you need it, you are welcome to choose your academic level and the type of your paper at an affordable price. We take care of all your paper needs and give a 24/7 customer care support system.

Admissions

Admission Essays & Business Writing Help

An admission essay is an essay or other written statement by a candidate, often a potential student enrolling in a college, university, or graduate school. You can be rest assurred that through our service we will write the best admission essay for you.

Reviews

Editing Support

Our academic writers and editors make the necessary changes to your paper so that it is polished. We also format your document by correctly quoting the sources and creating reference lists in the formats APA, Harvard, MLA, Chicago / Turabian.

Reviews

Revision Support

If you think your paper could be improved, you can request a review. In this case, your paper will be checked by the writer or assigned to an editor. You can use this option as many times as you see fit. This is free because we want you to be completely satisfied with the service offered.