import java.util.Scanner; public class Gradebook { // main method public static void main(String [] args) { Scanner
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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) 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)
Expert Answer:
Answer rating: 100% (QA)
java import javautilScanner public class GradeBookHW public static void mainString args Scanner input new ScannerSystemin Create 2 String arrays for s... View the full answer
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Posted Date:
Students also viewed these programming questions
-
fix this code so i dont get errors: package final_project; import java.util.ArrayList; import java.util.Scanner; import java.util.regex.Pattern; /** * * @author hudael-haj_snhu */ class Ingredient {...
-
answer the question clearly You are building a flight-control system for which a convincing safety case must be made. Would you assign the tasks of safety requirements engineering, test case...
-
(a) Explain how a limit worth may be tended to at run-time, both in a syntaxtree middle person and in collected code. What is the importance word "settled" already? [3 marks] (b) Give a model program...
-
Evaluate the limit or state that it does not exist. lim (x,y) (1,-3) In(3x + y)
-
On a hike with his family, 5-year-old Ryan became frightened when he reached a very steep section of the trail. His father gently helped him climb up while saying, "Can you be brave? Being brave is...
-
The assets and liabilities of Global Travel Agency on December 31, 20Y5, and its revenue and expenses for the year are as follows: Common stock was $525,000 and retained earnings was $1,250,000 as of...
-
Normal curve probabilities Choke Para Company's daily cash receipts are normally distributed with a mean of $8,500 and a standard deviation of $500. REQUIRED a. Find the probability that daily cash...
-
After watching the video on outsourcing, discuss the following: 1. What role does the sourcing agent play in the 4Ps of marketing? 2. How does the outsourcing approach challenge the requirements of...
-
Use algebra to evaluate the limit. 2(2 + h ) - 8 lim i h-0 h
-
In one year, one dollar ($1) could be exchanged for one euro and twenty cents (1.20). a. Derive a formula to exchange dollars into euros. Let d be the number of dollars. Let e be the number of euros....
-
Question 2: Create. (a) Create your own piecewise-defined function to model a real-life situation such as your commute, a monthly salary (example #9, and problem #87 on page 212) or a cell phone plan...
-
In what ways are the problems of creative accounting being tackled at present?
-
With regard to environmental issues, should accountants be more involved in: a Management accounting-type measurement of costs and impacts; or b External reporting?
-
Select a few companies annual reports and analyse their social and environmental reporting. Assess the value of the reported information.
-
Should the rules for profit measurement be laid down by governments?
-
Produce a list of recent accounting standards, and select a few for detailed examination. Read the stated objectives in the standards, and try also to read between the lines. Can you suggest what...
-
Which of the following statements contains the three principal characteristics of a not-for-profit organization? Tax deductibility of donations, break-even constraint, and no beneficial ownership...
-
Find the velocity, acceleration, and speed of a particle with the given position function. r(t) = (t 2 , sin t - t cos t, cos t + t sin t), t > 0
-
Write a program that meets the following requirements: Creates an array with 100 randomly chosen integers. Prompts the user to enter the index of the array, then displays the corresponding element...
-
Write a program that draws line segments using the arrow keys. The line starts from the center of the pane and draws toward east, north, west, or south when the right-arrow key, up-arrow key,...
-
Create a new concrete class that implements MyMap using open addressing with linear probing. For simplicity, use f(key) = key % size as the hash function, where size is the hash-table size....
-
Andrea Lima is attempting to sell her business to Alfonso Moreno. The company has assets of $1,800,000, liabilities of $1,600,000, and stockholders equity of $200,000. Both parties agree that the...
-
When faced with lawsuits, many companies recognize a loss and therefore credit a liability or reserve account for any future losses that may result. For instance, in the famous WorldCom case,...
-
Rothberg Corporations management took the following actions, which went into effect on January 2, 20x7. Each action involved an application of the time value of money. a. Established a new retirement...
Study smarter with the SolutionInn App