CS 441
Final Exam
Meng Yi Yee

 

Part One

JavaScript is an Object-based programming language. Code in JavaScript uses built-in, extensible objects in JavaScript. But, there is no classes or inheritance in JavaScript. JavaScript is interpreted by client but not complied by client. The variables data types are not declare in JavaScript. JavaScript objects are dynamic binding, where object references checked at run-time. In addition, JavaScript is secure because it cannot write anything to hard disk. Besides that, codes of JavaScript can be integrated with, and embedded in HTML.

 

Entities of the Real World

A business cooperate could have many departments such as Human Resources, Sales Department, Customer Services Department, Technical Support Department, and Payroll Department. From here, each department consists of many employees. In this example each of the departments or employees is an entity. The following diagram represents the above illustration in the real world environment.

 

Relationship between/among the Entities of the Real World

Every month each employer needs to fill in his or her timesheet. Then, these timesheets will be submitted to their department manager through an online form. After that, each department manager needs to verify his or her employees’ timesheets. When they are done, total time of work of each employee will be submitted to Payroll Department by forwarding messages. The employees of Payroll Department will input the data into the server so that the server will calculate the total wages for each employee. Lastly, the server will deposit the wages of each employee to his or her account.

 

Environment within which the Entities and Relationships Exist

The JavaScript application works in Client-Server Environment. Payroll Department will be the client of this system. While, the server will calculate wages, deposit wages into employees’ account, and generate pay stub to each employee when the process is successful.

 

Rules to which Entities, Relationships and the Environment must adhere

The server must have and able to access the database that contains the different rates of wages for each employee. This is because the database contains the information of the different rates of wages of each employee and bank account number. In addition, every employee needs to fill in the online timesheet and the manager of each department have to verify those timesheet for his or her department and send them to the Payroll Department. If an employee failed to submit his or her timesheet by the due date, his or her timesheet will be processed for the next payroll.

 

 

Part Two

ML is a functional programming language where functions are first-class data objects. They may be passed as arguments, returned as results, and stored in variables. In addition, ML is an interactive language where every phase read is analyzed, complied, and executed, and the value of the phrase is reported, together with its type. ML is strongly typed and has a polymorphic type system. Also, ML supports abstract types. ML is statically scoped where identifier references at compile time. Besides that, ML has module facility to support the incremental construction of large program.

 

Entities of the Real World

In ML, data objects can be represented as an entity. The above example of entities can be used here also. Another example could be the Hiring Process. There will be entities for Applicants, Job Database, Human Resources Department, and Department Managers. The following diagram shows how the hiring process works.

 

Relationship between/among the Entities of the Real World

Basically, the relationship among the entities is very high. At first, an applicant fills in a job application form and the information will be saved in the job database. After that, the employees in Human Resources Department will go to the database to search for matches. When there is a match, Human Resources will forward the applicant information to Department Manager through a message in the form of expressions. After interviewing with the applicant, the Department Manager will send a message of his or her decision for the applicant. All the processes are in the form of functions.

 

Environment within which the Entities and Relationships Exist

In order for the ML program, which contains entities and relationships for the entities, there must exist a form of input and output system. This is important because the Human Resource department need to get information of the applicant into the database. The way that ML handles input and output is that ML contains basic I/O system called the character stream. The input stream gets characters from a producer and an output stream sends its characters to a consumer. For instance, the applicants are the producers entering information into the applications form and consumer is the job database that stores the information.

 

Rules to which Entities, Relationships and the Environment must adhere

Some basic rules for applicants are the applicants must be a least 18 years old and must have the authorization to work in this country. Besides that, the system must be able to store information of applicants in a database and must be able to do queries for the search.

 

 

Part Three

1) In this case C++ is the best choice. C++ is an object-oriented programming language and C+++ handles data objects and classes very well. Classes can also be inheritances, which will give programmer more flexibility to program. The highly flexible pointer manipulation can be used so that the programmer can be sure that all function will have the same and correct value. In this example, there are many common variables such as Name, Student ID, Date of Enrollment, and Class Code. The programmer can use pointer to point to an object instead of creating many objects that store the same value. Besides that, functions and sub-programs can be used to enhance the system. Each problem can be represented by a function or subprogram such as Enrollment Subprogram, Send Information to Registration Subprogram, Check Prerequisites Subprogram, and Amount Due Function.

 

2) In this case Java is the best choice. This management tool consists of a database that has all the modules in it. The computer that stores the database will be the server for this application and the other computers that are connected to this server will be the client. On client computers, programmers can specify their queries and then send them to the server to find the best match. Another reason is Java support cross platform application where all the client computers do not have to the same type or run the same operating system.

 

References

Teach Yourself Java 1.1 in 21 Days, 2nd Ed. Laura Lemay and Charles L. Perkins

C++: How to Program, H. M. Deitel/P. J. Deitel

Software Engineering: A Practiioner's Approach, 4th Ed. Roger S. Pressman

Introduction to Standard ML, Robert Harper

http://www.comnets.rwth-aachen.de/doc/java/ns-intro/introd.html