Posts

Showing posts from February, 2020

Quantum Computing

Image
How Do Quantum Computers Work? Quantum computers perform calculations based on the probability of an object's state before it is measured - instead of just 1s or 0s - which means they have the potential to process exponentially more data compared to classical computers. Classical computers carry out logical operations using the definite position of a physical state. These are usually binary, meaning its operations are based on one of two positions. A single state - such as on or off, up or down, 1 or 0 - is called a bit. In quantum computing, operations instead use the quantum state of an object to produce what's known as a qubit. These states are the undefined properties of an object before they've been detected, such as the spin of an electron or the polarisation of a photon. Rather than having a clear position, unmeasured quantum states occur in a mixed 'superposition', not unlike a coin spinning through the air before it lands in your hand. These super

ER/EER Mapping

Image
      Sewana Property Renters Case Study Consider the following scenario given with respect to a Property Renter. The first branch office of Sewana Property Renters was opened in 1979 in Nugegoda. Since then, the company has grown steadily and now has several offices in most of the main cities of Sri Lanka. However, the company is now so large that more and more administrative staff are being employed to cope with the ever-increasing amount of paperwork. The Director of the company feels that too many mistakes are being made and that the success of the company will be short-lived if he does not do something to remedy the situation. He knows that a database could help in part to solve the problem and has requested that a database system be developed to support the running of Sewana.The following description delivered by the director of the Sewana Property Renters will help you to build the database system for the company. Sewana specializes in property managemen

File System

Image
File System Create a file of 100M containing all zeros using the dd command. Call this file dsk.img Associate a loopback device with the file Create a VFAT file system on the new device using the mkfs command Mount the new file system on /mnt/f1 Create a text file abc.txt in the file system mounted on /mnt/f1. The text file should contain the text "Hello SCS1214" Unmount the file system on /mnt/f1 Use the grep command to look for the string "SCS1214" in ask.img Some Info: http://wiki.osdev.org/Loopback_Device Commands: ubuntu@ubuntu:~$ sudo dd if=/dev/zero of=dsk.img bs=1M count=100 100+0 records in 100+0 records out 104857600 bytes (105 MB, 100 MiB) copied, 0.559315 s, 187 MB/s ubuntu@ubuntu:~$ sudo losetup -f /dev/loop9 ubuntu@ubuntu:~$ sudo losetup /dev/loop28 dsk.img ubuntu@ubuntu:~$ sudo mkfs -t vfat /dev/loop28 mkfs.fat 4.1 (2017-01-24) ubuntu@ubuntu:~$ sudo mkdir /mnt/f1 ubuntu@ubuntu:~$ sudo mount -t vfat /dev/lo

Implement a malloc

Image
Implement a malloc-like memory allocation library 1. Declare an array of 25000 bytes. 2. You must implement a function that is like malloc(). Call it MyMalloc(). Its signature is similar to malloc(). You should also implement MyFree() which has a signature and functionality that are similar to free(). 3. MyMalloc() allocates memory only from the previously mentioned array of 25000 bytes. 4. All the data structures that are required to manage the memory must also reside within the same array. 5. MyMalloc() and MyFree() must be in a file called mymalloc.c. You should also provide a suitable header file mymalloc.h. 6. Our test program contains the main() and it includes mymalloc.h. Do not include a main() in your mymalloc.c. Sample Code in C: #include <stdio.h> #include <stddef.h> #include "mymalloc.h" struct node *freearray=(void*)array; // to point the first place in array[25000] void *mymalloc(size_t bytes){ // get the value of bytes that

Air Plane Reservation System Problem

Image
Air Plane Reservation System Problem in C++ Problem: A small airline company (Virgin Airline) needs a program to carry out seat reservation for its flights. You are to write a demonstration seat reservation program for this company. Description of Class and its functionality The program is to be menu driven with the following options: 1 Display available flights 2 View flight 3 Seat availability 4 Seat booking 5 Exit Option One (1) The program should list all flight numbers that have at least one seat available. The screen display should show the flight number, departure date and time, departure airport code, arrival airport code and the number of seats available with their class. Option two (2) The program should prompt the user for a flight number. The program should then search the database for the requested flight. An appropriate error message should appear if the flight is not present. If the flight is found the display should show all available seat num