Skip to main content

Posts

Mini Project - Railway Reservation System

Module 1 Overview Railway Reservation System-(RRS) Project is developed to help students learn and realize capability of C programming language, and appreciate procedural approach of developing a system. RRS helps users reserve/cancel berths, search for trains, check reservation/cancellation history, etc... On the other hand it helps the railway reservation officers to prepare reservation charts, organize train schedules, etc... RRS provides two types of log-ins one is the User log-in for railway customers and the other one is Admin log-in for railway reservation officers. Project is divided into 10 modules of four hours duration each. All the modules will give exactly what to develop in the 4 hour time frame. Since most of the modules are inter-related it is important to keep track of the previous code. After submission it is allowed to make changes in the previous code to suit / integrate well to the system. Before we start the project, we need to make the followin...

Standard Template Library

Learning Objective At the end of this module, you will be able to: Understand Standard Template Library Explain the need of STL Understand and use the vector and list of STL. Using real world objects with STL. Standard Template Library Introduction The Standard Template Library (STL) is a fundamental part of the C++ Standard, is a C++ library of container classes, algorithms, and iterators; it provides many of the basic algorithms and data structures of computer science. The STL is a generic library, meaning that its components are heavily parameterized: almost every component in the STL is a template. You should make sure that you understand how templates work in C++ before you use the STL. The STL contains several kinds of entities. The three most important are containers, algorithms,and iterators. A container is a way that stored data is organized in memory. In earlier chapters we’ve explored two kinds of containers: stacks and linked lists. Another containe...

Streams & Files

CPP09 W2 M1 Streams and Files Learning Objective Understanding streams Understand the stream class hierarchy Understand the concepts of stream insertion and extraction Use streams for file input and output Distinguish between text and binary file input and output Write programs for random access of data files using: get pointer put pointer seekg() tellg() seekp() tellp() Streams and Files Introduction In simple words, a stream is a sequence of bytes. In input operations, the bytes are transferred from a device (a keyboard, a disk drive, a network connection etc.) to the main memory. Where as in case of output operations, this is reverse. That means, the bytes are transferred from main memory to a device such as a display screen, a printer, a disk drive, network connection, a tape( a file on tape) etc. Streams In C++, a stream is a source or destination for collection of characters. Streams are of two types: Output stream In...

Exceptional Handling

CPP09 - W1 - M10 - Exception Handling Learning Objectives At the end of this module, you will be able to * Explain why do we need exception handling. * Explain how to write C++ programs using exception handling. * Explain how to declare and implement exception handing. * Identify and list different exceptions. * Apply exceptions for file handling, memory allocation and real world scenarios. Exception Handling Introduction Exceptions are errors that occur at runtime. They are caused by a wide variety of exceptional circumstance, such as running out of memory, not being able to open a file, trying to initialize an object to an impossible value, or using an out-of-bounds index to a vector. Why do we need exceptions ? Why do we need a new mechanism to handle errors? Let’s look at how the process was handled in the past. C-language programs often signal an error by returning a particular value from the function in which it occurred. For example, disk-file functions often r...