Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For this assignment, you will be required to use C . In this assignment, you will be required to take in a file as an

For this assignment, you will be required to use C.
In this assignment, you will be required to take in a file as an argument (from the command line).
This file will contain an existing database of client information.
Note: you can assume the file format will consistently be the same as the one provided.
Format to expect:
'John Smith', 39,'123 Charming Avenue', 1198723, 'Senior Dev'|n
'Tyler Robinson', 26,'1423 Owl foot drive', 231498, 'Junior Dev'|n
Main():
In your main function, you will create a menu that will display to the user that will take in
user input and call the appropriate functions. No processing will actually be done in main, main()
will primarily be used for passing your command line args to the appropriate functions and
displaying the menu to navigate to the required operation. The program should repeat until 5 is
entered
Output Example
Please enter the number for the operation you want to execute:
Print Database
Look Up By Name
Exit
Create a function called "populateDatabase()"
This function should use the file entered as an argument to create an array of that same size (in the
above example it's 5 cols by 2 rows table), using malloc. Once the array is created you are to then
populate the array using the contents of the file. If an empty file is provided then an error should bereturned and the program should exit gracefully. If the file doesn't contain the expected format, it
should return an error and exit gracefully. At no point in your program should it crash and produce
errors when it encounters something it doesn't expect.
Create a function called "printDatabase(()"
simple prints the contents on your array in an organized and readable way for the user
Create a function called "lookUpByName()"
As the function name implies, in this function you ask the user which name they want to
find, then carry out a search, and display the appropriate row. If no entry is found, return an error
that says 'No Such Entry Exists' and re-prompt the user for input

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Server T-SQL Recipes

Authors: David Dye, Jason Brimhall

4th Edition

1484200616, 9781484200612

More Books

Students also viewed these Databases questions

Question

What does the start( ) method defined by Thread do?

Answered: 1 week ago