Académique Documents
Professionnel Documents
Culture Documents
Islamabad
Programming for Engineers 1 Fall 2009
Assignment 4
Max Marks: 115
Course instructor: Asma Ahmed, Atif Jilani Date: 10 November 2009
Write a Library file MyNameMath.h and provide following math.h functions in it. The
functionality of each function must be exactly same as that of the original functions given in
math.h. All functions must take same type and number of arguments as that of original functions
Note: You are not allowed to use any math.h library function
If you make anyother function you will get extra credit [5 marks for each extra function]
Write a driver program to provide user interface to user for testing all of these functions. [25
Marks]
For making good looking User Interface you make find following document helpful. (only works
for Visual C++)
Changing Font Color and Back Ground Color in Visual C++
You need to include following header file
#include <windows.h>
There are 16 colors available each given a number.
0 = Black 8 = Gray
1 = Blue 9 = Light Blue
2 = Green A = Light Green
3 = Aqua B = Light Aqua
4 = Red C = Light Red
5 = Purple D = Light Purple
6 = Yellow E = Light Yellow
7 = White F = Bright White
Color attributes are specified by TWO hex digits -- the first corresponds to the background; the
second the foreground. Each digit can be any of the following values:
Sets the default console foreground and background colors.
Examples
Use following function
system(“color 70”)
7 is white 0 is black. This will make white background and black font color.
system("COLOR fc") produces light red on bright white
Ahsan
Digitally signed by Digitally signed by
Zubair
Ahsan Javed bUttt Zubair Amjad
DN: cn=Ahsan Javed DN: cn=Zubair Amjad,
Javed
bUttt, o=BZSolutionz, o=BZSolutionz,
ou=Coder, ou=Project Manager,
bUttt
email=i080253@nu.
edu.pk, c=PK
Date: 2009.11.05
20:42:14 +05'00'
Amjad email=i080209@nu.
edu.pk, c=PK
Date: 2009.11.05
20:41:38 +05'00'