Friday, October 10, 2008

Question#6

Question#6: Age Calculator: Program asks for age and prints how many months, weeks, days, hours and minutes old you are.

#include /* Programmed by Harvey Losin *//*
http://www.bikoy.com/harvey *//* webmaster@bikoy.com */main(){float years;clrscr();printf("Enter your age in years: ");scanf("%f",&years);printf ("\nYou are %.0f months old", years * 12);printf ("\nYou are %.0f weeks old", years * 48);printf ("\nYou are %.0f days old", years * 365);printf ("\nYou are %.0f hours old", years * 8760);printf ("\nYou are %.0f minutes old", years * 525600);getch();}

Output:




Monday, October 6, 2008

Question #5

Question#5:Research in the net the most recent assembler. Describe its history, nature and applications. Evaluate this assembler from its predecessor.

Answer:Many assemblers support macros, programmer-defined symbols that stand for some sequence of text lines. This sequence of text lines may include a sequence of instructions, or a sequence of data storage pseudo-ops. Once a macro has been defined using the appropriate pseudo-op, its name may be used in place of an mnemonic. When the assembler processes such a statement, it replaces the statement with the text lines associated with that macro, then processes them just as though they had appeared in the source code file all along (including, in better assemblers, expansion of any macros appearing in the replacement text).

Aplication:Keyboard and mouse macros that are created using an application's built-in macro features are sometimes called application macros. They are sometimes created by carrying out the sequence once and letting the application record the actions. An underlying macro programming language, most commonly a Scripting language, with direct access to the features of the application may also exist.
The programmers' text editor Emacs (short for "editing macros") follows this idea to a conclusion. In effect, most of the editor is made of macros. Emacs was originally devised as a set of macros in the editing language TECO; it was later ported to dialects of Lisp.
Visual Basic for Applications (VBA) is a programming language included in Microsoft Office and some other applications. However, its function has evolved from and replaced the macro languages which were originally included in some of these applications.