Homework for the third week on Advanced Programming in C++ AAU Klagenfurt
HOMEWORK 3: Templates, Headers, and Libraries
-
Modify your program that implements the bubble sort using templates and static libraries defined by you.
-
Write a program to enter and display two data members of a class using class template. Define the member functions outside the class.
-
Create generic class Stack<> by using templates and implement generic methods to push/pop elements from the stack and to find the sum, the maximal element and the number of elements in the Stack (Not for string type!)
-
Create a console-based application that takes positive binary numbers of no more than 16 digits as an input from the user. Read this value in as an int/long int type value (you can use templates). The first function of your program will be to make sure that the user indeed entered a binary number (only 1's and 0's). If it isn't, then the user is prompted again. If it is binary, then your program should calculate the equivalent decimal value (base 10 -- the number system we commonly use). You have to use headers for this assignment!