Initial Output - 20241020 - 173041 - 0000

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Output

Initial Output

When the script is run, the following output will be displayed:

Successfully connected to the database.

HOSPITAL MANAGEMENT SYSTEM

GOD WISHES YOU

1. LOGIN

2. EXIT

ENTER YOUR CHOICE:

Scenario 1: User Chooses to Login

If the user inputs 1 for login and enters the correct credentials (vasu as the username and vasu6072
as the password):

Enter user name: vasu

Enter the password: vasu6072

Connected

WELCOME TO HOSPITAL

1. Register Patient details

2. Register Doctor details

3. Register Worker details

4. Total Patient details


5. Total Doctor details

6. Total Worker details

7. Patient detail

8. Doctor detail

9. Worker detail

10. Exit

ENTER YOUR CHOICE:

Scenario 2: Registering a Patient

If the user chooses to register a patient (input 1), provides the required details, and everything is
successful:

Enter your choice: 1

Enter Patient Name: John Doe

Enter Age: 30

Enter the Problem/Disease: Flu

Enter Phone number: 1234567890

SUCCESSFULLY REGISTERED

Scenario 3: Viewing Total Patient Details

If the user chooses to view total patient details (input 4), and there are patients in the database, the
output will look something like this:

Enter your choice: 4

(1, 'John Doe', 30, 'Flu', 1234567890)


This would print the details of all patients in the patient_details table.

Scenario 4: Invalid Choices

If the user enters an invalid choice at any prompt, the script will respond with:

Invalid choice. Please try again.

Scenario 5: Exiting the Application

If the user chooses to exit (input 2 or 10 when logged in):

Enter your choice: 10

The script will terminate without any further output.

Scenario 6: Wrong Credentials

If the user inputs incorrect credentials for login:

Enter user name: wrong_user

Enter the password: wrong_password

Wrong username & password

Error Handling
If there are issues with the database connection, such as wrong credentials for MySQL or if the
database does not exist, you might see an output like:

Connection failed.

Final Output

After the user has finished interacting with the application, the connection to the database will be
closed:

# No specific output, but connection will be closed.

Summary

The actual output will depend on user inputs and the state of the database (like whether tables exist,
etc.).

You might also like