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, 22.06.2019 06:00
What role do chromosomes play in inheritance?
Answers: 1
question
Computers and Technology, 23.06.2019 12:00
Using the list, you can select the number of photos that will appear on each slide. a. theme b. frame shape c. pictures in album d. picture layout
Answers: 1
question
Computers and Technology, 23.06.2019 15:00
To check whether your writing is clear , you can
Answers: 2
question
Computers and Technology, 24.06.2019 10:40
Joe needs to see the slide transitions and animations he has applied to his slides in a large view. which presentation view should he use? in which tab would joe find the animations option to make further changes, if any?
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
Mathematics, 05.11.2020 01:00
question
Physics, 05.11.2020 01:00
question
English, 05.11.2020 01:00
question
Mathematics, 05.11.2020 01:00
question
Social Studies, 05.11.2020 01:00
question
Physics, 05.11.2020 01:00
question
Mathematics, 05.11.2020 01:00
question
Mathematics, 05.11.2020 01:00
question
World Languages, 05.11.2020 01:00
question
Mathematics, 05.11.2020 01:00
Questions on the website: 13722367