Question: Code a complete C program solution to the following problem: A tools rental company wants you to design an application to keep track of their
Code a complete C program solution to the following problem: A tools rental company wants you to design an application to keep track of their day-to-day rental process to a set of customers. This application requires the use of array of structure and must be handled by pointers (same tools and techniques used in class are required): 1-Code a structure Tool that has the following attributes with their related constraints: -Tool ID: exactly 5 digits -Tool Type: letter and space only -Full Day Rental: real number -Half Day Rental: real number Code a related function that input data for a given tool (will be used to add more tools to the database later) Code a function that displays data for a given tool. Code all your validation functions (to validate all attributes and based on their given constraints (type, length) 2-Code a structure Customer that has the following attributes with their related constraints: -Customer ID: 6 digits -Customer First name: all letters. -Customer Last name: all letters. -Customer phone number: area code plus actual phone number (10 digits) (String) -Customer email: String with the correct format (i.e. default email ) assume .com is the only valid extension. Code a related function that will be called to create a customer. Code a related function that displays a given customer. Code all your validation functions (to validate all attributes and based on their given constraints (type, length) (try recycling those validation functions used with other objects) 3-Code a structure Transaction that has the following attributes with their related constraints: -Customer ID: same as in class Customer -Tool ID: same as in class Tool -Rental period: code as F for full day or H for half day. (generated) -Rental fees: real number (calculated) Code all your validation functions (to validate all attributes and based on their given constraints (type, length) (try recycling those validation functions used with other objects) 4-Code a main menu with the following options: (in base class) 1-Customer Menu 2-Tool Menu 3-Transaction Menu 3-Quit 5-Code a customer sub menu with the following options: (in base class) 1-Create a customer 2-Search a customer. 3-Go back to main menu 6-Code a tool sub menu with the following options: (in base class) 1-Add a tool 2-Search a tool 3-Goback to main menu 7- Code a transaction sub menu with the following options: (in base class) 1-Start a transaction 2-Search for a transaction 3-Display all transactions 4-Go back to main menu 8-Code a function that searches for a customer 9-Code a function that searches for a tool 10- Code a function that searches for a transaction by Customer ID (may get more than one hit) 11-Code a function that searches for a transaction by tool ID (one hit) 12-Code a function that searches for a transaction using both Customer ID and Tool ID Can you make these searches more efficientcan you recycle some of it ,combineetc? 13-Code a function that generates the report for all transactions.
*** apply this layout
struct customer struct tool struct transaction int main() { while(Moption != 4) { Moption = mainMenu(); switch(mainOption) { case 1: while (Coption != 3) { switch(coption) { //3 cases }//end switch coptiuon }//end while coption case 2: while(Toption != 3) { Toption = ToolMenu() switch(Toption) { //3 cases }//end switch toption }//end while toption case 3: while(TransacOPtion != 4) { TransacOption = TransactionMenu(); switch(TranscOption) { //4 cases } } } } return 0; }//end main() mainMenu() CustMenu() ToolMenu() TransactionMenu() getCustomer(????) dispCustomer(????) searchCustomer(????) validateCustomerID(????) validateName(????) validatePhone(????) validateEmail(????) getTool(????) dispTool(????) searchTool(????) validateToolID validateToolType(?????) validateRentalFees(????) InitiateTransaction(?????) dispTransaction(?????????????) SearchTransaction(?????) reportAllTransactions(??????????????)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
