题目内容

本题程序的功能是计算1~10(包括1和10)中除5以外各个自然数的和。请将下述程序补充完整(注意:不得改动程序的结构,不得增行或删行)。 public class basic public static void main (String[] args) int i = 1; int sum = 0; while(i <= 10) if(i == 5) ______; ______; ______; i++; System.out.println ("sum="+sum);

查看答案
更多问题

本题程序的功能是监听键盘敲击事件,并将敲击的字符显示在标签上。开始时文字标签提示“Please press your keyboard!”,当按下键盘上的字符键时,文字标签就变为“’X’is pressed!”(X代表用户按下的键所代表的字符)。请将下述程序补充完整(注意:不得改动程序的结构,不得增行或删行)。 import java.awt.*; import java.awt.event.*; import javax.swing.*; public class simple extends Frame ______ public static void main(String args[]) simple f = new simple("simple"); Panel pan = new Panel(); f.init(); public simple(String str) super (str); public void init() addWindowListener(new WindowAdapter() public void windowClosing(WindowEvent e) System.exit (0); ); setSize(200,200); setLayout(new FlowLayout()); lab = new Label("Please press your keyboard!"); add(lab); addKeyListener(this); setVisible(true); public void keyTyped(KeyEvent e) lab.setText("\’"+______+"\’ is pressed!"); repaint(); public void keyPressed(KeyEvent e) public void keyReleased(KeyEvent e) private Label lab;

Briefly introduce Blake’s Songs of Innocence and Songs of Experience.

What are the factors that gave rise to American naturalism

This is my letter to the World That never wrote to Me— The simple News that Nature told— With tender Majesty Questions: A. Identify the poet. B. What idea does the poem express C. Why does the poet use dashes and capital letters in the poem

答案查题题库