Sunday, October 11, 2009

Basic web application in Html and Java

Design Java Tutor web pages that will have at least the followings. (Look at page 3 for a sample screen shot).

1. The Java programming language features (for example, portable, platform independent, …) and describe how Java is used in IT industry. (Get information from the book and Internet). Use at least 300 words in your .html to explain the features of Java and at least 300 words to explain how Java is used in IT industry. 

2. Features of Java applications and the components. Use a program that you worked before to explain. You will have a link to show the source code, also use at least 300 words in your .html to explain Java application, its components, the control flow in your sample program and how it works, as if you are a Java tutor teaching a beginner. As you teach, you reinforce your understanding. 

3. Features of Java applets and the components. Give at lease one example. Provide a link to let the user to run your applet, also, provide a link called “Source Code”, like Sun’s web site (http://java.sun.com/applets/jdk/1.4/index.html) , so that the user may look at the source code. Also, use at least 300 words in your .html to explain Java applet, its components, the control flow of your sample applet and how it works, as if you are a Java tutor teaching a beginner.  

4. FAQ:
1). What is inheritance? Design simple programs of your own to explain how the members of superclass are inherited and used in the subclass. 
2). What is polymorphism? Design simple programs of your own to explain how Java can call methods polymorphically. 
(Note: you may combine #1 and #2 into one program, in other words, design an application of your choice that uses inheritance and polymorphism (i.e. it will process method call polymorphically as shown in JHtP Ch10). It does not have to be very complicated, use sample programs in JHtP Ch9 & 10 for reference. Have a folder named Final to save the screen shots, all .java and .class files for your application. Use best software engineering practices you learned in JHtP Ch9 & 10, for example, declare instance variables as private, have set and methods for instance variables, provide services through public methods, ... and validate data in the setter methods.) 
3). What is encapsulation? How to make your programs well-encapsulated?
4). How to prevent the exception of dividing by zero? How to give the user a warning and ask the user to enter a number other than zero? What Java statements can handle that exception so that the program would not terminate? 
5). What is object-oriented programming? List and explain at least 2 features of object-oriented programming.
 6). What are loop statement(s) for? Give an example that you would use loop statement.
7). What are the benefits from learning programming? (Programming helps you in problem solving, logical thinking, … )

5). (30 Bonus points) How to convert a Java application to an applet. (For this one, you need to compare the Java applications and applets you have worked, and do some research). Give an example, show the application code and applet code. For example, SJP Tutorial 24 Car Payment

can be changed to an applet to offer such service online, as shown in the following screen shot:
 


Sample screen shot:




Those 4 on the list are links, for example, as the user click on the “Java Programming Language Features, it will link to another .html file, in it you will explain the features and how Java is used in industry. If the user clicks on FAQ, then, it will list all FAQ questions, the use may click on one of them to get the answer.


Hints:
1. Look at the information and demo applets at Sun’s web site:
http://java.sun.com/applets/jdk/1.4/index.html

To see the .html code of the web site, you may click on “View”, then, click on “Source”. Print a copy of the .html code, and compare with the web site display, you can easily figure out the purposes of html tags, for example, you begin with tag, at the end, you end with , to bold a word => you have: the word , to center a line => you have

the line
,
to have a hyper link => you have whatever you want to show on screen

If you want to have your applet displayed in the center of the screen, have code similar to:






On Sun’s web site (http://java.sun.com/applets/jdk/1.4/index.html), if you click on the “Source Code”, you can see the Java code of the applet.


2. your main page will look similar to the following screen shot, but, on the top, instead of having “JDK 1.4 Demo Applets” you may have “Java Tutor”, and on the left, instead of having “Animator”, “ArcTest”, “BarChart” …links, you will have “Java Programming Language”, “Java Application”, “Java Applet”, “FAQ”, and “How to Convert a Java Application to Applet” (if you choose to do the bonus points one), as show in the above sample screen shot.

3. After the user clicks on the link, say, “Java Animation Applet”, it will show similar to what Sun Microsystems has in their web site, it will run the program, and have a “Source code” link. If the user click on the “Java Programming Language”, it will display a page that explain the features of Java programming language.

4. Be creative, but designing your web pages professionally. You may find a web site that has the format you prefer, again, click on “View” -> “Source”, most of the time, you can get the format html code.

5. If you have your web hosting services, you may upload it online.

6. When you test your html, you may want to use Internet Explorer instead of Firefox, because when you work on applets, sometimes it works in IE but not in Firefox, I know that breaks your heart since you really love Firefox. But, at least you know that’s something you can help to improve after graduation. In some situations, it may work on Firefox, but not Internet Explorer.

7. You may use any tool that you feel most comfortable with, FrontPage, DreamWeaver, …, or even Word. You may use Word to type your answer, then, save it as .html format. In Word, to insert a hyperlink, click on “Insert” -> Hyperlink, then, type in the text to display and the web address.


 





http://www.jasonjonesprogramming.com/JavaFinalProject/index.htm

No comments:

Post a Comment