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 00:40
Consider the following statements: struct nametype{string first; string last; }; struct coursetype{string name; int callnum; int credits; char grade; }; struct studenttype{nametype name; double gpa; coursetype course; }; studenttype student; studenttype classlist[100]; coursetype course; nametype name; mark the following statements as valid or invalid. if a statement is invalid, explain why.a.) student.course.callnum = "csc230"; b.) cin > > student.name; c.) classlist[0] = name; d.) classlist[1].gpa = 3.45; e.) name = classlist[15].name; f.) student.name = name; g.) cout < < classlist[10] < < endl; h.) for (int j = 0; j < 100; j++)classlist[j].name = name; i.) classlist.course.credits = 3; j.) course = studenttype.course;
Answers: 1
question
Computers and Technology, 23.06.2019 02:30
People with high self-esteem: accept their strengths and weaknesses. believe that failed experiences are failures of their whole self. feel good about who they are only when they reach total success. need positive external experiences to counteract negative feelings that constantly plague them.
Answers: 1
question
Computers and Technology, 23.06.2019 10:00
Now, open this passage to read about fafsa requirements. describe the information you will need to provide in order to complete a fafsa. list at least three of the required documents you must include.
Answers: 3
question
Computers and Technology, 23.06.2019 23:30
A. in packet tracer, only the server-pt device can act as a server. desktop or laptop pcs cannot act as a server. based on your studies so far, explain the client-server model.
Answers: 2
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, 22.04.2020 03:10
question
Mathematics, 22.04.2020 03:10
question
Mathematics, 22.04.2020 03:10
question
Mathematics, 22.04.2020 03:10
Questions on the website: 13722367