subject

CSE 110 - Lab 6 - arrays Lab Topics • Learning how to use Array data types in Java Lab Problem: Array Data Types An array is a fixed-size container which stores a collection of values of the same type. In practice, collecting and managing multiple values in Java programs are very common operations. In this Lab, you will learn syntax of array in Java and some basic array operations. Part 1. Creating an Array and Filling in Values Say we are in CSE110 and the students are grouped into multiple groups. The TAs need a simple program to keep track of the distributions of grades in all groups. Your task is to design a program that can help the user key in the records (including group # and grade). Your program logic will look like the following steps: 1. Ask the user for one number as the size of an array, save it as numStudents 2. Create an int array by numStudents, save it as studentGroups 3. Create a double array by numStudents, save it as studentGrades 4. Create a for loop which iterates index i from 1 to numStudents, for each i a. Ask the user for an integer, save it at index i in studentGroups b. Ask the user for a double number (student grade), save it at index i in studentGrades 5. Print out the content in both arrays as shown in the sample output. Note: Make sure to complete Part 1 to practice arrays. The Part 2 is for those who like to practice more useful array operations. If you plan to do Part 2, you will need another variable to keep track of how many groups are there, which will be used in Part 2. (Hint: finding the maximum in input group numbers.) Part 2. Basic Statistics by Basic Arrays (Challenge) After finishing Part 1, you will have two arrays, in which you save students' group numbers and their grades. Please calculate two basic statics about students' grades in each group. Here we assume group numbers are consecutive and greater than 0. Hint 1: You might need two extra arrays, one for group sizes and one for group averages. Hint 2: By adding one more element to your array, the indices of arrays can be directly used to represent group numbers. Sample Output Below is an example of what your output should roughly look like when this lab is completed. The RED texts are user inputs. The BLUE texts are not required. How many students do you have? 5 [Group #] and [Grade] for Entry 1 1 10 [Group #] and [Grade] for Entry 2 2 10 [Group #] and [Grade] for Entry 3 27 [Group #] and [Grade] for Entry 4 1 5 [Group #] and [Grade] for Entry 5 38 List of Student Records Group 1 10.0 Points Group 2 10.0 Points Group 2 7.0 Points Group 1 5.0 Points Group 3 - 8.0 Points Group Statistics Group #1 has 2 students, average is 7.50 Group #2 has 2 students, average is 8.50 Group #3 has 1 students, average is 8.00

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 07:00
To produce a starlight effect in her photograph, lina should choose the filter for her camera.
Answers: 1
question
Computers and Technology, 23.06.2019 17:20
What is the best assassins creed game?
Answers: 2
question
Computers and Technology, 23.06.2019 19:30
2. fluorine and chlorine molecules are blamed fora trapping the sun's energyob forming acid rainoc producing smogod destroying ozone molecules
Answers: 2
question
Computers and Technology, 24.06.2019 09:30
Retype the statements, correcting the syntax errors. system.out.println("num: " + songnum); system.out.println(int songnum); system.out.println(songnum " songs"); note: these activities may test code with different test values. this activity will perform two tests: the first with songnum = 5, the second with songnum = 9. see how to use zybooks.
Answers: 1
You know the right answer?
CSE 110 - Lab 6 - arrays Lab Topics • Learning how to use Array data types in Java Lab Problem: Ar...
Questions
question
Social Studies, 09.10.2019 04:50
question
Mathematics, 09.10.2019 04:50
Questions on the website: 13722360