Qbasic For SLC

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 5

Question M5: A binary file stu.dat contains student records. WAP to create a binary file stusort.

dat, which contains all the records of stu.dat in the sorted order of roll number. Question M6: WAP to count the number of employee records in a binary file emp.dat whose department number is 10.

using structures

using classes Question M7: WAP to search a given employee record by employee number or name in a binary file using structures / classes. Question M8: There are 100 records present in a file with the following structure: Sturct item { int itemcode, qty; char itemname[20]; }; WAP to read these records and arrange them in ascending order of itemcode and write them in target file separately.. Question M9: WAP to modify a given employee record in a binary file using structures / classes. Question M10: WAP to delete a given employee record in a binary file using structures / classes. Question M11: WAP to count the number of characters, alphabets, vowels and consonants in a file poem.txt. Question M12: WAP to count the number of words and lines in a file poem.txt. Question M13: WAP to count the number of spaces, tabs and newline characters in a file Notes.txt. Question M14: Assume that a text file named TEXT1.TXT already contains some text written into it, write a program that reads file TEXT1.TXT and create a new file named TEXT2.TXT, which shall contain only those words from the file TEXT1.TXT which dont start with an uppercase vowel ( i.e. with A, E, I , O, U). Question M15: WAP which takes story.txt as input file and creates a new file story1.txt by replacing all the spaces with -, tabs by % and newlines by $. Question M16: WAP that merges two input files Data1 and Data2 giving the third output file Dataf. The 2 input files contain records in ascending order of their roll numbers and resultant file should also be in ascending order. Write this program using

Without using structures / classes

structures

classes

Question M17: A binary file Employee.dat containing Empno, Wrate( hourly wage rate), Noh (number of hours worked / week) fields. Write a C++ function to read each record, compute weekly wage as Wrate * Noh and display Empno, Wrate, Noh, Wrate*Noh. Question M18: WAP to check a C++ program for matching characters ({ }, ( ), /* */) and display whether they are well formed or not. Question M19: WAP to read a binary file Emp.dat using classes and display only those records whose salary is between 10000 and 20000 and job is Manager Question M20: WAP which reads one line at a time from the disk file TRY.TXT and display it on the monitor. The maximum length of the line is 80 characters. Question M21: WAP to write the contents of a string variable one character at a time to the disk file OUT.TXT.

Question M22: Write an interactive menu driven program to create a text file and then display the file. Create another text file by converting upper case letters to lower case letters and lower case letters to upper case letters of the newly created text file. Question M23: Write an interactive menu driven program to create a text file and then display the file. Create another text file by reversing each string of the newly created text file. Question M24: WAP that reads a text file and creates another text file that is identical except that every sequence of consecutive blank space is replaced by a single space. Question M25: WAP to read a text file and display it on the screen. In case number of lines exceeds 22, file should be displayed one screen at a time. Question M26: WAP to print a text file on the printer. Question M27: WAP that displays the size of file in bytes.
Section N: Stacks and Queues (Implement all the questions using structures and classes both)

Question N1: WAP to implement a static stack and show the push and pop operations on the stack. Question N2: WAP to implement a static queue and show the insert and delete operations on the queue. Question N3: WAP to implement a static circular Queue. Question N4: WAP to implement a static dequeue (using arrays). Question N5: WAP to implement n stacks in single 1D array. Write functions for push and pop operations on i-th stack. Question N6: WAP to implement n queues in single 1D array. Write functions for add and delete operations on i-th queue Question N7: Represent a stack and a queue in a single 1D array. Write functions for push, pop operations on stack and add, delete operations on the queue.

Section O: Linked Lists (Implement all the questions using structures and classes both)

Question O1: WAP to implement a single linked list of integers and perform the following operations

add an integer in beginning

add an integer after the given element in the list

add an integer before the given element in the list

add an integer at the position given by the user.

add an integer at end

display the list

delete an element from the beginning

delete an element from the end

delete an element from specified position.

delete an element given by the user.

Search an item in the list. Question O2: WAP to implement a circular linked list of integers

