Structures function help wanted

Ok so i got this assignment to complete but i need help ive started the login function but it does not run can some help mi out to see where i'm goin wrong before start the other functions.

Authentication:
Users are categorized as “Worker” or “Customer”: “Worker” can perform all
functionalities in the program. “Customer” can ONLY perform functionalities 4, 5, 6 and
7. All users are allowed three (3) attempts to enter the correct login credentials.
The CastleAmusement Tickets v1.0 software should be able to perform the following

functionalities:
1. Login: when this activity is performed, the user enters their user-id; the program
searches the “login.bat” or “login.txt” file for that user-id. If the user-id is not found in the login file the program informs the user that he/she is not a registered user and
then asks if he/she would like to register with the application. If the user chooses to
register with the application, initiate the Registration functionality (see functionality

2). Otherwise, if the user-id is found ask the user to enter their password and then
compare it with a copy of the password from the “login.*” file. If the credentials
match the program displays the program menu; other wise, advise the user that their
credentials are incorrect and ask the user is he/she wish to exit the program.

Register: when this activity is performed, the program accepts the following
customer date: full name, date of birth, age [calculated using date of birth], email
address, contact number, password, and date registered. The program should generate
a sequential user-id. Save all data (except the password) to a file called
“customer.dat”. The following data is saved to the login file (“login.dat” “login.txt”):
user-id, password, and category. The program randomly assigns a category [Worker,
Customer] to the user and informs the User of the category he/she is assigned. After the user registers successfully offer the login screen (see functionality 1).

3. Add Movie: when this activity is performed, the program accepts the following movie
data from a Worker: movie code, title, PG rating [13, 16, MA], duration in minutes,
director of the movie, type of movie [action, comedy, romance], status [active,
inactive]. Only ACTIVE movies can be scheduled for showing. The Worker uses this
activity to add a new movie to the “movies.dat” file. This file will have data
pertaining to all movies shown/showing at the movie theatre.

4. Update Movie: when this activity is performed, the program accepts the movie code
from the Worker and changes the corresponding movie status in the “movies.dat”
file.

5. Movie Schedule: when this activity is performed the program generate a daily movie
schedule from the “movies.dat” file based on ACTIVE movies. All movies are
schedule 3 hours apart. Movies are shown from 11:00A.M. to MIDNIGHT every day.
The following data is stored in a file called “movieschedule – dd-mm-yyyy.dat”:
movie code, title, PG rating [13, 16, MA], duration in minutes, director of the movie,
type of movie [action, comedy, romance], and show time and price of movie ticket.
Only one (1) movie can be scheduled in a cinema at a time.

6. Buy Ticket: when this activity is performed the program displays a copy of the movie
schedule for that day. The Customer enters the movie code and the program searches
the “movieschedule – dd-mm-yyyy.dat” file using the movie code and displays the
movie title, duration, PG rating, show date, show time and price of the ticket. The
programs then asks the user to enter payment for the ticket if he/she is sure they want
to buy that ticket. Payment must be greater than or equal to the cost of the ticket.
Once payment is validated the program prints receipt and automatically initiates the
Generate Movie Ticket functionality.

7. Generate Movie Ticket: when this activity is initiated, ticket details such as: movie
title, date of movie, show time, PG rating, and price is displayed for the customer to
view on the screen and then added to a file called “tickets.dat”.

Notes
• On STARTUP the program should ONLY display the login screen. See
functionality 1.
• The Worker can perform all functionalities. While the Customer menu can ONLY
perform 1, 2, 6, and 7.
• The theatre can only seat 100 persons. Therefore the number of tickets sold
CANNOT exceed the number of seats in the cinema. See functionality 6.
• A customer can ONLY purchase 2 tickets at a time. See functionality 6.


#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<string.h>


typedef struct UserLogin
{
char userId[10];
}LOGIN;

void LOGIN()
{
char passwrd[10];
int p = 0;
char uoid[] = "ndrew";
char opasswrd[] = "program";
int chances = 3;


while (chances)
{
printf("Enter User ID:\n");
scanf_s("%s", &userId);
printf("\n");
printf("Enter Your Password:\n");
scanf_s("%s", &passwrd);

if (strcmp(uoid, userId) == 0 && strcmp(passwrd, opasswrd) == 0)
{
p = 1;
break;
}
else
{
printf("Invalid User Id And Password\n");
chances--;
}
}

if (p==1)
{
printf("Correct User Id And Password\n");
}
else
{
printf("You have no more chances...");
}
}
Topic archived. No new replies allowed.