Question: C Programming Language (Code With C Programming Language) Problem Title : Record Finder You are given customer data where each data contains AccNumber, name, age,

C Programming Language (Code With C Programming Language)

Problem Title : Record Finder

You are given customer data where each data contains AccNumber, name, age, and ballance. The given data is sorted lexicographically ascending based on the AccNumber. Then, there are queries. For each query, given a variable . You are asked to tell whether a customer whose AccNumber is exists. If so, output the customers data. If the customer does not exist, output -1.

Format Input

The first line consists of an integer . The next lines contain the given data. Each data consists of AccNumber, name, age, and balance, respectively, separated by commas. The next line consists of an integer . The next lines consist of an integer , which represent each query

Format Output

For each query, if the customer exists, then print the data with the following format: . If there is no data to display, output -1.

Constraints

  • 1 , 50000
  • All given AccNumber and in each query are a string consists of exactly 4 upper case Latin alphabet characters. It is guaranteed that there are no 2 data with the same AccNumber
  • Length of the name is between 1 and 20 (inclusive). Names consist of Latin alphabets and whitespaces. It is guaranteed that the first and last character are not whitespaces.
  • Ages are between 10 and 100 (inclusive)
  • Balances are between 0 and 109 . It is guaranteed that the balances are given in 2 decimal places.

Sample Input & Output (Standard input & output)

5 ANGE,Andrew Garfield,18,110933.25 HAIS,Spectra Vgeist,18,25000.00 NERA,Frankie,16,999999999.99 TION,Dorothy White,22,0.00 VVVV,Michael J,17,100000.00 3 NERA Frankie 16 999999999.99 JOLY -1 VVVV Michael J 17 100000.00

Notes: Please Use in Very Efficient Approach. Thank You

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!