2015年3月27日 星期五

第四次作業


import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class Test
{
public static void main(String[] args)
{
JFrame jtfMainFrame = new JFrame("Which Button Demo");
jtfMainFrame.setSize(450, 150);
JButton jbnButton1=new JButton("Button 1");
JButton jbnButton2 = new JButton("Button 2");
JPanel jplPanel = new JPanel();
jplPanel.add(jbnButton1);
jplPanel.add(jbnButton2);
jtfMainFrame.getContentPane().add(jplPanel, BorderLayout.CENTER);
jtfMainFrame.setVisible(true);
System.out.print("i");
}
}


2015年3月20日 星期五

第三次作業

VB
Private Sub CommandButton1_Click()
For i = 1 To 10
Cells(1, i) = i
Next
End Sub


java
public class Loop1to10 {
public static void main(String[] args) {
for(int i = 1; i < 11; i++)
System.out.print(i + " ");
}
}

javascript
<html>
<head>
<title> The First Example: 1to 10 </title>
</head>
<body>
<h2> This line is HTML </h2>
<script language="JavaScript">
<!--
document.write("1,2,3,4,5,6,7,8,9,10.This sentence is written using JavaScript.");
// Text on the right of 2 slashes is comment
/* This is comment
that occur more than 1 line
*/
//-->
</script>
<noscript>
Sorry, but your browser doesn't run JavaScript.
</noscript>
<h2> This line is HTML </h2>
</body>
</html>





2015年3月12日 星期四

第二次作業

1.
2.


/**
 * The HelloWorldApp class implements an application that
 * simply prints "Hello World!" to standard output.
 */
class HelloWorldApp {
    public static void main(String[] args) {
        System.out.println("Hello World!"); // Display the string.
    }
}
3.
import java.net.*;

public class TestInet1 {
  public static void main(String argv[])
  {
    try {
      InetAddress myip = InetAddress.getLocalHost();

      System.out.println(myip.getHostName());
      System.out.println(myip.getHostAddress());
    } catch (UnknownHostException e) {
      System.out.println("Error: unable to resolve localhost");
    }
  }
}
                                                                        4.


2015年3月5日 星期四

第一次

1.為何why要選修這門課?(動機)                        因為想學習程式設計
2.希望從這門課獲得那些知識?(目標)                如何做程式,如何管理BLOG
3.我要如何修習這一門課?(態度與方法)             認真上課不翹課   
who, when, where 






class Test
{
public static void main(String[] args)
{
System.out.println("_____*_____");
System.out.println("____***____");
System.out.println("___*****___");
System.out.println("__*******__");
System.out.println("_____*_____");
System.out.println("_____*_____");
}
}