Assignment 2 due Thursday, January 17 at 11:59pm on Canvas Assignment 2: My Portal Roster (10 pts)
Jiming Wu James Brown Leanna Perez Xing Li Stacey Cahill Mohammed Abbas Kumari Chakrabarti Shakil Smith Jung Ahrin Pedro Martinez Ally Gu Tamara White Alvin Ngo Abir Fadel Brad Feinman Xiaohang Yue
100 99 98 98 97 96 95 94 94 93 91 88 85 83 75 64
Starter Code /** * @author * CIS 36B */ import java.util.Scanner; import java.io.File; import java.io.IOException; import java.io.PrintWriter; public class Roster { public static void main(String[] args) throws IOException { Scanner input = new Scanner(System.in); System.out.println("Welcome to MyPortal Roster!"); System.out.println("\nGoodbye!"); } /** * Inserts an integer element into an array at a specified index * @param array the list of integer values * @param numElements the current number of elements stored * @indexToInsert the location in the array to insert the new element * @param newValue the new String value to insert in the array */ public static void insert(int array[], int numElements, int indexToInsert, int newValue) { } /** * Inserts a String element into an array at a specified index * @param array the list of String values * @param numElements the current number of elements stored * @indexToInsert the location in the array to insert the new element * @param newValue the new String value to insert in the array */ public static void insert(String array[], int numElements, int indexToInsert, String newValue) { } /** * Removes a String element from an array at a specified index * @param array the list of String values * @param numElements the current number of elements stored * @param indexToRemove where in the array to remove the element */ public static void remove(String array[], int numElements, int indexToRemove) { } /** * Removes an integer element from an array at a specified index * @param array the list of int values * @param numElements the current number of elements stored * @param indexToRemove where in the array to remove the element */ public static void remove(int array[], int numElements, int indexToRemove) { } /** * Print an array of Strings either to the console * or a file * @param names the list of student names * @param scores the list of student scores * @param numElements the current number of elements stored * @param file the file name or "console" to write to the console */ public static void printRoster(String[] names, int scores[], int numElements, String file) throws IOException { } /** * Searches for a specified String in a list * @param names the array of Strings * @param value the String to serach for * @param numNames the number of elements in the list * @return the index where value is located in the array */ public static int linearSearch(String names[], String value, int numNames) { return -1; } } Sample Output Welcome to MyPortal Roster! Contents of corresponding output file (roster.txt in my example): Exam 1: Name: |