Menu

[Solved] C Program Rubric Follows Please Finish Files Appropriate Files Listed Gatecontrolcpp Https Q37163178

C++ program as rubric follows: please finish the files. Allappropriate files are listed below:

  • GateControl.cpp:https://www.mediafire.com/file/4zd5p52dfdp2aa9/GateControl.cpp/file
  • GateControl.hpp:https://www.mediafire.com/file/th0x6ckodf3wduj/GateControl.hpp/file
  • Main.cpp:https://www.mediafire.com/file/j1zk8woby46t8qq/Main.cpp/file

———————————————————————————————————————

This project implements software to control access to acompany’s facility. The company has several buildings and a parkinglot for its staff, all surrounded by a fence that has anelectrically-operated gate for employees to drive through if theyhave an authorized access card. The gate has a card reader that isconnected to a computer that will receive a card’s identifyingnumber, validate the access, and operate the gate operator’s motorto open the gate. The computer will record each transaction—thedate and time of each access, allowed or denied.

The GateControl project involves the use of the C++ StandardLibrary map class for the software’s authorization table. Eachtable record is identified by a four-digit card number and containsthe cardholder’s name and the permissible access. A cardholder’saccess can be restricted to a specific time range such as 8 AM to 5PM.

The GateControl software is surrounded by other software,outside the scope of this project, that provides functions such asmanaging the authorization database, checking the transaction log,interfacing to the card reader, and operating the motor that opensthe gate. This project’s Main.cpp simulates this other software,calling GateControl functions to determine if a card that has beenread is authorized, to retrieve authorization records, or toretrieve transaction records.

GateControl has eight functions:

  1. AccessAllowed(), whose input argument is a card number. Itvalidates access and returns true if access is permitted and falseif it is not. The attempted access, allowed or denied, is recordedin a transaction log. The format of a transaction record is definedin GateControl.hpp.
  2. AddAuthorization(), whose arguments are a card number, acardholder name, and a time range (a start time / end time pair).The format of these times is the same as described below in theData and Time section. It returns a boolean success/failure status;failure (false) means the item was already present and couldn’t beadded.
  3. DeleteAuthorization(), whose argument is a card number. Itreturns a boolean success/failure status; failure (false) means thecard was not found and couldn’t be deleted.
  4. ChangeAuthorization(), whose arguments are a card number, acardholder name, and a time range. It changes the name and timerange of an existing card. It returns a boolean success/failurestatus; failure (false) means the card was not found and couldn’tbe changed.
  5. GetAllAuthorizations(), which has one output argument: theaddress of a vector to receive all of the authorization records. Itdoesn’t return anything; the vector will be cleared if there are noauthorization records. The format of an authorization record isdefined in GateControl.hpp.
  6. GetCardAuthorization(), whose input argument is a card number.It has one output argument: the address of an authorization record.It returns a boolean success/failure status; failure (false) meansthe card was not found. The format of an authorization record isdefined in GateControl.hpp.
  7. GetAllTransactions(), which has one output argument: theaddress of a vector to receive the complete set of transactionrecords. The format of a transaction record is defined inGateControl.hpp. If there are no transactions, the vector will becleared.
  8. GetCardTransactions(), whose input argument is a card number.It has one output argument: the address of a vector to receivetransaction records for the specified card. The format of atransaction record is defined in GateControl.hpp. If there are notransactions, the vector will be cleared. It returns a booleansuccess/failure status; failure (false) means the card was notfound and no transactions could be found.

In the past, projects that had to produce output files havefailed because the actual and expected formats didn’t matchexactly, often merely differences in spacing or punctuation. Thisproject’s alternative is to have the actual results stored in theauthorization or transaction record’s data members so that formatisn’t relevant. Groups of records are inserted into a vectorinstead of being saved in a readable file.

Date and Time

Date and time are needed by the AccessAllowed() function todetermine whether access should be allowed or denied and to marktransaction records.

It will be available through two global string variables thatthe Main.cpp test driver will set as needed to test the GateControlfunctions. These strings have these formats:

  • Date: YYYYMMDD, where YYYY is a four-digit year, MM is atwo-digit month, and DD is a two-digit day.
  • Time: HHMM, where HH is a two-digit hour from 00 to 23 and MMis a two-digit minute.

These formats allow dates and times to be compared by simplyusing the standard operators such as ==, <, and > on thestrings. There is no need to extract fields from the strings andcompare the individual parts of dates or times.

Each test will be defined to occur at a specific date and time;having Main.cpp set these times makes the tests repeatable and notdependent on the actual time-of-day.

Source Code Files

You are given “skeleton” code files with declarations that maybe incomplete and don’t have any implementation. Implement the codeand ensure that all the tests in Main.cpp pass successfully.

  • GateControl.cpp: This is to be completed. Yourcode should go into this file, not the .h file.https://www.mediafire.com/file/4zd5p52dfdp2aa9/GateControl.cpp/file
  • GateControl.hpp: This is already completed. Itcontains declarations of the Authorization and Transactionstructures, including the associated map and vector. You may adddata and functions if desired to help your implementation butyou’re not required to do so.https://www.mediafire.com/file/th0x6ckodf3wduj/GateControl.hpp/file
  • Main.cpp: This is already completed. It’sprovided for you to use to test your software while you’re writingit. It has several functions whose names begin with Test…; you cancomment out the calls to tests of functions that you haven’timplemented yet. You may change this file if you wish to addhelpful functions for your own testing.https://www.mediafire.com/file/j1zk8woby46t8qq/Main.cpp/file

When we test your project, we’ll discard your version ofMain.cpp and replace it with a different version of Main.cpp, notthe one you were given. Our version will use different test data toprevent you from writing code that handles only specific testcases.

You will find it helpful to implement GateControl’s functions insmall steps, building up from simple functions to more complexones, testing each one as you go. You can edit your copy ofMain.cpp to enable only the tests you need to run. Don’t wait untilthe very end to test your code.

Here’s a suggested order:

  1. AddAuthorization() and GetCardAuthorization()
  2. GetAllAuthorizations()
  3. DeleteAuthorization()
  4. ChangeAuthorization()
  5. AccessAllowed()
  6. GetAllTransactions() and GetCardTransactions()

Important Guidelines

Here are some guidelines for submitting projects that will helpyour instructors deal with the large volume of projects to grade.Failing to follow these guidelines will affect project grades.

Testing

Unless otherwise directed, use the following command to compileyour program:
clang++ -g -Wall -std=c++14 Main.cpp GateControl.cpp -o test

To attempt to run the compiled test program, use the followingcommand:
./test

Expert Answer


Answer to C++ program as rubric follows: please finish the files. All appropriate files are listed below: GateControl.cpp: https:/… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *