Write a C program called: ./database CMD OPT1 OPT2 OPT3 OPT4 Where: CMD is a command that performs a specific operation. OPTi are optional arguments depending on CMD. The source file is called: database.c The executable file is called: database The CSV file is called: database.csv The argument CMD can have the following values: SHOW DELETE ADD - displays all the records from the database. · OPT1 = ID, that record in removed from the database. - OPT1=ID, OPT2=NAME, OPT3=AGE, OPT4=GPA, a new record with these fields are added to the database. The structure of the CSV file is: ID, NAME, AGE, GPA Spaces can exist between the commas, but are not required. In other words, your program should handle both cases. If a space comes after or before a comma, then it is not considered to be part of the field. For example, database.csv could look like this: 10, bob, 18,3.5 15, mary, 20,4.0 5, tom, 17 3.8 Notice the record "tom" has spaces before and after some of the commas. These spaces are not part of the fields. In other words we read: "5" then "tom" then "17" then "3.8", without spaces in the field characters. I Create database.csv and database.c in the same directory. Using vim, initialize database.csv with the above three records (i.e. bob, mary, tom), with the same spacing and format. Make database.c do the following: 1. If the user does not provide any command line arguments, then terminate with an error message: "Your did not provide any arguments. Please enter: ./database CMD OPT1 OPT2 OPT3 OPT4". 2. If the CMD argument is not SHOW, not DELETE, not ADD, then terminate the program with the error message: "The command you requested in invalid. Please select from one of these: SHOW, DELETE, ADD". 3. The user must input the CMD argument in all caps. BONUS: (optional - no extra points) automatically convert the user's CMD to uppercase.
Write a C program called: ./database CMD OPT1 OPT2 OPT3 OPT4 Where: CMD is a command that performs a specific operation. OPTi are optional arguments depending on CMD. The source file is called: database.c The executable file is called: database The CSV file is called: database.csv The argument CMD can have the following values: SHOW DELETE ADD - displays all the records from the database. · OPT1 = ID, that record in removed from the database. - OPT1=ID, OPT2=NAME, OPT3=AGE, OPT4=GPA, a new record with these fields are added to the database. The structure of the CSV file is: ID, NAME, AGE, GPA Spaces can exist between the commas, but are not required. In other words, your program should handle both cases. If a space comes after or before a comma, then it is not considered to be part of the field. For example, database.csv could look like this: 10, bob, 18,3.5 15, mary, 20,4.0 5, tom, 17 3.8 Notice the record "tom" has spaces before and after some of the commas. These spaces are not part of the fields. In other words we read: "5" then "tom" then "17" then "3.8", without spaces in the field characters. I Create database.csv and database.c in the same directory. Using vim, initialize database.csv with the above three records (i.e. bob, mary, tom), with the same spacing and format. Make database.c do the following: 1. If the user does not provide any command line arguments, then terminate with an error message: "Your did not provide any arguments. Please enter: ./database CMD OPT1 OPT2 OPT3 OPT4". 2. If the CMD argument is not SHOW, not DELETE, not ADD, then terminate the program with the error message: "The command you requested in invalid. Please select from one of these: SHOW, DELETE, ADD". 3. The user must input the CMD argument in all caps. BONUS: (optional - no extra points) automatically convert the user's CMD to uppercase.
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 4 images
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY