Answered step by step
Verified Expert Solution
Question
1 Approved Answer
import java.util.Scanner; public class Gradebook { // main method public static void main(String [] args) { Scanner input= new Scanner(System.in); // Create 2 String arrays
Search with a student name to know the student total grade Make the search method first. . Input / parameter: the user provided name (String), the array for names (String []) Process: Use a FOR loop, to read each element in the name array and compare with the user provided name: if (name[i].equals (userInputName)) //or using equalsIgnoreCase() Output: When the above if condition is true, return the i value for the element index. If after you go through the entire name array and cannot find a matching name, after the loop block, return -1 (an invalid / meaningless value for the index number)
Step by Step Solution
★★★★★
3.50 Rating (153 Votes )
There are 3 Steps involved in it
Step: 1
java import javautilScanner public class GradeBookHW public static void mainString args Scanner input new ScannerSystemin Create 2 String arrays for s...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started