Question O3: WAP to implement linked stack Question O4: WAP to implement a linked queue. Question O5: WAP to implement a linked circular Queue. Question O6: WAP to implement a linked dequeue. Question O7: WAP to create two linked lists of integers in ascending order and merge both the lists to create a new list in ascending order. Question O8: WAP to reverse a linked list. Question O9: WAP to check that the given linked list of integers is sorted in ascending order or not. Question O10: WAP to split a linked list into two linked lists, so that each list gets equal number of nodes. (delete a node if required). Question O11: WAP to concatenate two linked lists. Question O12: WAP to convert a singly linked list into circular linked list. Question O13: WAP to create a single linked list of integers, where the new node has to be inserted in such a way that the list is always sorted in ascending order. Question O14: WAP to count the maximum, minimum, sum, average and count of the values stored in the linked list of integers. Question O15: X points to the first node of the singly linked list. Search the first occurrence of ITEM in the list and split the list into two, so that y points to the sublist beginning with ITEM. Question O16: Write a program that creates a linked list of characters from a string entered by the user. Your program is then to remove a number of consecutive elements from the linked list (in effect removing a sub-string from the string entered). This is to be achieved by the user entering two integers. The first of which will represent

an index (counting from zero) into the linked list, and the second will represent the number of elements to be removed. For example, if the user enters the following string (without the quotes):
"I do not love C"

and then enters the two integers 2 and 7, the program would output (without the quotes):
"I love C"

Your program is to use only one linked list. Question Q17 : WAP to sort a linked list of integers using insertion sort technique. Question O18: WAP to implement a doubly linked list and implement the fllowing functions :

add a node in beginning

add a node after the given element in the list

add a node before the given element in the list

add a node at the position given by the user.

add a node at end

display the list

delete an element from the beginning

delete an element from the end

delete an element from specified position.

delete an element given by the user.

Search an item in the list. Section P: Binary Trees (Implement all the questions using structures and classes both) QuestionP1: Create a binary search tree and perform

Preorder traversal(recursive and non recursive)

Inorder traversal(recursive and non recursive)

Postorder traversal(recursive and non recursive) Question P2: WAP to count the number of leaf nodes in a binary tree. Question P3: WAP to list the list the data fields of a binary tree level by level. Within levels, nodes are to be listed from left to right. Question P4: WAP to compute the height of a binary tree. Question P5: WAP to check that two binary trees are similar. Question P6: Construct two binary trees so that their preorder traversal sequences are the same. Question P7: Construct two binary trees so that their postorder traversal sequences are the same. Question P8: Write a function to swap a binary tree. Question P9: Write a function to compute the maximum number of nodes in any level of a binary tree. The maximum number of nodes in any level of a binary tree is also called the width of the tree Question P10: Write a function to find out the inorder successor of a given node in a binary tree. The inputs to the function are a pointer to the root of the tree and a pointer to a node. The function returns a pointer to the inorder successor of the given node.

Question P11: Write a function to find out the inorder predecessor of a given node in a binary tree. The inputs to the function are a pointer to the root of the tree and a pointer to a node. The function returns a pointer to the inorder predecessor of the given node. Question P12: Write a function to compute the internal path length of a binary tree. Question P13: Write a function to compute the external path length of a binary tree. Question P14:Write a function to delete a node from a binary search tree which ultimately deletes the inorder predecessor of the node to be deleted if the node has exactly two non empty children. Question P15: Write a function to check whether a given binary search tree is an AVL tree or not. Question P16: Write a non recursive function to insert a node in AVL tree. Question P17: Write a non recursive function to delete a node from an AVL tree. Question P18: Write a recursive function to delete a node from an AVL tree. Question P19: Write a function to merge the nodes of two AVL trees to obtain a new AVL tree. Question P20: Write functions to find the immediate predecessor and immediate successor of a given key value in a B-tree. Question P21: Write a function to insert a new key to a B-tree of order m. Question P22: Write a function to delete an existing key from a B-tree of order m.
Section N: Command Line Arguments Bitwise Operators

Question: WAP to divide an unsigned number by another number using bitwise operators. Question: WAP for Hanoi problem.

Assignment
Download this Document for FreePrintMobileCollectionsReport Document This is a private document.

Info and Rating


numbers greater c every week given five addition sort operation five numbers find prime nth prime numbers

You might also like