The document contains C++ code that defines classes for a hospital management system including password, doctor, and patient classes. The password class handles setting and verifying passwords. The doctor class stores and manages doctor data like name, age, specialization etc. The patient class defines attributes to store patient information such as name, age, symptoms, assigned doctor etc. Various member functions are defined to get, set, modify and validate the data stored in these classes.
The document contains code for a C++ program that manages a canteen. It allows users to input customer details, view the menu and purchase items, view canteen details, add new customers, and check available quantities. The program displays thank you messages when exited and has functions for validating purchase quantities and calculating totals.
When it comes to writing tests we often live in the here-and-now and consequently end up producing "write-only" tests. This session looks at what we need to consider if we want to create tests that our future selves and teammates will find valuable instead of becoming another burden on top of delivering the feature itself.
If there is one place that we find it easy to take shortcuts it's when writing tests. Whether we're under the cosh or have an overly-optimistic view of our ability to write self-documenting code, instead of creating tests that support the production code and development process we can find ourselves producing WTFs (Weak Test Functions). The net effect is often a viscous cycle that disparages, instead of encourages us.
In the past I've tried many different ways to try and short-circuit the test writing process, but have only come-up short every time. This session takes a look at why skimping on elements of the test structure, such as organisation, naming and scope only leads to pain and hardship in the long run. Along the way we'll uncover the truth behind common folklore, such as only having one assertion per test.
The document describes a new tool called Sifu that aims to simplify programming by allowing developers to write specifications for applications in a domain-specific language (DSL) called SifuDSL. The SifuCompiler checks these specifications for errors and applies best practices, and the SifuLinker transforms the specifications into maintainable code in the developer's choice of technology stack. The generated code can be freely changed and extended by developers and looks like code written by an experienced developer. Sifu specifications also serve as documentation that is always up to date. The tool claims developers can generate up to 90% of an application's codebase using Sifu alone.
Student Data Base Using C/C++ Final ProjectHaqnawaz Ch
This C++ code defines functions for a student database program that allows users to enter, modify, search, hide, and delete student records. The main functions include passing a login password, displaying a menu, entering new records, modifying and deleting existing records, hiding records, searching for records, and exiting the program. Structures are used to store student name, bio data, and password authentication information.
JavaScript - i och utanför webbläsaren (2010-03-03)Anders Jönsson
This document provides an overview of JavaScript concepts including variables, data types, objects, functions, conditionals, loops, callbacks, prototypes, this keyword, scope, closures, events, DOM manipulation, and asynchronous programming. It includes code examples to demonstrate these concepts such as defining variables, creating and accessing objects and their properties, writing functions with parameters and return values, if/else statements, for loops, and using callbacks with asynchronous functions.
The document describes code for implementing various operations on singly linked lists in C such as insertion, deletion, searching, reversing, merging, splitting lists. It includes function definitions and implementations for printing a list, inserting a node, deleting a node, searching for a node, counting nodes, reversing a list, merging two lists, and splitting a list. The main function tests these operations in a menu-driven program.
This document contains the code for various operations on singly linked lists in C language such as insertion, deletion, searching, counting, reversing, merging, and splitting nodes. It includes function definitions and main program to demonstrate a menu driven program to perform these operations and print the list. The functions work recursively to traverse the list and perform the desired operation by updating next pointers.
The document contains code for a C++ program that manages a canteen. It allows users to input customer details, view the menu and purchase items, view canteen details, add new customers, and check available quantities. The program displays thank you messages when exited and has functions for validating purchase quantities and calculating totals.
When it comes to writing tests we often live in the here-and-now and consequently end up producing "write-only" tests. This session looks at what we need to consider if we want to create tests that our future selves and teammates will find valuable instead of becoming another burden on top of delivering the feature itself.
If there is one place that we find it easy to take shortcuts it's when writing tests. Whether we're under the cosh or have an overly-optimistic view of our ability to write self-documenting code, instead of creating tests that support the production code and development process we can find ourselves producing WTFs (Weak Test Functions). The net effect is often a viscous cycle that disparages, instead of encourages us.
In the past I've tried many different ways to try and short-circuit the test writing process, but have only come-up short every time. This session takes a look at why skimping on elements of the test structure, such as organisation, naming and scope only leads to pain and hardship in the long run. Along the way we'll uncover the truth behind common folklore, such as only having one assertion per test.
The document describes a new tool called Sifu that aims to simplify programming by allowing developers to write specifications for applications in a domain-specific language (DSL) called SifuDSL. The SifuCompiler checks these specifications for errors and applies best practices, and the SifuLinker transforms the specifications into maintainable code in the developer's choice of technology stack. The generated code can be freely changed and extended by developers and looks like code written by an experienced developer. Sifu specifications also serve as documentation that is always up to date. The tool claims developers can generate up to 90% of an application's codebase using Sifu alone.
Student Data Base Using C/C++ Final ProjectHaqnawaz Ch
This C++ code defines functions for a student database program that allows users to enter, modify, search, hide, and delete student records. The main functions include passing a login password, displaying a menu, entering new records, modifying and deleting existing records, hiding records, searching for records, and exiting the program. Structures are used to store student name, bio data, and password authentication information.
JavaScript - i och utanför webbläsaren (2010-03-03)Anders Jönsson
This document provides an overview of JavaScript concepts including variables, data types, objects, functions, conditionals, loops, callbacks, prototypes, this keyword, scope, closures, events, DOM manipulation, and asynchronous programming. It includes code examples to demonstrate these concepts such as defining variables, creating and accessing objects and their properties, writing functions with parameters and return values, if/else statements, for loops, and using callbacks with asynchronous functions.
The document describes code for implementing various operations on singly linked lists in C such as insertion, deletion, searching, reversing, merging, splitting lists. It includes function definitions and implementations for printing a list, inserting a node, deleting a node, searching for a node, counting nodes, reversing a list, merging two lists, and splitting a list. The main function tests these operations in a menu-driven program.
This document contains the code for various operations on singly linked lists in C language such as insertion, deletion, searching, counting, reversing, merging, and splitting nodes. It includes function definitions and main program to demonstrate a menu driven program to perform these operations and print the list. The functions work recursively to traverse the list and perform the desired operation by updating next pointers.
Building complex async applications is really hard. Whether you use callbacks, Promises, or EventEmitters, Error objects should have a place in your utility belt. They are indispensable when it comes to managing work flows in a highly asynchronous environment.
This talk covers patterns for using JavaScript Error (with a capital E) objects to build resilient applications, and introduce some modules that can be used to build errors with an elegant history of stack traces even through multiple asynchronous operations. Try/catch, callbacks, and other error handling mechanisms will be examined, revealing some potential deficiencies in the JavaScript language for dealing with errors.
Video: https://www.youtube.com/watch?v=PyCHbi_EqPs
This summarizes the coding for a Railway Reservation Project in C++. The code includes classes for login, ticket details, reservations, and cancellations. Methods are included to get and display details for reservations, cancellations, and ticket information from data files. The main menu allows selecting administrator or user mode, and the administrator menu provides options to create databases, add/view details, and manage users.
This document contains the code for a blood bank management system implemented as a doubly linked list in C++. It defines a node struct to store donor data and a blood class to implement linked list functions like insertion, deletion, searching by blood group or age, and displaying the list. The main function contains a menu loop to call the different blood class functions like insert, display, count donors, delete by position, etc. It also includes a logo class to display an intro screen and handle login functionality.
This document discusses cross-platform support and push notifications in Windows Azure Mobile Services. It explains how to send push notifications to different device platforms including Windows Store, Windows Phone, iOS, and Android. It also discusses using service filters and delegating handlers to intercept requests and responses for custom processing like adding versioning information.
This document contains code for a C++ program that manages traveler details. It includes functions for an administrator menu with options to display traveler lists, search, edit, and delete traveler details. There are also functions for a guest menu to input and display traveler details. Structures are used to store traveler information including name, destination, address, phone number, etc.
Numerical Methods with Computer ProgrammingUtsav Patel
This document contains summaries of 9 numerical methods programs written in C++ including: Bisection Method, Regula-Falsi Method, Secant Method, Newton-Raphson Method, Gauss-Jordan Method, Gauss Elimination Method, Method of Least Squares, Euler's Method, and Runge-Kutta Method. For each method, the document provides the program code, sample output, and a brief 1-2 sentence description.
Twisted is an event-driven networking engine written in Python. It provides tools for developing asynchronous network applications and services. Some key features of Twisted include an asynchronous reactor framework, support for deferreds/promises, common network protocols and services implemented, and application framework for building services.
The document discusses various techniques for testing game code, including:
1. Unit testing frameworks like Google Test and mocking objects to isolate dependencies.
2. Database testing using seed data and frameworks like xDBUnit.
3. Resource validation to check for logical errors in game assets.
4. Various approaches for runtime validation, debugging crashes, and analyzing crash dumps. Testing covers areas like databases, AI, and preventing crashes via assertions.
The document contains source code for a client-server chat application written in Java. The client code establishes a socket connection to the server, reads user input and sends messages to the server. The server code initializes a server socket to listen for client connections, spawns a new thread for each client, reads incoming messages and sends responses. The code includes graphical user interface components for selecting the client or server role, composing and displaying messages.
This document discusses binary vulnerabilities and methods for identifying and exploiting them. It covers topics like stack overflows, heap overflows, integer overflows, and pointer vulnerabilities. It also discusses vulnerability metrics, identifiers, and tools that can be used for analysis like fuzzers, symbolic execution, and decompilers. Exploitation techniques like bypassing protections and transferring control are also mentioned.
The document contains source code for a client-server application written in Java. The client code establishes a socket connection to the server, allows sending and receiving messages, and closes the connection. The server code starts by binding to a port, accepts new connections from clients, and spawns a new thread to handle each client connection concurrently. It reads and writes data from the socket and closes the connection when the client disconnects. The code includes classes for the client, server, and thread handling each client connection.
The code examples show source code for a client and server application for a chat program. The client code defines functions for connecting to the server, sending and receiving messages. The server code defines functions for starting the server, accepting new connections from clients, and handling message receives and sends between connected clients. The code implements multi-threaded processing to concurrently handle multiple client connections to the server.
This document describes a student project for a hotel billing system. It includes sections describing the project contents, aim to create bills based on booking numbers, table structure, program coding and output, merits like fast accessible records, and demerits like inability to recover deleted records. The conclusion states the project reduces manual work and automatically calculates totals.
The process of creating HDTR images from the photographic shot to the processing via a Photoshop JS script explained.
This is the slide I used for my talk at the monthly MadridJS meeting held on May, 23rd 2013.
This document provides an overview of software security best practices and common vulnerabilities for Odoo code. It discusses the top 10 risks including injection, broken authentication, sensitive data exposure, XML external entities, broken access control, security misconfiguration, cross-site scripting, insecure deserialization, vulnerable components, and insufficient logging. For each risk, it provides examples of vulnerable code and recommendations for more secure implementations. It emphasizes that the Odoo framework includes mechanisms to prevent many mistakes but knowledge and mindset are also key. The document concludes with recommendations for code reviews to check access control, permissions, templates, evaluations, injections, and cross-site scripting prevention.
This document contains C++ code that defines classes for managing hospital data such as doctors, patients, and passwords. The code includes functions for setting and verifying passwords, getting and modifying doctor and patient information, assigning patients to doctors, generating reports, and calculating bills. Doctor and patient classes store names, IDs, medical details, and other attributes. Functions validate input, write/read to files, and display/modify data.
This document provides a summary of a project on a Hospital Management System. It includes sections on the definition of a hospital and how a hospital management system works. It describes the need for an HMS including minimizing documentation and improving patient care. The document outlines the software requirements specification for the HMS including functional requirements like administration, patient, and billing modules. It provides details on the system design with data flow diagrams, entity relationship diagrams, class diagrams and use case diagrams. It concludes with discussing future enhancements and limitations.
The document provides an overview of a project report on a Hospital Management System. It includes an introduction describing the purpose and scope of the system. It then discusses the overall description, including goals, background on existing hospital processes, project requirements, user characteristics, and constraints. Finally, it analyzes the feasibility of the system from technical, economic, operational, and schedule perspectives. The system aims to automate hospital workflows and improve accuracy, reliability, and immediate access to information.
1) The document describes a student management system project in C programming. It includes details like the student's name, ID, course code, and a table of contents for the project.
2) It introduces the current paper-based student record keeping system and proposes a computerized student management system to address issues like data security, accessibility and efficiency.
3) The proposed system aims to provide a user-friendly interface for basic student data management like adding, modifying and searching records, with username/password security for authorized access only.
Building complex async applications is really hard. Whether you use callbacks, Promises, or EventEmitters, Error objects should have a place in your utility belt. They are indispensable when it comes to managing work flows in a highly asynchronous environment.
This talk covers patterns for using JavaScript Error (with a capital E) objects to build resilient applications, and introduce some modules that can be used to build errors with an elegant history of stack traces even through multiple asynchronous operations. Try/catch, callbacks, and other error handling mechanisms will be examined, revealing some potential deficiencies in the JavaScript language for dealing with errors.
Video: https://www.youtube.com/watch?v=PyCHbi_EqPs
This summarizes the coding for a Railway Reservation Project in C++. The code includes classes for login, ticket details, reservations, and cancellations. Methods are included to get and display details for reservations, cancellations, and ticket information from data files. The main menu allows selecting administrator or user mode, and the administrator menu provides options to create databases, add/view details, and manage users.
This document contains the code for a blood bank management system implemented as a doubly linked list in C++. It defines a node struct to store donor data and a blood class to implement linked list functions like insertion, deletion, searching by blood group or age, and displaying the list. The main function contains a menu loop to call the different blood class functions like insert, display, count donors, delete by position, etc. It also includes a logo class to display an intro screen and handle login functionality.
This document discusses cross-platform support and push notifications in Windows Azure Mobile Services. It explains how to send push notifications to different device platforms including Windows Store, Windows Phone, iOS, and Android. It also discusses using service filters and delegating handlers to intercept requests and responses for custom processing like adding versioning information.
This document contains code for a C++ program that manages traveler details. It includes functions for an administrator menu with options to display traveler lists, search, edit, and delete traveler details. There are also functions for a guest menu to input and display traveler details. Structures are used to store traveler information including name, destination, address, phone number, etc.
Numerical Methods with Computer ProgrammingUtsav Patel
This document contains summaries of 9 numerical methods programs written in C++ including: Bisection Method, Regula-Falsi Method, Secant Method, Newton-Raphson Method, Gauss-Jordan Method, Gauss Elimination Method, Method of Least Squares, Euler's Method, and Runge-Kutta Method. For each method, the document provides the program code, sample output, and a brief 1-2 sentence description.
Twisted is an event-driven networking engine written in Python. It provides tools for developing asynchronous network applications and services. Some key features of Twisted include an asynchronous reactor framework, support for deferreds/promises, common network protocols and services implemented, and application framework for building services.
The document discusses various techniques for testing game code, including:
1. Unit testing frameworks like Google Test and mocking objects to isolate dependencies.
2. Database testing using seed data and frameworks like xDBUnit.
3. Resource validation to check for logical errors in game assets.
4. Various approaches for runtime validation, debugging crashes, and analyzing crash dumps. Testing covers areas like databases, AI, and preventing crashes via assertions.
The document contains source code for a client-server chat application written in Java. The client code establishes a socket connection to the server, reads user input and sends messages to the server. The server code initializes a server socket to listen for client connections, spawns a new thread for each client, reads incoming messages and sends responses. The code includes graphical user interface components for selecting the client or server role, composing and displaying messages.
This document discusses binary vulnerabilities and methods for identifying and exploiting them. It covers topics like stack overflows, heap overflows, integer overflows, and pointer vulnerabilities. It also discusses vulnerability metrics, identifiers, and tools that can be used for analysis like fuzzers, symbolic execution, and decompilers. Exploitation techniques like bypassing protections and transferring control are also mentioned.
The document contains source code for a client-server application written in Java. The client code establishes a socket connection to the server, allows sending and receiving messages, and closes the connection. The server code starts by binding to a port, accepts new connections from clients, and spawns a new thread to handle each client connection concurrently. It reads and writes data from the socket and closes the connection when the client disconnects. The code includes classes for the client, server, and thread handling each client connection.
The code examples show source code for a client and server application for a chat program. The client code defines functions for connecting to the server, sending and receiving messages. The server code defines functions for starting the server, accepting new connections from clients, and handling message receives and sends between connected clients. The code implements multi-threaded processing to concurrently handle multiple client connections to the server.
This document describes a student project for a hotel billing system. It includes sections describing the project contents, aim to create bills based on booking numbers, table structure, program coding and output, merits like fast accessible records, and demerits like inability to recover deleted records. The conclusion states the project reduces manual work and automatically calculates totals.
The process of creating HDTR images from the photographic shot to the processing via a Photoshop JS script explained.
This is the slide I used for my talk at the monthly MadridJS meeting held on May, 23rd 2013.
This document provides an overview of software security best practices and common vulnerabilities for Odoo code. It discusses the top 10 risks including injection, broken authentication, sensitive data exposure, XML external entities, broken access control, security misconfiguration, cross-site scripting, insecure deserialization, vulnerable components, and insufficient logging. For each risk, it provides examples of vulnerable code and recommendations for more secure implementations. It emphasizes that the Odoo framework includes mechanisms to prevent many mistakes but knowledge and mindset are also key. The document concludes with recommendations for code reviews to check access control, permissions, templates, evaluations, injections, and cross-site scripting prevention.
This document contains C++ code that defines classes for managing hospital data such as doctors, patients, and passwords. The code includes functions for setting and verifying passwords, getting and modifying doctor and patient information, assigning patients to doctors, generating reports, and calculating bills. Doctor and patient classes store names, IDs, medical details, and other attributes. Functions validate input, write/read to files, and display/modify data.
This document provides a summary of a project on a Hospital Management System. It includes sections on the definition of a hospital and how a hospital management system works. It describes the need for an HMS including minimizing documentation and improving patient care. The document outlines the software requirements specification for the HMS including functional requirements like administration, patient, and billing modules. It provides details on the system design with data flow diagrams, entity relationship diagrams, class diagrams and use case diagrams. It concludes with discussing future enhancements and limitations.
The document provides an overview of a project report on a Hospital Management System. It includes an introduction describing the purpose and scope of the system. It then discusses the overall description, including goals, background on existing hospital processes, project requirements, user characteristics, and constraints. Finally, it analyzes the feasibility of the system from technical, economic, operational, and schedule perspectives. The system aims to automate hospital workflows and improve accuracy, reliability, and immediate access to information.
1) The document describes a student management system project in C programming. It includes details like the student's name, ID, course code, and a table of contents for the project.
2) It introduces the current paper-based student record keeping system and proposes a computerized student management system to address issues like data security, accessibility and efficiency.
3) The proposed system aims to provide a user-friendly interface for basic student data management like adding, modifying and searching records, with username/password security for authorized access only.
In this system we will make extensive use of files system in C++.
We will have a login id system initially. In this system we will be having separate functions for
• Getting the information
• Getting customer information who are lodged in
• Allocating a room to the customer
• Checking the availability
• Displaying the features of the rooms.
• Preparing a billing function for the customer according to his room no.
In the software developed separate functions will be there for each of the above points so that there is ample scope for adding more features in the near future.
Download From Here : https://drive.google.com/folderview?id=0B5y_t4zL91BZaWRkY1VPeElJNVE&usp=sharing
This document appears to be a project report for a school management software developed by three students. It includes sections for an introduction to the project, coding details, and functions for various modules like the office, library, and laboratory. The project aims to digitize key school administration tasks like maintaining student and teacher databases, tracking books in the library, and equipment in various labs.
Hi! This is a slide show that make me feel to upload that, in our college the final year project assignment has been adopted from this slide. So you guys really feel that this slide is a great one to download and have a look exactly whats are in a Hospital management system has.
PROJECT-HOSPITAL MANAGEMENT SYSTEM CHAP. 1 TO 4NICHOLAS RATEMO
This document provides background information on the proposed Nyamache Management System project. It summarizes the current manual patient record keeping system at Nyamache Hospital, which involves paper-based registration, billing, and record retrieval. This is inefficient and error-prone. The proposed electronic system aims to improve accuracy, efficiency and information retrieval. It will involve modules for registration, billing, stock management and administration. The document outlines the project objectives, budget, and methodology using a system development lifecycle approach involving planning, analysis, design, testing and documentation.
This program allows users to manage employee records in a database. It allows adding, modifying, deleting, recalling, and listing employee records which are stored with information like ID, name, salary, and date. The object oriented program is written in C++ and uses classes and functions to manage the database through different options from the menu.
The document describes a proposed hospital management system (HMS) that aims to automate and standardize a hospital's management processes. Currently, hospitals rely on manual paper-based systems that are inefficient and prone to errors. The HMS would control key information like patient data, schedules, and invoices electronically. It would make hospital management more efficient and reduce errors by standardizing data and ensuring integrity across information systems. The system design involves modules for registration, pharmacy, doctors, reception, laboratory, and discharge summaries. The technical requirements specify technologies like ASP.NET, C#, and SQL Server for development. UML diagrams including use cases, sequences, and classes are used for design. Data flow diagrams and entity-relationship diagrams model the
This document provides an overview and requirements for developing a Hospital Management System. It describes collecting both primary and secondary data. Key objectives of the system are to computerize patient and hospital details, schedule appointments and services, update medical store inventory, handle test reports, and keep patient information up-to-date. The system will have modules for login, patients, doctors, billing, and generating reports. It will use a relational database with tables for patient, doctor, room, and bill details.
This programming allows the user to input a decimal number and converts it to octal. It displays the decimal number entered by the user and its equivalent octal value. The user is also prompted if they want to do another conversion or end the program.
1. The document reports on a programming practice laboratory for basic programming by a group including Akbar Amanda, Alfi Abdillah, and others.
2. It demonstrates different C++ programming concepts like data types, variables, input/output, and assignments.
3. Examples show defining and assigning values to variables of different data types like char, short, int, long, and using them in simple output statements.
2 BytesC++ course_2014_c3_ function basics¶meters and overloadingkinan keshkeh
The document discusses functions in C++. It explains that functions can be defined in two ways: with declaration/calling/definition or with just declaration and definition. It provides examples of declaring a function that calculates the average of two numbers, calling that function, and defining the function. It also discusses local and global variables and their scopes. Finally, it lists some common predefined functions in C++ like sqrt, pow, abs, and rand.
This document contains the code for a Tic-Tac-Toe game. It defines a TicTacGame class with methods to initialize the game board, take player turns, check for a winner or draw, and output the board to the console. The main function runs a game loop that calls these methods, checking after each turn if the game is over. If not a draw, it declares the winner based on whose turn it was when the game ended.
This document contains code for a movie ticket booking system. It defines classes for tickets and membership cards that inherit from each other. The main function displays a menu and uses switch cases to allow users to book movie tickets, view ticket details, get information about the cinema, or register for a membership card. Functions are defined to generate random card IDs, save card details to a file, and handle payment for booked tickets in normal or gold classes.
This document contains the code for a C++ program that implements a railway reservation system. It includes classes for user login, train details, reservations, and cancellations. Methods are defined to get and display details, make reservations by writing to a reservations file, display reservation details, and cancel reservations with refund amounts calculated based on timing. The main function provides an admin menu to manage the train details database and a user menu to reserve tickets or view details.
This C++ program allows a user to choose between addition, multiplication, or exiting. It prompts the user to enter two numbers, calls functions to perform the selected operation, and displays the result. The program uses switch statements, functions, and input validation to repeat until the user exits.
This C++ program allows the user to calculate properties of 2D and 3D shapes. It includes menus to select the type of shape, whether to calculate perimeter/area/volume, and to input the necessary values. Calculations are performed for squares, circles, triangles, rhombi, cubes, rectangular prisms, cylinders, spheres. The user can repeat the calculations by selecting Y at the end.
The document contains code for an automated teller machine (ATM) program. The program prompts the user to enter a password, and if correct, displays a menu to make transactions including: checking balance, withdrawing money, depositing money, and exiting. Based on the user's selection, it performs the appropriate transaction by updating the balance variable and displaying the current balance. This repeats until the user chooses to exit the program.
The document contains code for an automated teller machine (ATM) program. The program prompts the user to enter a password, and if correct, displays a menu to make transactions including: checking balance, withdrawing money, depositing money, and exiting. Based on the user's selection, it performs the appropriate transaction by updating the balance variable and displaying the current balance. This repeats until the user chooses to exit the program.
The document contains code for an automated teller machine (ATM) program. It prompts the user to enter a password, and if correct, displays a menu to make transactions. The menu includes options to check the balance, withdraw or deposit money, and exit. Based on the selection, it performs the transaction and displays the new balance. It loops to re-enter the password if an incorrect one is provided.
This document discusses binary search trees and provides source code to implement binary search tree traversal operations. It explains that a binary search tree is a binary tree where the left child of a node is less than the parent and the right child is greater. It provides code for preorder, inorder, and postorder traversals of the binary search tree and outputs the traversal order for a sample tree.
//g++ -o simpleVector.exe simpleVector.cpp
#include
#include
#include
using namespace std;
/******************************************************
* Template class named SimpleVector
* An array that can hold any specified
* data type. Use a dynamic array.
******************************************************/
template
class SimpleVector
{
public:
//default constructor
SimpleVector();
//constructor with size of array
SimpleVector(int size);
//copy constructor
SimpleVector(const SimpleVector& object);
//setter method
void SetArray(int size);
//getter method
void ShowArray(int size);
//destructor
void FreeMemory();
//accessor method
int GetSizeOfArray();
//getter method
T GetElementAt(int index);
//Overload the [] operator. The argument is a subscript.
//This function returns a reference
//to the element in the array indexed by the subscript.
T operator [] (int subscript);
private:
//private memeber variable
T *array; //to dynamically allocate an array
T *copy;
};
//These function are going to be used in switch statement
//in order to test each case(integer, double, string).
void caseOne(int userInput, int size);
void caseTwo(int userInput, int size);
void caseThree(int userInput, int size);
int main() {
int userInput;
int size;
char keepInput;
do {
cout << \"What type of data do you want?\ \";
cout <<\"1. intger\ \";
cout <<\"2. double\ \";
cout <<\"3. strings\ \";
cin >> userInput;
cout << \"Enter the number of data \";
cin >> size;
switch(userInput) {
case 1:
{
caseOne(userInput, size);
break;
}
case 2:
{
caseTwo(userInput, size);
break;
}
case 3:
{
caseThree(userInput, size);
break;
}
default:
cout << \"invalid input\";
}
cout << \"\ Do you want to enter the data again?(Y/N)\ \";
cin >> keepInput;
} while(toupper(keepInput) == \'Y\');
return 0;
}
//This funciton is called in the switch satatement
//The purpose of this funtion is test SimpleVecor calss
//funciton for \'int\' type.
void caseOne(int userInput, int size) {
SimpleVectorintegerData(size);
integerData.SetArray(size);
integerData.ShowArray(size);
cout << \"\ Enter an index to retrieve the data\ \";
cin >> userInput;
cout << \"\ Getting an element of array by \ \";
cout << \"1. GetElementAt function : \";
cout << integerData.GetElementAt(userInput);
cout << \"\ 2. overloaded operator [] : \";
cout << integerData[userInput];
cout << \"\ \ Copying the array\";
SimpleVectornewIntegerData(integerData);
newIntegerData.ShowArray(size);
newIntegerData.FreeMemory();
}
//This funciton is called in the switch satatement
//The purpose of this funtion is test SimpleVecor calss
//funciton for \'double\' type.
void caseTwo(int userInput, int size) {
SimpleVectordoubleData(size);
doubleData.SetArray(size);
doubleData.ShowArray(size);
cout << \"\ Enter an index to retrieve the data\ \";
cin >> userInput;
cout << \"\ Getting an element of array by \ \";
cout << \"1. GetElementAt function : \";
cout << doubleData.GetElementAt(userInput);
cout << \"\ 2. overloaded operator [] : \";
cout << doubleData[.
The document describes an online student management system implemented using C++ that allows storing student data in a text file database. The system provides different views of the data for users like students, faculty, proctors and administrators. It allows adding, editing and viewing student details like registration number, name, marks in subjects and proctor ID. The source code implements the various user interfaces and file handling for performing CRUD operations on the text file database according to the user type.
El siguiente programa muestra la utilización de los casos (función case) en C++, formando menú dentro de otro menú, en la estructura del programa, cuenta con un menú de 5 funciones:
1: Calculo de un circuito serie.
2: Calculo de un circuito paralelo
3: Calculo de código de colores de resistencias.
4: Calculo de código de valores de los capacitores.
5: Salir
Unit 1 ocs752 introduction to c programmingvrgokila
This document contains code for 3 C programming exercises: 1) A program to check if a withdrawal amount is available from an account balance at an ATM, 2) A menu-driven program to calculate the area of different shapes by user selection, and 3) A program to calculate the sum of even numbers up to a user-input limit.
This document contains source code for a C++ railway reservation system with the following key features:
1. It includes classes for user login, train details, reservations, and cancellations.
2. The database() function allows an administrator to create, add, display, and manage train detail records.
3. The reserve() function allows users to search the train details and make reservations by adding records to a passenger file.
4. Other functions provide interfaces for displaying passenger details, ticket inquiries, and cancelling reservations with refund calculations.
The source code implements the core functionality for a command-line based railway reservation management system with classes for different entities and file I/O to store and retrieve data
This C++ program simulates an automated teller machine (ATM). It prompts the user to enter a password, and if correct, displays a menu with options to inquire balance, withdraw money, deposit money, or quit. Based on the selected option, it will output the current balance, process withdrawals or deposits by updating the balance variable, and terminate or return to the main menu.
This document contains code snippets from a student's practical work using Microsoft Visual Studio C++. It includes 15 code modules that demonstrate basics of C++ programming like input/output, data types, operators, conditional statements and functions. The modules progress from simple print statements to more complex concepts like nested if-else statements and switch cases. Each module is preceded by comments identifying the topic and module number.
The document contains code snippets for several C++ programs that perform calculations related to arithmetic, finance, and currency conversion. The programs include:
1. A menu-driven program that allows the user to select an arithmetic operation like calculating the nth term, sum of n terms, arithmetic mean, etc. and performs the calculation.
2. A program that calculates the power of a number to a given exponent.
3. A quiz program that asks the user multiple choice questions and calculates their score.
4. Additional code snippets calculate compound interest, quotient and remainder, powers of a number, currency conversion rates and solar energy calculation.
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsVictor Morales
K8sGPT is a tool that analyzes and diagnoses Kubernetes clusters. This presentation was used to share the requirements and dependencies to deploy K8sGPT in a local environment.
6th International Conference on Machine Learning & Applications (CMLA 2024)ClaraZara1
6th International Conference on Machine Learning & Applications (CMLA 2024) will provide an excellent international forum for sharing knowledge and results in theory, methodology and applications of on Machine Learning & Applications.
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...IJECEIAES
Climate change's impact on the planet forced the United Nations and governments to promote green energies and electric transportation. The deployments of photovoltaic (PV) and electric vehicle (EV) systems gained stronger momentum due to their numerous advantages over fossil fuel types. The advantages go beyond sustainability to reach financial support and stability. The work in this paper introduces the hybrid system between PV and EV to support industrial and commercial plants. This paper covers the theoretical framework of the proposed hybrid system including the required equation to complete the cost analysis when PV and EV are present. In addition, the proposed design diagram which sets the priorities and requirements of the system is presented. The proposed approach allows setup to advance their power stability, especially during power outages. The presented information supports researchers and plant owners to complete the necessary analysis while promoting the deployment of clean energy. The result of a case study that represents a dairy milk farmer supports the theoretical works and highlights its advanced benefits to existing plants. The short return on investment of the proposed approach supports the paper's novelty approach for the sustainable electrical system. In addition, the proposed system allows for an isolated power setup without the need for a transmission line which enhances the safety of the electrical network
We have compiled the most important slides from each speaker's presentation. This year’s compilation, available for free, captures the key insights and contributions shared during the DfMAy 2024 conference.
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELgerogepatton
As digital technology becomes more deeply embedded in power systems, protecting the communication
networks of Smart Grids (SG) has emerged as a critical concern. Distributed Network Protocol 3 (DNP3)
represents a multi-tiered application layer protocol extensively utilized in Supervisory Control and Data
Acquisition (SCADA)-based smart grids to facilitate real-time data gathering and control functionalities.
Robust Intrusion Detection Systems (IDS) are necessary for early threat detection and mitigation because
of the interconnection of these networks, which makes them vulnerable to a variety of cyberattacks. To
solve this issue, this paper develops a hybrid Deep Learning (DL) model specifically designed for intrusion
detection in smart grids. The proposed approach is a combination of the Convolutional Neural Network
(CNN) and the Long-Short-Term Memory algorithms (LSTM). We employed a recent intrusion detection
dataset (DNP3), which focuses on unauthorized commands and Denial of Service (DoS) cyberattacks, to
train and test our model. The results of our experiments show that our CNN-LSTM method is much better
at finding smart grid intrusions than other deep learning algorithms used for classification. In addition,
our proposed approach improves accuracy, precision, recall, and F1 score, achieving a high detection
accuracy rate of 99.50%.
Understanding Inductive Bias in Machine LearningSUTEJAS
This presentation explores the concept of inductive bias in machine learning. It explains how algorithms come with built-in assumptions and preferences that guide the learning process. You'll learn about the different types of inductive bias and how they can impact the performance and generalizability of machine learning models.
The presentation also covers the positive and negative aspects of inductive bias, along with strategies for mitigating potential drawbacks. We'll explore examples of how bias manifests in algorithms like neural networks and decision trees.
By understanding inductive bias, you can gain valuable insights into how machine learning models work and make informed decisions when building and deploying them.
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...University of Maribor
Slides from talk presenting:
Aleš Zamuda: Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapter and Networking.
Presentation at IcETRAN 2024 session:
"Inter-Society Networking Panel GRSS/MTT-S/CIS
Panel Session: Promoting Connection and Cooperation"
IEEE Slovenia GRSS
IEEE Serbia and Montenegro MTT-S
IEEE Slovenia CIS
11TH INTERNATIONAL CONFERENCE ON ELECTRICAL, ELECTRONIC AND COMPUTING ENGINEERING
3-6 June 2024, Niš, Serbia
A review on techniques and modelling methodologies used for checking electrom...nooriasukmaningtyas
The proper function of the integrated circuit (IC) in an inhibiting electromagnetic environment has always been a serious concern throughout the decades of revolution in the world of electronics, from disjunct devices to today’s integrated circuit technology, where billions of transistors are combined on a single chip. The automotive industry and smart vehicles in particular, are confronting design issues such as being prone to electromagnetic interference (EMI). Electronic control devices calculate incorrect outputs because of EMI and sensors give misleading values which can prove fatal in case of automotives. In this paper, the authors have non exhaustively tried to review research work concerned with the investigation of EMI in ICs and prediction of this EMI using various modelling methodologies and measurement setups.
A review on techniques and modelling methodologies used for checking electrom...
Hospital management
1. #include<iostream>
#include<conio.h>
#include<fstream>
#include<cstring>
#include<stdlib.h>
using namespace std;
class password
{
string code;
public:
void get_password();
int verify_password(string);
};
void password::get_password()
{
cout << "Setting Up The P10 Hospital Management System.....n";
cout << "nPlease Choose A Password For Your System :";
START:
code.clear();
char ch;
int count = 0;
ch = _getch();
while (ch != 13)
{
if (ch == 8)
{
cout << "b b";
// code.pop_back();
}
if (ch != 8)
{
cout << "*";
code.push_back(ch);
}
ch = _getch();
count++;
}
if (count < 5)
{
cout << "nnYour Password Should Have Minimum Of 5
Characters!!!n";
cout << "n Please Choose A Password For Your System :";
goto START;
}
}
int password::verify_password(string pass)
{
if (pass == code)
return(1);
}
class doctor
{
int id;
int code;
char name[50];
int age;
char qualification[10];
char specilization[10];
int experience;
char state[50];
2. char city[50];
public:
//int id;
int get_ID();
void get_info();
void get_name();
void get_age();
void get_code();
void get_qualification();
void get_specilization();
void get_experience();
void get_state();
void get_city();
int verify_specilization(int opt,int flag);
void display_all(doctor d);
void display_info(doctor d);
void modify_info(doctor d, int number,int size);
};
void add_doctor_data();
int verify_alphabet(char* arr,int size);
void modify_doctor_data();
void delete_contents();
void delete_contents1();
void display();
void delete_doctor_data();
int display_doctor_data();
int doctor_number();
long int get_size_of_the_file();
int verify_alphabet(char* arr, int size)
{
int i = 0;
for (i = 0; i < size; i++)
{
if (isdigit(arr[i]))
{
return(1);
}
}
}
int doctor_number()
{
long int size;
size = get_size_of_the_file();
doctor d;
size = size / (sizeof(d));
return(size);
}
int doctor::verify_specilization(int opt,int flag)
{
if (opt == code)
{
flag++;
cout <<"n"<<"ID------------->t"<< get_ID();
return(flag);
}
else
{
return(flag);
}
}
int doctor::get_ID()
3. {
return(id);
}
void doctor::get_info()
{
cout << "nEnter Doctor's ID :";
cin >> id;
NAME:
cout << "nEnter Doctor's Name :";
cin.ignore();
cin.getline(name, 50);
int flag;
int size=strlen(name);
flag=verify_alphabet(name,size);
if (flag == 1)
{
cout << "nnName should consist of only alphabets or min of three
alphabets!!!n";
cout << "n";
system("PAUSE");
//goto NAME;
}
cout << "nEnter Doctor's Age :";
cin >> age;
QUALIFICATION:
cout << "nEnter Doctor's Qualification :";
cin.ignore();
cin.getline(qualification, 50);
size = strlen(qualification);
flag = verify_alphabet(qualification, size);
if (flag == 1)
{
cout << "nQualification should consist of only alphabets or min of
three alphabets!!!n";
cout << "n";
system("PAUSE");
goto QUALIFICATION;
}
SPECILIZATION:
cout << "nEnter Doctor's Specialization :";
cin.getline(specilization, 50);
size = strlen(specilization);
flag = verify_alphabet(specilization, size);
if (flag == 1)
{
cout << "nSpecilization should consist of only alphabets or min of
three alphabets!!!n";
cout << "n";
system("PAUSE");
goto SPECILIZATION;
}
cout <<
"*******************************************************************************
*";
cout << "ntttCodes For Various Specilizationsn";
cout <<
"*******************************************************************************
*";
cout << "n1.General Medicinen2.Cardiologyn3.Neurologyn4.ENTn";
cout <<
"*******************************************************************************
*";
4. cout << "nSelect The Code Basing On The Specilization :";
cin >> code;
cout <<
"*******************************************************************************
*";
cout << "nEnter Doctor's Experience :";
cin >> experience;
STATE:
cout << "nEnter Doctor's State :";
cin.ignore();
cin.getline(state, 30);
size = strlen(state);
flag = verify_alphabet(state, size);
if (flag == 1)
{
cout << "nState should consist of only alphabets or min of three
alphabets!!!n";
cout << "n";
system("PAUSE");
goto STATE;
}
CITY:
cout << "nEnter Doctor's City :";
cin.getline(city, 30);
size = strlen(city);
flag = verify_alphabet(city, size);
if (flag == 1)
{
cout << "nCity should consist of only alphabets!!! or min of three
alphabetsn";
cout << "n";
system("PAUSE");
goto CITY;
}
}
void doctor::get_name()
{
NAME:
cin.ignore();
cout << "nEnter New Name :";
cin >> name;
int flag;
int size = strlen(name);
flag = verify_alphabet(name, size);
if (flag == 1)
{
cout << "nName should consist of only alphabets or min of three
alphabets!!!n";
cout << "n";
system("PAUSE");
goto NAME;
}
}
void doctor::get_age()
{
cin.ignore();
cout << "nEnter New Age :";
cin >> age;
}
void doctor::get_qualification()
{
QUALIFICATION:
5. cin.ignore();
cout << "nEnter New Qualification :";
cin >> specilization;
int flag;
int size = strlen(qualification);
flag = verify_alphabet(qualification, size);
if (flag == 1)
{
cout << "nQualification should consist of only alphabets or min of
three alphabets!!!n";
cout << "n";
system("PAUSE");
goto QUALIFICATION;
}
}
void doctor::get_specilization()
{
SPECILIZATION:
cin.ignore();
cout << "nEnter New Specilization :";
cin >> specilization;
int flag;
int size = strlen(specilization);
flag = verify_alphabet(specilization, size);
if (flag == 1)
{
cout << "nSpecilization should consist of only alphabets or min of
three alphabets!!!n";
cout << "n";
system("PAUSE");
goto SPECILIZATION;
}
cout <<
"*******************************************************************************
*";
cout << "nCodes For Various Specilizationsn";
cout <<
"*******************************************************************************
*";
cout << "n1.General Medicinen2.Cardiologyn3.Neurologyn4.ENTn";
cout <<
"*******************************************************************************
*";
cout << "nSelect The Code Basing On The Specilization ";
cin >> code;
}
void doctor::get_experience()
{
cin.ignore();
cout << "nEnter New Experience :";
cin >> experience;
}
void doctor::get_state()
{
STATE:
cin.ignore();
cout << "nEnter New State :";
cin >> state;
int flag;
int size = strlen(state);
flag = verify_alphabet(state, size);
if (flag == 1)
{
cout << "nState should consist of only alphabets or min of three
6. alphabets!!!n";
cout << "n";
system("PAUSE");
goto STATE;
}
}
void doctor::get_city()
{
CITY:
cin.ignore();
cout << "nEnter New City :";
cin >> city;
int flag;
int size = strlen(city);
flag = verify_alphabet(city, size);
if (flag == 1)
{
cout << "nCity should consist of only alphabets(or)min of three
alphabets!!!n";
cout << "n";
system("PAUSE");
goto CITY;
}
}
void doctor::display_info(doctor d)
{
cout << "nDoctor's ID :t "<< d.id;
cout << "nDoctor's Name :t" << d.name;
cout << "nDoctor's Age :t" << d.age;
cout << "nDoctor's Qualification :t" << d.qualification;
cout << "nDoctor's Specilization :t" << d.specilization;
cout << "nDoctor's Experience :t" << d.experience;
cout << "nDoctor's State :t" << d.state;
cout << "nDoctor's City :t" << d.city;
}
void doctor::display_all(doctor d)
{
cout <<"t"<< d.id << "tt" << d.specilization << "ttt" <<
d.qualification << "ttt" << d.age<<"n";
}
void doctor::modify_info(doctor d, int number,int size)
{
if (number == 1)
{
fstream myfile6("doctor8.txt",ios::in|ios::out);
doctor d1 = d;
d1.get_name();
myfile6.seekp(size, ios::beg);
myfile6.write((char*)&d1, sizeof(d1));
cout << "n";
cout << "n";
system("PAUSE");
system("CLS");
cout << "nData Successfully Modifiedn";
myfile6.close();
cout << " n";
system("PAUSE");
}
else if (number == 2)
{
fstream myfile6("doctor8",ios::in|ios::out);
doctor d1 = d;
d1.get_age();
myfile6.seekp(size,ios::beg);
10. {
return(id);
}
void patient::set_doc_ID()
{
cout << "nPlease Select Your Choice :";
cin >> doc_id;
}
void patient::get_info()
{
cout << "nEnter Patient's ID :";
cin >> id;
NAME:
cout << "nEnter Patient's Name :";
cin.ignore();
cin.getline(name, 50);
int flag;
int size = strlen(name);
flag = verify_alphabet(name, size);
if (flag == 1)
{
cout << "nnName should consist of only alphabets or min of three
alphabets!!!n";
cout << "n";
system("PAUSE");
goto NAME;
}
cout << "nEnter Patient's Age :";
cin >> age;
OCCUPATION:
cout << "nEnter Patient's Occupation :";
cin.ignore();
cin.getline(occupation, 30);
size = strlen(occupation);
flag = verify_alphabet(occupation, size);
if (flag == 1)
{
cout << "nnOccupation should consist of only alphabets or min of
three alphabets!!!n";
cout << "n";
system("PAUSE");
goto OCCUPATION;
}
STATE:
cout << "nEnter Patient's state :";
cin.getline(state, 30);
size = strlen(state);
flag = verify_alphabet(state, size);
if (flag == 1)
{
cout << "nnState should consist of only alphabets or min of three
alphabets!!!n";
cout << "n";
system("PAUSE");
goto STATE;
}
CITY:
cout << "nEnter Patient's City :";
cin.getline(city, 30);
size = strlen(city);
flag = verify_alphabet(city, size);
if (flag == 1)
{
11. cout << "nnCity should consist of only alphabets or min of three
alphabets!!!n";
cout << "n";
system("PAUSE");
goto CITY;
}
NATIONALITY:
cout << "nEnter Patient's Nationality :";
cin.getline(nationality, 30);
size = strlen(nationality);
flag = verify_alphabet(nationality, size);
if (flag == 1)
{
cout << "nnNationality should consist of only alphabets or min of
three alphabets!!!n";
cout << "n";
system("PAUSE");
goto NATIONALITY;
}
cout << "nEnter Patient's Phone Number :";
cin.getline(phone_no, 20);
cout << "nEnter Patient's Street Name :";
cin.getline(street, 30);
cout << "nEnter Patient's Symptoms :";
cin.getline(symptoms, 70);
cout << "nEnter Patient's Disease :";
cin.getline(disease, 30);
cout << "nEnter Patient's Door Number :";
cin.getline(door_no, 20);
cout << "nEnter Patient's Condition :";
cin.getline(condition, 30);
cout << "nEnter Admission Date Of The Patient :";
cin.getline(date_admitted, 20);
cout << "nEnter Discharge Date Of The Patient :";
cin.getline(date_discharged, 20);
cout << "nEnter Condition Of The Patient At The Time Of The Discharge :";
cin.getline(discharge_condition, 50);
cout << "nEnter The Patient's Next Consultation Date :";
cin.getline(consultation_date, 30);
cout << "nEnter The Patient's Bill
Charges :";
cin >> bill;
}
void patient::assign_patient_to_doctor(patient p, int size)
{
long int size1 = size;
ifstream myfile1("doctor8.txt");
size = get_size_of_the_file();
doctor d;
size = size / (sizeof(d));
cout <<
"*******************************************************************************
*";
cout << "nt The Following Are The Specilizations Available In The
Hospitaln";
cout <<
"*******************************************************************************
*";
cout << "n1.General Medicinen2.Cardiologyn3.Neurologyn4.ENTn";
cout <<
"*******************************************************************************
*";
cout << "nnPlease Select Your Choice :";
12. int opt,flag=0;
int cho;
cin >> opt;
myfile1.seekg(0);
switch (opt)
{
case 1:
system("CLS");
cout <<
"*******************************************************************************
*";
cout << "nttID's Of The Doctors With The General Medicine
Specilizationn";
cout <<
"*******************************************************************************
*";
for (int i = 0; i < size; i++)
{
cout << "n";
myfile1.read((char*)&d, sizeof(d));
flag = d.verify_specilization(opt,flag);
}
myfile1.close();
if (flag == 0)
{
system("CLS");
cout <<
"*******************************************************************************
*";
cout << "nSorry!No Doctors Are Available With The Required
Specilizationn";
cout <<
"*******************************************************************************
*";
cout << "nn";
system("PAUSE");
}
else
{
cout << "n";
cout <<
"*******************************************************************************
****";
fstream myfile6("patient11.txt", ios::in | ios::out);
patient p1 = p;
myfile6.seekp(0);
myfile6.seekg(0);
p1.set_doc_ID();
myfile6.seekp(size1, ios::beg);
myfile6.write((char*)&p1, sizeof(p1));
system("CLS");
cout << "nPatient Has Been Assigned A Doctor Successfully";
cout << "n";
cout <<
"n*****************************************************************************
";
cout << "nn";
system("PAUSE");
}
break;
case 2:
system("CLS");
cout <<
13. "*******************************************************************************
*";
cout << "nttID's Of The Doctors With The Cardiology
Specilizationn";
cout <<
"*******************************************************************************
*";
for (int i = 0; i < size; i++)
{
cout << "n";
myfile1.read((char*)&d, sizeof(d));
flag = d.verify_specilization(opt,flag);
}
if (flag == 0)
{
system("CLS");
cout <<
"*******************************************************************************
*";
cout << "nSorry!No Doctors Are Available With The Required
Specilizationn";
cout <<
"*******************************************************************************
*";
cout << "nn";
system("PAUSE");
}
else
{
cout << "n";
cout <<
"*******************************************************************************
*";
fstream myfile6("patient11.txt", ios::in | ios::out);
patient p1 = p;
myfile6.seekp(0);
myfile6.seekg(0);
p1.set_doc_ID();
myfile6.seekp(size1, ios::beg);
myfile6.write((char*)&p1, sizeof(p1));
system("CLS");
cout << "nPatient Has Been Assigned A Doctor Successfully";
cout << "n";
cout <<
"n*****************************************************************************
";
cout << "nn";
system("PAUSE");
}
break;
case 3:
system("CLS");
cout <<
"*******************************************************************************
*";
cout << "nttID's Of The Doctors With The Neurology
Specilizationn";
cout <<
"*******************************************************************************
*";
for (int i = 0; i < size; i++)
{
cout << "n";
myfile1.read((char*)&d, sizeof(d));
14. flag = d.verify_specilization(opt,flag);
}
if (flag == 0)
{
system("CLS");
cout <<
"*******************************************************************************
*";
cout << "nSorry!No Doctors Are Available With The Required
Specilizationn";
cout <<
"*******************************************************************************
*";
cout << "nn";
system("PAUSE");
}
else
{
cout << "n";
cout <<
"*******************************************************************************
*";
fstream myfile6("patient11.txt", ios::in | ios::out);
patient p1 = p;
myfile6.seekp(0);
myfile6.seekg(0);
p1.set_doc_ID();
myfile6.seekp(size1, ios::beg);
myfile6.write((char*)&p1, sizeof(p1));
system("CLS");
cout << "nPatient Has Been Assigned A Doctor Successfully";
cout << "n";
cout <<
"n*****************************************************************************
";
cout << "nn";
system("PAUSE");
}
break;
case 4:
system("CLS");
cout <<
"*******************************************************************************
*";
cout << "nttID's Of The Doctors With The ENT Specilizationn";
cout <<
"*******************************************************************************
*";
for (int i = 0; i < size; i++)
{
cout << "n";
myfile1.read((char*)&d, sizeof(d));
flag = d.verify_specilization(opt,flag);
}
if (flag == 0)
{
system("CLS");
cout <<
"*******************************************************************************
*";
cout << "nSorry!No Doctors Are Available With The Required
Specilizationn";
cout <<
15. "*******************************************************************************
*";
cout << "nn";
system("PAUSE");
}
else
{
cout << "n";
cout <<
"*******************************************************************************
*";
fstream myfile6("patient11.txt", ios::in | ios::out);
patient p1 = p;
myfile6.seekp(0);
myfile6.seekg(0);
p1.set_doc_ID();
myfile6.seekp(size1, ios::beg);
myfile6.write((char*)&p1, sizeof(p1));
system("CLS");
cout << "nPatient Has Been Assigned A Doctor Successfully";
cout << "n";
cout <<
"n*****************************************************************************
";
cout << "nn";
system("PAUSE");
}
break;
default:
cout << "nWrong Choice!!!";
}
}
void patient::get_name()
{
cout << "nEnter New Name :";
cin.ignore();
cin.getline(name, 50);
}
void patient::get_age()
{
cout << "nEnter New Age :";
cin.ignore();
cin >> age;
}
void patient::get_occupation()
{
cout << "nEnter New Occupation :";
cin.ignore();
cin.getline(occupation, 50);
}
void patient::get_state()
{
cin.ignore();
cout << "nEnter New State :";
cin.getline(state, 20);
}
void patient::get_city()
{
cin.ignore();
cout << "nEnter New City :";
cin.getline(city, 20);
}
16. void patient::get_phone_no()
{
cin.ignore();
cout << "nEnter New Phone Number :";
cin.getline(phone_no, 30);
}
void patient::get_nationality()
{
cin.ignore();
cout << "nEnter New Nationality :";
cin.getline(nationality, 30);
}
void patient::get_street()
{
cin.ignore();
cout << "nEnter New Street :";
cin.getline(street, 50);
}
void patient::get_door_no()
{
cin.ignore();
cout << "nEnter New Door Number :";
cin.getline(door_no, 30);
}
void patient::get_condition()
{
cin.ignore();
cout << "nEnter New Condition :";
cin.getline(condition, 50);
}
void patient::get_discharge_condition()
{
cin.ignore();
cout << "nEnter New Condition Of The Patient At The Time Of Discharge :";
cin.getline(discharge_condition, 50);
}
void patient::get_date_admitted()
{
cin.ignore();
cout << "nEnter New Admission Date Of The Patient :";
cin.getline(date_admitted, 30);
}
void patient::get_date_discharged()
{
cin.ignore();
cout << "nEnter New Discharge Date Of The Patient :";
cin.getline(date_discharged, 30);
}void patient::get_bill()
{
cin.ignore();
cout << "nEnter New Bill Charge Of The Patient :";
cin >> bill;
}
void patient::display_all(patient p)
{
cout << p.id << "t" << p.age << "t" << p.symptoms << "t" <<
p.date_admitted << "ttt"<<p.doc_id<<"n";
}
void patient::display_info(patient p)
{
cout << "nPatient's ID :" << p.id;
cout << "nPatient's Name :" <<
p.name;
cout << "nPatient's Age :" << p.age;
17. cout << "nPatient's Occupation :" <<
p.occupation;
cout << "nPatient's State :" <<
p.state;
cout << "nPatient's City :" <<
p.city;
cout << "nPatient's Phone Number :" <<
p.phone_no;
cout << "nPatient's Nationality :" <<
p.nationality;
cout << "nPatient's Street :" <<
p.street;
cout << "nPatient's Door Number :" <<
p.door_no;
cout << "nPatient's Condtion :" <<
p.condition;
cout << "nPatient's Condition At The Time Of Discharge :" <<
p.discharge_condition;
cout << "nPatient's Admission Date :" <<
p.date_admitted;
cout << "nPatient's Discharge Date :" <<
p.date_discharged;
cout << "nID Of The Doctor Who Is Treating The Patient :" <<
p.doc_id;
}
void patient::modify_info(patient p, int number, int size)
{
if (number == 1)
{
fstream myfile6("patient11.txt", ios::in | ios::out);
patient p1 = p;
p1.get_name();
myfile6.seekp(size, ios::beg);
myfile6.write((char*)&p1, sizeof(p1));
int total = myfile6.tellp();
total /= sizeof(p1);
cout << "nn";
system("PAUSE");
system("CLS");
cout << "nData Successfully Modifiedn";
myfile6.close();
cout << "n";
system("PAUSE");
}
else if (number == 2)
{
fstream myfile6("patient11.txt", ios::in | ios::out);
patient p1 = p;
p1.get_age();
myfile6.seekp(size, ios::beg);
myfile6.write((char*)&p1, sizeof(p1));
int total = myfile6.tellp();
total /= sizeof(p1);
cout << "nn";
system("PAUSE");
system("CLS");
cout << "nData Successfully Modifiedn";
myfile6.close();
cout << "n";
system("PAUSE");
}
else if (number == 3)
{
fstream myfile6("patient11.txt", ios::in | ios::out);
22. START2:
count++;
cout << "nPlease Enter Your Password To Enter Into This
Database :";
pass.clear();
c = _getch();
while (c != 13)
{
if (c == 8)
cout << "b b";
if (c != 8)
{
cout << "*";
pass.push_back(c);
}
c = _getch();
}
x = p.verify_password(pass);
if (x == 1)
{
cout << "nnAccess Granted ";
cout << "nn";
system("PAUSE");
system("CLS");
while (1)
{
system("CLS");
cout <<
"*******************************************************************************
*n";
cout << "ntttWelcome to Doctor's Databasen";
cout <<
"n*****************************************************************************
***n";
cout << "ntt1.Add New Doctor's Informationn";
cout << "ntt2.Edit Doctor's Informationn";
cout << "ntt3.Display Doctor's Informationn";
cout << "ntt4.Delete Doctor's Informationn";
cout << "ntt5.Number Of Doctors In The
Hospitaln";
cout << "ntt6.Clear All The Information In The
Databasen";
cout << "ntt7.Display The Details Of All The
Doctorsn";
cout << "ntt8.Exitn";
cout <<
"n*****************************************************************************
***n";
int opt;
cout << "Please Choose Your Choice :";
cin >> opt;
int y;
switch (opt)
{
case 1:
system("CLS");
add_doctor_data();
break;
case 2:
system("CLS");
modify_doctor_data();
23. break;
case 3:
system("CLS");
y = display_doctor_data();
if (y != 1)
{
cout << "nNo Record To
Display!!!n";
cout << "n";
system("PAUSE");
}
break;
case 4:
system("CLS");
delete_doctor_data();
cout << "n";
system("PAUSE");
break;
case 5:
system("CLS");
cout << "nNumber Of Doctors In The Hospital
are :" << doctor_number();
cout << "nn";
system("PAUSE");
break;
case 6:
system("CLS");
delete_contents();
cout << "nAll The Contents Of The Database
Are Deleted ";
cout << "nn";
system("PAUSE");
break;
case 7:
system("CLS");
display();
cout << "nn";
system("PAUSE");
break;
case 8:
system("CLS");
goto START3;
_getch();
break;
}
}
}
else
{
if (count >= 3)
{
system("CLS");
cout << "nnAccess Denied!!!You Have Entered
Wrong Password Too Many Timesn";
cout << "nThis System Will Shut Down.Please Come
Back Againn";
cout << "nThank Youn";
cout << "n";
system("PAUSE");
exit(0);
}
24. cout << "nnWrong Password.Access Denied!!!n";
goto START2;
}
case 2:
system("CLS");
START4:
count++;
cout << "nPlease Enter Your Password To Enter Into This
Database :";
pass.clear();
c = _getch();
while (c != 13)
{
if (c == 8)
{
cout << "b b";
//pass.pop_back(c);
}
if (c != 8)
{
cout << "*";
pass.push_back(c);
}
c = _getch();
}
x = p.verify_password(pass);
if (x == 1)
{
cout << "nnAccess Granted ";
cout << "nn";
system("PAUSE");
system("CLS");
while (1)
{
system("CLS");
cout <<
"*******************************************************************************
*n";
cout << "ntttWelcome To Patient's
Databasenn";
cout <<
"*******************************************************************************
*n";
cout << "ntt1.Add Patient's Informationn";
cout << "ntt2.Assign A Patient To A Doctorn";
cout << "ntt3.Edit Patient's Informationn";
cout << "ntt4.Display Patient's Informationn";
cout << "ntt5.Delete Patient's Informationn";
cout << "ntt6.No.Of Patients In The
Hospitaln";
cout << "ntt7.Delete All The Contents In The
Databasen";
cout << "ntt8.Display The Details Of All The
Patients In The Hospitaln";
cout << "ntt9.Exitnn";
cout <<
"*******************************************************************************
*n";
int opt;
cout << "nPlease Choose Your Choice :";
cin >> opt;
int y;
switch (opt)
{
25. case 1:
system("CLS");
add_patient_data();
break;
case 2:
system("CLS");
assign_patient();
break;
case 3:
system("CLS");
modify_patient_data();
break;
case 4:
system("CLS");
y = display_patient_data();
if (y != 1)
{
cout << "nNo Record To Display!!!n";
cout << "n";
system("PAUSE");
}
break;
case 5:
system("CLS");
delete_patient_data();
cout << "n";
system("PAUSE");
break;
case 6:
system("CLS");
cout << "nNo.Of Patient's In The Hospital
are :" << number();
cout << "nn";
system("PAUSE");
break;
case 7:
system("CLS");
delete_contents1();
cout << "nAll The Contents Of The Database
Are Deleted";
cout << "nn";
system("PAUSE");
break;
case 8:
system("CLS");
display1();
cout << "nn";
system("PAUSE");
break;
case 9:
system("CLS");
goto START3;
_getch();
}
}
}
else
{
if (count >= 3)
{
system("CLS");
cout << "nnAccess Denied!!!You Have Entered
Wrong Password Too Many Timesn";
26. cout << "nThis System Will Shut Down.Please Come
Back Againn";
cout << "nThank Youn";
cout << "n";
system("PAUSE");
exit(0);
}
cout << "nnWrong Password.Access Denied!!!n";
goto START4;
}
case 3:
system("CLS");
cout << "nn";
report();
cout << "nn";
system("PAUSE");
goto START3;
break;
case 4:
system("CLS");
bill();
cout << "nn";
system("PAUSE");
system("CLS");
goto START3;
break;
case 5:
cout << "n";
cout << "n";
goto START1;
default:
cout << "nWrong Choice ";
}
break;
case 2:
cout << "nn";
exit(0);
break;
default:
cout << "nWrong Choice ";
}
_getch();
}
void add_doctor_data()
{
doctor d;
ofstream myfile("doctor8.txt",ios::in|ios::app);
d.get_info();
myfile.write((char*)&d, sizeof(d));
myfile.close();
}
void display()
{
long int size = 0;
size = get_size_of_the_file();
int i = 0;
doctor d;
size = size / (sizeof(d));
if (size == 0)
{
cout << "nDatabase Empty!!!";
cout << "n";
27. }
else
{
cout << "n" ;
cout <<
"*******************************************************************************
*";
cout << "ntttDetails Of All The Doctors In The
Hospitaln";
cout <<
"*******************************************************************************
*";
cout <<"nt"<< "ID" << "tt" << "Specilization" << "tt" <<
"Qualification" << "tt" << "Age" << "n";
ifstream myfile("doctor8.txt");
myfile.seekg(0);
for (i = 0; i < size; i++)
{
cout << "nn";
myfile.read((char*)&d, sizeof(d));
d.display_all(d);
}
cout <<
"*******************************************************************************
*";
}
}
int display_doctor_data()
{
long int size = 0;
size = get_size_of_the_file();
int i = 0, id, id1, count = 0;
doctor d1;
size = size / (sizeof(d1));
if (size == 0)
{
cout << "nDatabase Empty!!!";
cout << "n";
}
else
{
cout << "nEnter The ID Of the Doctor You require :";
cin >> id;
ifstream myfile1("doctor8.txt");
for (i = 0; i < size; i++)
{
myfile1.clear();
myfile1.read((char*)&d1, sizeof(d1));
id1 = d1.get_ID();
if (id == id1)
{
count = 1;
d1.display_info(d1);
cout << "n";
cout << "n";
system("PAUSE");
cout << "n";
break;
}
}
myfile1.close();
28. return(count);
}
}
void modify_doctor_data()
{
int id1;
long int size = 0;
size = get_size_of_the_file();
int i = 0, count = 0, id;
doctor d2;
size = size / (sizeof(d2));
if (size == 0)
{
cout << "nDatabase Empty!!!n";
cout << "nNo Record To Modify!!!";
cout << "nn";
system("PAUSE");
}
else
{
cout << "nEnter The ID Of The Doctor To Modify Data :";
cin >> id1;
ifstream myfile2("doctor8.txt");
for (i = 0; i < size; i++)
{
myfile2.clear();
myfile2.read((char*)&d2, sizeof(d2));
id = d2.get_ID();
if (id == id1)
{
size = myfile2.tellg();
size = size - sizeof(d2);
count = 1;
d2.display_info(d2);
cout << "nn";
system("PAUSE");
cout << "n";
cout << "nField's Which Can Be Modifiedn";
cout << "n1.Namen2.Agen3.Qualificationn";
cout <<
"4.Specilizationn5.Experiencen6.Staten";
cout << "7.Cityn";
int opt2;
cout << "nSelect The Field Which You Want To
Modify :";
cin >> opt2;
switch (opt2)
{
case 1:
d2.modify_info(d2, opt2, size);
break;
case 2:
d2.modify_info(d2, opt2, size);
break;
case 3:
d2.modify_info(d2, opt2, size);
break;
case 4:
d2.modify_info(d2, opt2, size);
break;
case 5:
d2.modify_info(d2, opt2, size);
break;
29. case 6:
d2.modify_info(d2, opt2, size);
break;
case 7:
d2.modify_info(d2, opt2, size);
break;
default:
cout << "nWrong Choice ";
}
break;
}
}
myfile2.close();
if (count == 0)
{
cout << "nRecord Does'nt Exist!!!";
cout << "n";
system("PAUSE");
}
}
}
void delete_contents()
{
ofstream myfile("doctor8.txt");
myfile.close();
}
void delete_contents1()
{
ofstream myfile("patient11.txt");
myfile.close();
}
void delete_doctor_data()
{
long int size;
size = get_size_of_the_file();
doctor d;
size = size / (sizeof(d));
if (size == 0)
{
cout << "nDatabase Empty!!!";
cout << "nnNo Record To Delete!!!";
cout << "n";
}
else
{
ifstream myfile6("doctor8.txt");
ofstream myfile7("temp1.txt");
int id, count = 0, id1, i;
cout << "nEnter The ID Of The Doctor Whose Data You Want To
Delete :";
cin >> id;
for (i = 0; i < size; i++)
{
myfile6.read((char*)&d, sizeof(d));
id1 = d.get_ID();
if (id != id1)
{
myfile7.write((char*)&d, sizeof(d));
}
else
{
30. count = 1;
}
}
myfile6.close();
myfile7.close();
ofstream myfile9("doctor8.txt");
ifstream myfile8("temp1.txt");
for (i = 0; i < size - 1; i++)
{
myfile8.read((char*)&d, sizeof(d));
myfile9.write((char*)&d, sizeof(d));
}
if (count == 0)
{
cout << "nNo Data Found ";
cout << "nn";
system("PAUSE");
}
else
{
cout << "nData Successfully Deletedn";
}
}
}
long int get_size_of_the_file()
{
long int size=0;
ifstream ifile("doctor8.txt");
ifile.seekg(0, ios::end);
size = ifile.tellg();
ifile.close();
return(size);
}
void add_patient_data()
{
patient p;
ofstream myfile("patient11.txt", ios::in | ios::app);
p.get_info();
myfile.write((char*)&p, sizeof(p));
myfile.close();
}
void display1()
{
long int size = 0;
size = get_size_of_the_file1();
int i = 0;
patient p;
size = size / (sizeof(p));
if (size == 0)
{
cout << "nDatabase Empty!!!";
cout << "n";
}
else
{
cout << "n";
cout <<
"*******************************************************************************
*";
31. cout << "ntttDetails Of All The Patients In The
Hospitaln";
cout <<
"*******************************************************************************
*";
cout <<"n" "ID" << "t" << "Age" << "t" << "Illness" <<
"tt" << "Date Admitted" << "tt"<<"Doctor's ID"<<"n";
ifstream myfile("patient11.txt");
myfile.seekg(0);
for (i = 0; i < size; i++)
{
cout << "nn";
myfile.read((char*)&p, sizeof(p));
p.display_all(p);
}
cout <<
"*******************************************************************************
*";
}
}
int display_patient_data()
{
long int size = 0;
size = get_size_of_the_file1();
int i = 0, id, id1, count1 = 0;
patient p1;
size = size / (sizeof(p1));
if (size == 0)
{
cout << "nDatabase Empty!!!";
cout << "n";
}
else
{
cout << "nEnter The ID Of The Patient You Require :";
cin >> id;
ifstream myfile1("patient11.txt");
for (i = 0; i < size; i++)
{
myfile1.clear();
myfile1.read((char*)&p1, sizeof(p1));
id1 = p1.get_ID();
if (id == id1)
{
count1 = 1;
p1.display_info(p1);
cout << "nn";
system("PAUSE");
cout << "n";
break;
}
}
myfile1.close();
return(count1);
}
}
void assign_patient()
{
32. patient p;
int id;
long int size;
size = get_size_of_the_file1();
int i = 0, count = 0, id1;
size = size / (sizeof(p));
if (size == 0)
{
cout << "n Database Empty!!!n";
cout << "nYou Need To Add Patient's Information First!!!";
cout << "nn";
system("PAUSE");
}
else
{
cout << "nEnter ID Of The Patient :";
cin >> id;
ifstream myfile("patient11.txt");
myfile.seekg(0);
for (i = 0; i < size; i++)
{
myfile.read((char*)&p, sizeof(p));
id1 = p.get_ID();
if (id == id1)
{
count = 1;
size = myfile.tellg();
size = size - sizeof(p);
p.assign_patient_to_doctor( p, size);
break;
}
}
if (count == 0)
{
system("CLS");
cout <<
"*******************************************************************************
*";
cout << "nSorry!No Data Is Available Related To The
Given IDn";
cout <<
"*******************************************************************************
*";
cout << "nn";
system("PAUSE");
}
}
}
void modify_patient_data()
{
int id1;
long int size = 0;
size = get_size_of_the_file1();
int i = 0, count = 0, id;
patient p2;
size = size / (sizeof(p2));
if (size == 0)
{
cout << "nDatabase Empty!!!n";
cout << "nNo Record To Modify!!!";
cout << "nn";
system("PAUSE");
33. }
else
{
cout << "nEnter The ID Of The Patient To Modify Data :";
cin >> id1;
ifstream myfile2("patient11.txt");
myfile2.seekg(0);
for (i = 0; i < size; i++)
{
myfile2.read((char*)&p2, sizeof(p2));
id = p2.get_ID();
if (id == id1)
{
size = myfile2.tellg();
size = size - sizeof(p2);
count = 1;
p2.display_info(p2);
cout << "n";
system("PAUSE");
cout << "n";
cout << "nField's Which Can Be Modifiedn";
cout <<
"n1.Namen2.Agen3.Occupationn4.Staten";
cout << "5.Cityn6.Phone Numbern7.Nationalityn";
cout << "n8.Streetn9.Door
Numbern10.Conditionn";
cout << "11.Discharge Conditionn12.Date
Admittedn";
cout << "13.Date Dischargedn14.Patient Bill";
int opt2;
cout << "nSelect The Field Which You Want To
Modify :";
cin >> opt2;
switch (opt2)
{
case 1:
p2.modify_info(p2, opt2, size);
break;
case 2:
p2.modify_info(p2, opt2, size);
break;
case 3:
p2.modify_info(p2, opt2, size);
break;
case 4:
p2.modify_info(p2, opt2, size);
break;
case 5:
p2.modify_info(p2, opt2, size);
break;
case 6:
p2.modify_info(p2, opt2, size);
break;
case 7:
p2.modify_info(p2, opt2, size);
break;
case 8:
p2.modify_info(p2, opt2, size);
break;
case 9:
p2.modify_info(p2, opt2, size);
break;
case 10:
p2.modify_info(p2, opt2, size);
34. break;
case 11:
p2.modify_info(p2, opt2, size);
break;
case 12:
p2.modify_info(p2, opt2, size);
break;
case 13:
p2.modify_info(p2, opt2, size);
break;
case 14:
p2.modify_info(p2, opt2, size);
break;
default:
cout << "nWrong Choice ";
}
break;
}
}
myfile2.close();
if (count == 0)
{
cout << "nRecord Does'nt Exist!!!";
cout << "n";
system("PAUSE");
}
}
}
void delete_patient_data()
{
long int size;
size = get_size_of_the_file1();
patient p;
size = size / (sizeof(p));
if (size == 0)
{
cout << "nDatabase Empty!!!";
cout << "nnNo Record To Delete!!!";
cout << "n";
}
else
{
ifstream myfile6("patient11.txt");
ofstream myfile7("temp4.txt");
int id, count = 0, id1, i;
cout << "nEnter The ID Of The Patient Whose Data You Want To
Delete :";
cin >> id;
for (i = 0; i < size; i++)
{
myfile6.read((char*)&p, sizeof(p));
id1 = p.get_ID();
if (id != id1)
{
myfile7.write((char*)&p, sizeof(p));
}
else
{
count = 1;
}
}
35. myfile6.close();
myfile7.close();
ofstream myfile9("patient11.txt");
ifstream myfile8("temp4.txt");
for (i = 0; i < size - 1; i++)
{
myfile8.read((char*)&p, sizeof(p));
myfile9.write((char*)&p, sizeof(p));
}
if (count == 0)
{
cout << "nNo Data Found ";
cout << "nn";
}
else
{
cout << "nData Successfully Deleted ";
cout << "nn";
}
}
}
long int get_size_of_the_file1()
{
long int size = 0;
ifstream ifile("patient11.txt");
ifile.seekg(0,ios::end);
size = ifile.tellg();
ifile.close();
return(size);
}
int number()
{
long int size;
patient p;
size = get_size_of_the_file1();
size = size / (sizeof(p));
return(size);
}
void report()
{
patient p;
int id, id1, count = 0;
long int size;
size = get_size_of_the_file1();
size = size / (sizeof(p));
if (size == 0)
{
cout << "nPatient Database Empty!!!";
cout << "nAdd Some Patient's Info First!!!";
cout << "nn";
system("PAUSE");
}
else
{
36. cout << "nEnter The ID Of The Patient You Require :";
cin >> id;
ifstream myfile1("patient11.txt");
for (int i = 0; i < size; i++)
{
myfile1.clear();
myfile1.read((char*)&p, sizeof(p));
id1 = p.get_ID();
if (id == id1)
{
count = 1;
p.report1(p);
break;
}
}
if (count == 0)
{
cout << "nData Not Available!!!";
}
}
}
void bill()
{
long int size = 0;
size = get_size_of_the_file1();
int i = 0, id, id1, count1 = 0;
patient p1;
size = size / (sizeof(p1));
if (size == 0)
{
cout << "nDatabase Empty!!!";
cout << "n";
}
else
{
cout << "nEnter The ID Of The Patient You Require :";
cin >> id;
ifstream myfile1("patient11.txt");
for (i = 0; i < size; i++)
{
myfile1.clear();
myfile1.read((char*)&p1, sizeof(p1));
id1 = p1.get_ID();
if (id == id1)
{
count1 = 1;
p1.bill1(p1);
break;
}
}
if (count1 == 0)
{
cout << "nData Not Found!!!";
}
myfile1.close();
}
}