Implementing Button_class
The class Button_class is an inner class defined in the class, Calculator_app. The Button_class class extends the built-in Button class of java. The Button_class class is used to create and initialise the properties fo the buttons, such as foreground colour, background colour, size and font. The Button_class also declares a constructor for overriding the main constructor of built-in Button class. The constructor declared in the Button_class class is:
public Button_class(String name, Color xyz)
Implementing File_class
The class File_class is an inner class defined in the class Calculator_app. The File_class class consits of methods to create a file or to append information to an existing file, or delete a file. It also consits of methods to append a string in the text area. The methods declared in the File_class class are:
public void WriteFileOnTextArea()
public void CreateFile()
public void addTofile(String str)
public void delFile()
public void endStore()
Implementing Math_class
The Math_class class is a separate class defined outside the scope of Calculator_app class in the Calculator applicaiton. The Math_class declares methods for the trigonometric calculations, such as sin and cos values evaluation. It also defines the methods for converting the radian into degree and degree into radian, such as convert_deg_rad() and convert_rad_deg() function. The Math_class class declared method for mathematical calculations, such as factorial of a number, square of a number and finding the power method. The methods declared in the Math_class class are:
public static double sin_func(double x)
public static double cos_func(double x)
public static double convert_rad_deg(double x)
public static double convert_deg_rad(double x)
public static double pow(double x, int y)
public static double sqr_func(double x)
public static long fact_func(int x)
Methods used in Calculator Application
The Calculator application uses different method for different operation. The Calculator applicaiton usese various user difined methods, such as calculator(). The Calculator application also uses built-in methods which are overloaded, such as keyPressed(), keyTyped and actinPerformed() methods.
0 Comments:
Post a Comment