程序代写代做代考 go Java SUMMER 2020

SUMMER 2020
ASSIGNMENT 1
INSTRUCTOR: LAUREN HIMBEAULT DUE: JULY 3, 2020 11:59:59 pm
Question 1: Basic Objects
Please place the following code block at the top of your program with all information filled in appropriately.
/*
Name: your name here
Instructor: Lauren Himbeault
Course: COMP 1020
Program Outline: what does your program do? */
Write a program named A1Q1.java that manages a collection of students. Each student is to be stored in it’s own object. A1Q1 will read a file to obtain the details of the students. Download the file A1Q1Input.txt and use it as the input file. The file represents a list of Students. The first line of the file is the number of students (but don’t worry, I take care of all file reading for you)
In your program file create a class Student to store the information and calculate the GPA for each student. This class should contain instance variables, a constructor, an instance method to calculate the GPA, and a toString() method.
Complete the Classes as follows:
Class Item Description
A1Q1
processFile()
I am giving you most of this code as we have not really covered file reading yet. You need to add the code that takes the array of information that I will split up for you and makes a new student out of it and place it in an array. See A1Q1Template for further details.

SUMMER 2020
ASSIGNMENT 1
INSTRUCTOR: LAUREN HIMBEAULT DUE: JULY 3, 2020 11:59:59 pm
A1Q1
highestGPA()
Accepts an array of Student objects , loops through the array and compares each students GPA, printing out the Student with the highest GPA.
Student
Instance variables
A string to store the students first name A string to store the students last name
An array of GPA points – each item represents the grade points in a 3 credit hour course
Student
Constructor
The constructor will accept 2 strings and an array of doubles
Student – accessor
getOverallGPA()
This function will return a double. You need find the students GPA and return it. GPA is calculated by taking the total number of GPA points and dividing it by the total number of credit hours. Each course is 3 credit hours.
Student
toString()
Implement the toString method to build a string containing the Student’s first and last name, as well as their overall GPA. The GPA should be to 2 decimal places
Your output should look like the following:
The Student with the highest GPA is: Mack Sbarrow GPA:4.43

SUMMER 2020
ASSIGNMENT 1
INSTRUCTOR: LAUREN HIMBEAULT DUE: JULY 3, 2020 11:59:59 pm
Question 1 Part 2:
In a comment block at the end of your program, please include a brief summary of what test cases, special edge cases, etc. you ran against your program.
The input file given may not be the only input file we attempt to run your code on. You should be thinking of possible problems that could arise in the program and how you want your code to handle them. One example would be if the number of courses per student varies. Is this a problem? Does your program handle it?
Please outline a minimum 3 additional cases you thought of while programming. You do not even need to tell me how you solved these problems, just list the cases you took into consideration when designing your classes and methods.
Question 2: Multidimensional Arrays
In recreational mathematics and combinatorial design, a
grid (where n is the number of cells on each side) filled with distinct positive
is a
integers in the range. such that each cell contains a different integer and the sum
of the integers in each row, column and diagonal is equal.
magic square square

SUMMER 2020
ASSIGNMENT 1
INSTRUCTOR: LAUREN HIMBEAULT DUE: JULY 3, 2020 11:59:59 pm
constant
M = n(n2 + 1)/2.
Your mission is to take an array of provided integers and complete the following tasks:
1. Arrange the items in the array so they fit into an n x n matrix
2. determine what the magic constant should be
3. check to see if the input is a magic square or not (see list of checks and
methods below)
4. print out the square and your result
No additional objects are required or needed for this assignment. The expectation is you create a method for each of the following:
– ensure there are a valid number of items in the inputNums array
– turning the array into an nxn array
– checking each number is unique and between 1 – n2 (inclusive)
o HINT: you may want to use a deep copy of the original array for this. Then you can sort it and if you know the numbers are between 1 and n2 can use a counter to go through each number. Don’t overthink it
– checking the rows
– checking the columns
– checking each diagonals (front and back)
– Any other methods you deem necessary.
If a magic square is invalid, you only have to print one of the reasons why (you do not need to know everywhere it is invalid, once you find a reason for the square to be invalid, you may stop processing it)
Follow all programming standards as well.
** In your main() function you can use the following inputs to test your code:
The constant that is the sum of any row, or column, or diagonal is called the
or magic sum,
M.
Every normal magic square has a constant which is
calculated by the formula
magic

SUMMER 2020
ASSIGNMENT 1
INSTRUCTOR: LAUREN HIMBEAULT DUE: JULY 3, 2020 11:59:59 pm
int[] inputNums = {2,7,6,9,5,1,4,3,8}; // this should be a magic square with a constant of 15
int[] inputNums = {1,2,3,4,5,6,7,8,9}; // this should NOT be a magic square as the constant 15 is not met
Your code should work for any n2 set of numbers so feel free to attempt magic squares of any size (the marker will).
You can change the preset values of the inputNums directly in your code (no file reading of any kind is done with this question)