Search

Solution Cart

Remove item Thumbnail image Product Price Quantity Subtotal
× 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. */ } } A contact list is a place where you can store a specific contact with other associated information $5.00
$5.00
× Write a C++ program that asks the user to enter the coupon color and the haircut type (adult, kid) and then determine the haircut charge. It is possible that a customers may not have a coupon, in that case, no discount will be offered. You can assume that green, blue colors are represented using 1 and 2 respectively. Write the program so it will generate the output as shown in the sample runs below where user input is in bold. Without coupons adult haircut is 15.50 and the child haircut is 10.50. Sample Run 1 Enter coupon color(θ=no coupon,1=green,2=blue):1 Enter the type of haircut (a=adult ork=kid):a The charge is 12.00 Write a C++ program that asks the user to enter the coupon color and the haircut type (adult, kid) and then determine the haircut charge. $5.00
$5.00

Cart totals

Subtotal $10.00
Total $10.00

You may be interested in…

Free Worldwide shipping

On all orders above $50

Easy 30 days returns

30 days money back guarantee

International Warranty

Offered in the country of usage

100% Secure Checkout

PayPal / MasterCard / Visa