Question: C Programming Language (Code With C Programming Language) Problem Title: Searching Kana is a teacher who teaches history lessons. Kana has many students from several

C Programming Language (Code With C Programming Language)

Problem Title: Searching

Kana is a teacher who teaches history lessons. Kana has many students from several classes. To make searching student easier, Kana merge the list of students in a document. The list made by Kana is sorted based on the student identification number. But because of the large number of students, Kana needed time to look for it. Kana asks for your help to create a program that can improve student searches based on their identification numbers.

Format Input

Read from file testdata.txt. First line, consists of one integer N, number of students record. Next N lines consists of two field per line which are student identification number D and students name M. M only consists of one word. Next line consists of one integer T, number of test case given. For each test case, there is a line of S, which is student identification number that need to be found.

Format Output

Output should be expressed in format Case #X: M where M is students name. If there is No Such Student identification number, then output Case #X: N/A where N/A means not available.

Constraints

  • 1 N 100
  • |D|, |S| = 10 (|X| means length of string X)
  • 1 T 100
  • 1 |M| 20
  • The list is already sorted based on the student identification number in ascending order.
  • D and S only consists of digits 0-9.
  • M only consists of letters a-z and A-Z.

Sample Input (testdata.txt) 13 2020123456 Liam 2020123457 Noah 2020123458 William 2020123459 James 2020123460 Logan 2020123461 Benjamin 2020123462 Mason 2020123463 Elijah 2020123464 Oliver 2020123465 Jacob 2020123466 Lucas 2020123467 Michael 2020123468 Alexander 4 2020123456 2020123468 2020123462 2020100000

Sample Output (Standard Output) Case #1: Liam Case #2: Alexander Case #3: Mason Case #4: N/A

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!