Question: Write the inputLicenses ( ) method in the Database class. Within inputLicenses ( ) , use scnr to read each line number until - 9
Write the inputLicenses method in the Database class. Within inputLicenses use scnr to read each line number until is read from input. If the line number is not equal to :
Create a new License object.
Use the License object's readGroupAndState method to read the license's group and state from input.
Append the License object to ArrayList licenseList.
Ex: If the input is:
A NY
D RI
B CT
C AL
then the output is:
License group: A State: NY
License group: D State: RI
License group: B State: CT
License group: C State: ALimport java.util.Scanner;
import java.util.ArrayList;
public class Database
private ArrayList licenseList new ArrayList;
Your code goes here
public void printLicenses
License currLicense;
int i;
for i ; i licenseList.size; i
currLicense licenseList.geti;
currLicense.print;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
