Waived!

A contact list is a place where you can store a specific contact with other associated information

(5 customer reviews)

Original price was: $10.00.Current price is: $5.00.

Download button will appear immediately after successful payment.

Full support will be provided with necessary files installation.

Get impeccable customized solution within 24 hours, hassle-free.

View Details
Solved By Verified
Study Co-Pilot All Study Co-Pilots are evaluated by Gotit Pro as an expert in their subject area.
Instant
Download

Description

A contact list is a place where you can store a specific contact with other associated information such as a phone number, email address, birthday, etc.

Write a program that first takes as input an integer N that represents the number of word pairs in the list to follow. Word pairs consist of a name and a phone number (both strings), separated by a comma. That list is followed by a name, and your program should output the phone number associated with that name. Output “None” if name is not found.

Assume that the list will always contain less than 20 word pairs.

Hint: here we are going to use oversize array again, so we need a variable to track the number of values in the array. You can use 20 as array capacity. Be careful: Word pairs consist of a name and a phone number (both strings)

String[]contactNames=newString[20];

String[]contactNumbers=newString[20];

Important Note: Your output needs to match the required output including the space see Ex:

Ex: If the input is:

3

Joe, 123-5432

Linda, 983-4123

Frank,867-5309

Frank

the output is:

8675309

Your program must define and call the following method. The return value of getPhoneNumber is the phone number associated with the specific contact name.

public static String getPhoneNumber(String[] nameArr, String[] phoneNumberArr, String contactName, int arraySize)

Hint: Use two arrays: One for the string names, and the other for the string phone numbers. Please note that the input has comma. You would need to deal with the comma using indexOf and substring.

int comma = userInput.indexOf(“,”);

contactNames[i] = userlnput.substring(0, comma);

contactNumbers[i] = userInput.substring(comma + 1);

487182.3555262.qx3zqy7

LAB 20.3.1: LAB 3.3: Contact list

3/10

ACTIVITY

LabProgram.java

Load default template…

import java.util.Scanner;

public class LabProgram {

/* Define your method here */

public static void main(String[ ] args) {

/* Type your code here. */

}

}


5 reviews for A contact list is a place where you can store a specific contact with other associated information

  1. Chris Brooks

    I have received phenomenal service that is consistent. The quality of work is A+ and the prices are very reasonable.

  2. Yizhe Gao

    great work as usual thanks

  3. Ty Miyahara

    Solution I got is great! Before deadline and is great with changes

  4. Sabrina Turner

    Excellent job, my friend. Thank You!!

  5. Mike Slaughter

    The assignment was excellent and I have scored 100 percent. I am very proud and happy with you.

Only logged in customers who have purchased this product may leave a review.


You may also like…

Patron Details

Additional information

Your Solution

Product
Quantity
Total
Cart Subtotal $0.00
Order Total $0.00

  • Pay with your credit card.