I am LAZY
Project ID: 01
Project Title: Implement a class for a polynomial of degree-n
Project Description:
You are required to implement different functions on the polynomial class.
Features:
In this program you are required to implement the polynomial class. Declare a class name “Polynomial” which contains an array of size (n) (dynamic allocation of this array is not required, you can use a global variable to represent the degree of the polynomial, to store the coefficients of the polynomial into the indices corresponding to their powers. For example if we want to make a polynomial 2x4 + 3x3 – 12x2 + x – 19 (i.e. a polynomial of degree-4) then the polynomial class will have an array of the following form.
0 1 2 3 4
-19 1 -12 3 2
Similarly for the polynomial 12x4 +3x3 + 9x – 19, the array inside the class should have the following form.
0 1 2 3 4
-19 9 0 3 12
You are required to implement the following functions of the polynomial class.
Polynomial (int degree)
Description: Constructor, which initializes the array to zero.
void outputPolynomial()
Description: Prints the polynomial in the following format, 2x^4 + 3x^3 – 12x^2 + x -19
Polynomial MulPolyWithScalar(int value)
Description: Multiply a polynomial with the input scalar value.
Return Value: Returns a new Polynomial object, which is the resultant polynomial after the multiplication operation.
Example: b = a.MulPolyWITHScalar(Value) means b = a * value
Polynomial AddPolynomials (Polynomial poly)
Description: Adds two polynomials of the same degree. This operation cannot be done on the polynomials of different degrees.
Return Value: Returns a new Polynomial object, which is the sum of polynomial of calling object and the “poly”.
Example: b = a.AddPolynomials(poly) means b = a+ poly
Polynomial SubtractPolynomials (Polynomial poly)
Description: Subtracts a polynomial from another of the same degree. This operation cannot be done on the polynomials of different degrees.
Return Value: Returns a new Polynomial object, which is the difference of polynomial of calling object and the “poly”.
Example: b = a.SubtractPolynomials(poly) means b = a – poly
Create a main program to test all of the above mentioned methods. The function prototypes provided to you should not be changed. The change in the prototypes of the functions will result in deduction of marks. The code file name for this program should be “Polynomial.cpp”.
Project ID: 02
Project Title: String Manipulation using pointers
Project Description:
You are required to implement the following different string operations
Features:
In this program you are required to implement the following string operations.
1. int string_length(const char *str)
Description: Counts the number of characters in the String.
Return Value: Number of characters in the String “str” excluding the null terminating character.
Note: Ensure that original string “str” is not changed within the function.
2. int string_compare(const char *str1, const char *str2)
Description: Compares the two given STRINGS
Return Value: 0 if str1 = str2
1 if str1 > str2
-1 if str1 < str2
Note: Comparison is done on the basis of the ASCII values of the characters. A character in string is greater if its ASCII value is greater. Also ensure that the original string “str1”, and “str1” are not changed within the function.
3. bool string_palindrome(const char *str)
Description: Determine whether a string is equal to its reverse string or not.
Return Value: true if “str” is a palindrome and false otherwise.
Note: The original string “str” should not be changed.
4. char* string_concatenate(char *str1, const char *str2)
Description: concatenate the “str2” at the end of “str1”
Return Value: The str1 with the concatenated value at the end.
Note: The original strings “str2” should not be changed.
5. void string_printletters(const char*str)
Description: Prints a table indicating the number of occurrences of each letter of the alphabet in “str”. For example, the phrase “This is the first project of Object Oriented Programming course” contains two a’s, one b’s etc.
Note: The original string “str” should not be changed.
6. void string_printwords(const char *str)
Description: Prints a table indicating the number of one-letter words, two-letter words, three-letter words, etc. appearing in “str”. For example, the phrase “This is the first assignment of Object Oriented Programming course” contains zero one-letter words, two two-letter words, one three-letter words, etc. Assume that the string “str” con not have words with more than 10 characters.
Note: The original string “str” should not be changed.
Create a main program and then test all of these functions. You must dynamically allocate and deallocate memory to all the strings in your program. There should not be any memory leakages and dangling pointers in your program. You cannot use any string manipulation function defind in “string.h” header file.
Also you cannot use subscript operator “[]” on the character pointer or string (use pointer arithmetic instead.)
Note: The functions prototypes provided to you should not be change in the prototypes of functions will result in deduction of marks. The code file name for this program should be “String.cpp”.
Project ID: 03
Project Title: Implementation of a Big Integer class
Project Description:
You are required to implement different functions for BigInteger class.
Features:
Create a class BigInteger that uses a 40-element array of digit to store intergers as large as 40 digits each (array must be dynamically allocated). The default constructor initializes the BigInteger to zero, i.e, an integer whose array representation contains all zeros. Provide the declaration as well as the definitions of the following functions for BigInteger.
1. An overloaded binary (+) operator that add two BigInteger and return the result as a BigInteger.
2. An overloaded binary (-) that subtract its right operand (a BigInteger from its left operand (a BigInteger) and return the result as a BigInteger.
3. An overloaded binary (*) operator that multiply two BigInteger and return as a BigInteger.
4. An overloaded binary (==) operator that compares two BigIntegers for equality and returns true of both are equal, false otherwise.
5. An overloaded binary (<) operator that compares two BigIntegers and determine whether its left operand is less than its right operand or not.
6. An overloaded binary (>) operator that compares two BigIntegers and determine whether it’s left operand is greater that its right operand or not.
7. An overloaded binary (=) operator that assigns that value of its right operand (a BigIntegers) to its left operand (a Bigintegers)
8. An overloaded unary pre-increment (++) operator for the class BigInteger.
9. An overloaded unary post-increment (++) operator for the class BigInteger.
10. An overloaded stream insertion operator (<<) to print the value of a BigInteger on the display screen.
11. An overloaded stream extraction operator (>>) to input the value of a BigInteger from the user.
Write the overloaded and copy constructor whenever required. You are not required to write a driver program, however you can write the driver program for your own testing. Make separate header (.h) and source (.cpp) files for the class. And write the driver program on a separate file (for your testing).
Project ID: 04
Project Title: Software for a Bank
Project Description:
You are required Develop a Software for a Bank to perform different functions.
Features:
Your program follow these task:
b) Display a welcome / greeting .
c) Menu driven program to allow ‘View Balance’, ‘Deposit’, ‘Withdraw’, ‘Transfer’ and ‘Exit’. Start with a beginning balance of 1000.00 in checking and 1500.00 in savings.
a) Should allow 5 users for Performing of different task like view balance, Deposit etc.
b) In View Balance, Current Balance should be shown.
c) In the Deposit, the customers can deposit amount in his account and updated balance must be displayed.
d) In the withdraw, the customer can withdraw amount and updated balance must be shown.
e) In the Transfer, the amount must be transferred to other customer account.
f) If amount is less than 500 Rs then deduct 25 Rs on each withdraw.
g) If amount is Greater than 2000 Rs Then add Rs 50 on each deposit.
h) Information Displayed on the screen must be in a organize form.
I) You must save the record of your users.
These are the general specifications, use your creativity to make program user friendly.
Project ID: 05
Project Title: Encryption and Decryption
Project Description:
You are required to Develop a Program to Encrypt and Decrypt any string.
Features:
Develop a program that contains two classes. The specification of both classes is as follow:
a) Data Class
Data class has following members
• protected String data
This field stores any type of user data
Data class has following member functions
• One argument constructor which takes String object to initialize data.
• public void setData(String d)
To set data.
• public String getData()
To get data.
• public String toString()
To override the toString() method of base class Object. It simply returns data field.
b) EncryptedData Class
This class extends the Data class.
This class has following data members
• protected String encryptedarray[]
Used to encrypt data.
• protected boolean encrypted
To show whether data is encrypted or not.
Data class has following member functions
• One argument constructor which takes String argument to initialize superclass Data
• public void encrypt( )
This function encrypts the data.
• public void decrypt( )
This function decrypts the already encrypted data.
• public String storeData()
This function returns a combination of String which represents EncryptedData object and stores it in a data file.
• public void loadData( String data )
This function loads data from a valid data file.
Encryption Technique :
This is an encryption technique which is a combination of two steps. These steps are as follow:
Step 1: Change the state of every bit of lower byte of character, reverse the order of bytes in character and toggle alternative bits of new lower byte.
Step 2: Create an array of Strings. Length of Array is equal to ceil of square root of length of stored data. Any String in array can store maximum characters equal to length of array. Store data column wise is array as first character of data goes to first character of first array , second goes to first character of second array and so on until first columns are finished then start filling second columns of all arrays until data and array both are finished. If there are some character fields in arrays remained but data is exhausted then fill the remaining ones with ‘*’. You can store data row wise back to data field to store encrypted data.
Suppose data field is “ABCDEFGHIJ”
After first step suppose encrypted data is “KLMNOPQRST”
Then string arrays would be filled like this.
First
String K O S *
Second
String L P T *
Third
String M Q * *
Fourth
String N R * *
Data will be created again as "KOS*LPT*MQ”
Test your classes by creating two EncryptedData classes. First encrypts data and second uses that to decrypt data and display actual data. Use storeData( ) and loadData( ) functions to pass data between two classes. Don’t overload a constructor or a function to copy objects.
|