CS 345 Spring 2005 Project 3 Due date: Before midterm. (1) Write a C-shell script to strip all comments from a C, C++, or Java source code. Your script should take the programming's name as a command line argument. You don't have to worry about the location of this file, since your script is in the bin directory; thus it can be executed anywhere in your system. For example, the following original java code looks like: ( I delete a portion of this code for simplicity) ======================================================================= import java.awt.*; import java.awt.event.*; import javax.swing.*; /* Description: This program is used to demonstrate how to translate data from a text file into charts, such as bar chart, pie chart, line chart, etc... In order to be able to use this program, you must include the Bargraph3 class. Otherwise it will not compile.*/ public class Mult_windows extends JFrame implements ActionListener{ private JTextArea jta; private JButton jbtShowGraph = new JButton("Show Graph"); private Bargraph3 bg = new Bargraph3(); //Create a new frame to hold the bar graph private JFrame barFrame = new JFrame(); /* Default constructor */ public Mult_windows(){ //Store text area in a scroll pane. JScrollPane scrollPane = new JScrollPane(jta = new JTextArea()); //Create a text area. scrollPane.setPreferredSize(new Dimension(300, 200)); //Set the frame size. jta.setWrapStyleWord(true); jta.setLineWrap(true); //set line wrap. //Place Scroll pane and button in the frame getContentPane().add(scrollPane, BorderLayout.CENTER); getContentPane().add(jbtShowGraph, BorderLayout.SOUTH) ; //Register Listener jbtShowGraph.addActionListener(this); } //end of Mult_windows public void actionPerformed(ActionEvent e){ barFrame.setVisible(true); } public static void main(String[] args){ Mult_windows frame = new Mult_windows(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setTitle("Multiple windows demo"); frame.pack(); frame.setVisible(true); } //end of main() } //end of class Mult_windows ======================================================================= After executing your script, the above java code would look like: import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Mult_windows extends JFrame implements ActionListener{ private JTextArea jta; private JButton jbtShowGraph = new JButton("Show Graph"); private Bargraph3 bg = new Bargraph3(); private JFrame barFrame = new JFrame(); public Mult_windows(){ JScrollPane scrollPane = new JScrollPane(jta = new JTextArea()); scrollPane.setPreferredSize(new Dimension(300, 200)); jta.setWrapStyleWord(true); jta.setLineWrap(true); getContentPane().add(scrollPane, BorderLayout.CENTER); getContentPane().add(jbtShowGraph, BorderLayout.SOUTH) ; jbtShowGraph.addActionListener(this); } public void actionPerformed(ActionEvent e){ barFrame.setVisible(true); } public static void main(String[] args){ Mult_windows frame = new Mult_windows(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setTitle("Multiple windows demo"); frame.pack(); frame.setVisible(true); } } ======================================================================= Note that the new java code has no comments in it. Do not redirect the result to a file, just display its contents on the console is sufficient. Name this script as "YourName3a.csh" (2) Based on the result of your project 2 on generating a report using mysql, create an html form with a text field, which allow the user to enter a business type (such as: RESTAURANT, RETAIL, PuBLISHING, etc...). Create a button called "Search" to allow the user to search your database for all businesses that belong to this category. The returned information should contain the business' names, addresses, description of the business type, phones, and the district where a particular business is located. You should design a nice returning format so that the user would feel pleasant to search your web site. Especially important is the security and speed of your query and scripting techniques. Look at the end of the textbook for information about passing and parsing the query string from a form. You need to parse this query string in order to be able to obtain the business' names from the user. You can design a simple (but not lousy) web application form for the user to search your database, and a nice returned format with all the necessary information. Test your project to make sure that your web application work correctly.