You are provided a few files: instructions: This file passwords: A sample user a
ID: 3606344 • Letter: Y
Question
You are provided a few files:
instructions: This file
passwords: A sample user accounts file (no need to change anything in here unless you want to)
provide.c: This is a modified version of your hw3 assigment, it adds user account/logins and a couple new menu options
sample_linux: The sample implementation of your assignment, you want to make your program work like the sample (also you
may want to use it for hints on how to accomplish your task)
What you need to do:
Complete menu option 1: Print your name and id
Complete menu option 6: Save data
Complete menu option 7: Load data
Implement a log file
Option 1 is the same as previous assignments1
Option 6 Must ask the user to enter a file name and then your program should allow option 7 to work, how you go about doing this is up to you, but you can use the sample implementation for hints.
Option 7 Must ask the user to enter a file name, then it should load the data stored in that save file if the save file was generated by the currently logged in user, if the user is different then do not load the data.
The log file must keep a running list of certain actions and must be named hw3.log.
Record each time the program starts or exits.
Each time a user attempts to log in it must record if the attempt succeeded or failed.
It must also record each time a file was saved/loaded, when this is recorded give the current user name as well as the name of the file
Each log entry must start with the author student id.
The log should NOT be cleared between program launches.
using linux programming
Explanation / Answer
#include #include #include #include static int option = 0; static void Input (int option) { option = 1; } int main (int argc, char *argv[]) { prinf("Please enter username"); printf("Please enter password"); printf("start") switch(option) case 1: printf("Enter your Name and Id); memset (&act, 0, sizeof(act)); act.sa_handler = hdl; case 6:SaveData(); case 7:LoadData(); printf("exit");Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.