预赛试题 复赛试题 决赛试题
预赛试题A卷 Java程序设计
 

  一.选择题(每道题3分,共45分)

  (1)Java语言具有许多优点和特点,下列选项中,哪个反映了Java程序并行机制的特点?

A、安全性  B、多线性  C、跨平台  D、可移植

  (2)Character流与Byte流的区别是

A、每次读入的字节数不同  B、前者带有缓冲,后者没有  

C、前者是块读写,后者是字节读写  D、二者没有区别,可以互换使用

  (3)监听事件和处理事件

A、都由Listener完成  B、都由相应事件Listener处登记过的构件完成

C、由Listener和构件分别完成  D、由Listener和窗口分别完成

  (4)Applet可以做下列哪些操作?

A、读取客户端文件  B、在客户端主机上创建新文件 

C、在客户端装载程序库  D、读取客户端部分系统变量

  (5)下列哪个属于容器的构件?

A、JFrame B、JButton C、JPanel D、JApplet

  (6)以下声明合法的是()

  A、defaultStrings;B、publicfinalstaticnativeintw( )

  C、abstractdoubled;D、abstractfinaldoublehyperbolicCosine( )

  (7)关于以下application的说明,正确的是()

  1.classStaticStuff

  2. {

  3.                  staticintx=10;

  4.                  static{ x+=5;}

  5.                  publicstaticvoidmain(Stringargs[ ])

  6.                  {

  7.                 System.out.println(“x=” + x);

  8.                  }

  9.                  static{ x/=3;}

  10.   }

  A、4行与9行不能通过编译,因为缺少方法名和返回类型

  B、9行不能通过编译,因为只能有一个静态初始化器

  C、编译通过,执行结果为:x=5

  D、编译通过,执行结果为:x=3

  (8)关于以下程序代码的说明正确的是()

  1.classHasStatic{

  2.privatestaticintx=100;

  3.publicstaticvoidmain(Stringargs[]){

  4.HasStatichs1=newHasStatic();

  5.hs1.x++;

  6.HasStatichs2=newHasStatic();

  7.hs2.x++;

  8.hs1=newHasStatic( );

  9.hs1.x++;

  10.              HasStatic.x- -;

  11.             System.out.println(“x=”+x);

  12.              }

  13.             }

  A、 5行不能通过编译,因为引用了私有静态变量

  B、 10行不能通过编译,因为x是私有静态变量

  C、程序通过编译,输出结果为:x=103

  D、程序通过编译,输出结果为:x=102

  (9)以下选项中循环结构合法的是()

  A、while (inti<7)

  {i++;

  System.out.println(“i is “+i);

  }

  B、 intj=3;

  while(j)

  {System.out.println(“ jis “+j);

  }

  C、intj=0;

  for(intk=0; j + k !=10; j++,k++)

  {System.out.println(“ jis “+ j + “kis”+ k);

  }

  D、  intj=0;

  do{

  System.out.println( “jis “+j++);

  if (j = = 3) {continueloop;}

  }while(j<10);

  (10)类Test1定义如下:

  1.publicclassTest1{

  2.publicfloataMethod(float a,floatb){}

  3.

  4.}

  将以下哪种方法插入行3是不合法的。()

  A、publicfloataMethod(floata, floatb,floatc){}

  B、publicfloataMethod(floatc,float d){}

  C、publicintaMethod(inta, int b){}

  D、private float aMethod(int a,int b,int c){}

  (11)类Test1、Test2定义如下:

  1.public classTest1

  2.{ publicfloataMethod(float a,float b) throws

  3.IOException {}

  4.    }

  5.    publicclassTest2extendsTest1{

  6.

  7.}

  将以下哪种方法插入行6是不合法的。()

  A、floataMethod(floata,floatb){ }

  B、publicintaMethod(int a,int b)throwsException{ }

  C、publicfloataMethod(floatp,float q){ }

  D、publicintaMethod(int a,intb)throws IOException{ }

  (12)关于以下程序段,正确的说法是()

  1.Strings1=”abc”+”def”;

  2.   Strings2=newString(s1);

  3.    if(s1= =s2)

  4.   System.out.println(“= = succeeded”);

  5.     if (s1.equals(s2))

  6.     System.out.println(“.equals()succeeded”);

  A、行4与行6都将执行B、行4执行,行6不执行

  C、行6执行,行4不执行C、行4、行6都不执行

  (13)以下说法哪项是正确的()

  1.classMyListener

  2.extendsMouseAdapterimplementsMouseListener{

  3.    public void mouseEntered(MouseEventmev)

  4.   {System.out.println("Mouseentered.");}

  5.   }

  A、以上代码可通过编译

  B、不能通过编译,因为没有实现MouseListener接口中的所有方法

  C、不能通过编译,因为类头定义不能分行

  D、能通过编译,若组件用该类作为Mouse的监听者并且接收了mouse-exited事件,则在执行过程中会抛出异常

  (14)关于以下程序段的说法,正确的是()

  1.classMyListenerimplements

  2.                  ActionListener,ItemListener{

  3.                  public voidactionPerformed(ActionEventae){

  4.                 System.out.println("Action");}

  5.                 publicvoiditemStateChanged(ItemEventie){

  6.                  System.out.println("Item");

  7.                  }

  8.}

  A、可通过编译

  B、第2行产生编译错误

  C、第3行产生编译错误

  D、第5行产生编译错误

  (15)通过调用 newList(10,false)创建一个列表,以下关于该列表的说法哪项是错误的。()

  A、该列表不支持复选B、该列表有10个选项

  C、根据需要该列表可能有垂直滚动条D、该列表支持10个可见选项

  二.写出以下程序的运行结果。(每道题10分,共30分)

     1.写出以下程序的运行结果。

  class OverloadDemo{

  voidtestOverload( inti ){

  System.out.println(“int”);}

  voidtestOverload(Strings){

  System.out.println(“String”);}

  publicstaticvoid main(Stringargs[ ]){

  OverloadDemo a=newOverloadDemo ( );

  charch=’x’;

  a.testOverload(ch);}

  }

  2.阅读以下程序,写出输出结果。

  classFirst{

  publicFirst(){

  aMethod();}

  publicvoidaMethod(){

  System.out.println(“inFirstclass”);}

  }

  publicclassSecondextendsFirst{

  publicvoidaMethod(){

  System.out.println(“inSecondclass”);}

  public static void main(String[ ]args){

  newSecond( );}

  }

  3.写出以下程序的运行结果。

  import java.io.*;

  public class UseLabel

  {public static void main(String[] args)

  {Loop:

  for(int i=2; i<10;i++)

  {for(intj=2;j<i;j++)

  if( i%j == 0)continueLoop;

  System.out.print(i+" ");} }

  }

  三.编程题(45分)

  1.编写一个Java程序要求:开启一个文本文件,一次读取其内的一行文本。令每一行形成一个String,并将读出的String对象置于LinkedList中。请以相反次序印出LinkedList内的所有文本行。


Java程序设计A卷评分标准
 

  一.选择题

  1~5 BCBAA6~10 BCDCB11~15 CCAAB

  二.程序的运行结果

1

int

2

inSecondclass

3

2357

  三.编程题

  1.

  import java.io.*;

  import java.util.*;

  public class E01_FileIntoList {

  // Report all exceptions to console:

  public static void main(String args[])

  throws Exception {

  LinkedList lines = new LinkedList();

  BufferedReader in =

  new BufferedReader(

  new FileReader("E01_FileIntoList.java"));

  String s;

  while((s = in.readLine())!= null)

  lines.add(s);

  in.close();

  ListIterator it =

  lines.listIterator(lines.size());

  while(it.hasPrevious())

  System.out.println(it.previous());

  }

  }


  附件:(试题) (评分标准)
Java程序设计(B卷)
 

  一.选择题(每道题3分,共45分)

  (1)下列关于Java语言的特点,描述错误的是()

  A.Java是跨平台的编程语言  B.Java支持分布式计算

  C.Java是面向过程的编程语言 D.Java支持多线程

  (2)下述概念中不属于面向对象方法的是________。

  A.对象、消息 B.继承、多态 C.类、封装 D.过程调用

  (3)结构化程序设计所规定的三种基本控制结构是()

  A.输入、处理、输出  B.树形、网形、环形

  C.顺序、选择、循环  D.主程序、子程序、函数

  (4)下列关于构造方法的叙述中,错误的是()

  A.Java语言规定构造方法名与类名必须相同

  B.Java语言规定构造方法没有返回值,但不用void声明

  C.Java语言规定构造方法不可以重载

  D.Java语言规定构造方法只能通过new自动调用

  (5)下列哪个类的声明是正确的?

  A.abstract final class HI{}  B.abstract private move(){}   
  C.protected private number;  D.public abstract class Car{}

  (6)关于被私有访问控制符private修饰的成员变量,以下说法正确的是()

  A.可以被三种类所引用:该类自身、与它在同一个包中的其他类、在其他包中的该类的子类

  B.可以被两种类访问和引用:该类本身、该类的所有子类

  C.只能被该类自身所访问和修改

  D.只能被同一个包中的类访问

  (7)以下声明合法的是()

  A.defaultStrings;  B.publicfinalstaticnativeintw( )

  C.abstractdoubled; D.abstractfinaldoublehyperbolicCosine( )

  (8)Applet可以做下列哪些操作?

  A.读取客户端文件  B.在客户端主机上创建新文件 

  C.在客户端装载程序库 D.读取客户端部分系统变量

  (9)下列关于for循环和while循环的说法中哪个是正确的?

  A.while循环能实现的操作,for循环也都能实现

  B.while循环判断条件一般是程序结果,for循环判断条件一般是非程序结果

  C.两种循环任何时候都可替换

  D.两种循环结构中都必须有循环体,循环体不能为空

  (10)类Test1定义如下:

  1.publicclassTest1{

  2.publicfloataMethod(floata,floatb){}

  3.

  4.}

  将以下哪种方法插入行3是不合法的。()

  A、publicfloataMethod(floata, floatb,floatc){}

  B、publicfloataMethod(floatc,float d){}

  C、publicintaMethod(inta, int b){}

  D、private float aMethod(int a,int b,int c){}

  (11)阅读以下代码:

  import java.io.*;

  import java.util.*;

  public class foo{

  public static void main (String[] args){

  String s;

  System.out.println("s=" + s);

  }

  }

  输出结果应该是:()

  A.代码得到编译,并输出“s=”

  B.代码得到编译,并输出“s=null”

  C.由于String s没有初始化,代码不能编译通过

  D.代码得到编译,但捕获到 NullPointException异常

  (12)编译运行以下程序后,关于输出结果的说明正确的是()

  publicclassConditional{

  publicstaticvoidmain(Stringargs[]){

  intx=4;

  System.out.println(“valueis“+ ((x>4) ? 99.9 :9));

  }

  }

  A.输出结果为:valueis99.99 B.输出结果为:valueis9

  C.输出结果为:valueis9.0  D.编译错误

  (13)执行完以下代码int [ ]x = new int[10];后,以下哪项说明是正确的()

  A.x[9]为0B.x[9]未定义C.x[10]为0D.x[0]为空

  (14)关于以下程序段,正确的说法是()

  1.Strings1=“a”+“b”;

  2.   Strings2=newString(s1);

  3.    if(s1= =s2)

  4.   System.out.println(“= = is succeeded”);

  5.     if (s1.equals(s2))

  6.     System.out.println(“.equals() is succeeded”);

  A.行4与行6都将执行  B.行4执行,行6不执行

  C.行6执行,行4不执行 C.行4、行6都不执行

  (15)以下程序的运行结果是:()

  public class Increment{

  public static void main(String args[]){

  int c;

  c = 2;

  System.out.println(c);

  System.out.println(c++);

  System.out.println(c);

  }

  }

  A.2B.2C.2D.3

  2324

  2334

  二.写出以下程序的运行结果。(每道题10分,共30分)

  1、写出以下程序的运行结果。

  public class ChangeStrDemo {

  public static void changestr(String str){
    str="welcome";
     }
     public static void main(String[] args) {
       String str="1234";
       changestr(str);
       System.out.println(str);
     }
  }

     2、写出以下程序的运行结果。

  classFirst{

  publicFirst(){

  aMethod();}

  publicvoidaMethod(){

  System.out.println(“inFirstclass”);}

  }

  publicclassSecondextendsFirst{

  publicvoidaMethod(){

  System.out.println(“inSecondclass”);}

  public static void main(String[ ]args){

  newSecond( );}

  }

  3、写出以下程序的运行结果。

  public class FooDemo{

  static boolean foo(char c) {

  System.out.print(c);
    return true;
    }
    public static void main(String[] args ) {
    int i =0;
    for ( foo(’a’); foo(’b’)&&(i<2); foo(’c’)){
    i++ ;
    foo(’d’);
    }
  }

  }

  三.编程题(45分)

  1.编写一个Java程序要求:开启一个文本文件,一次读取其内的一行文本。令每一行形成一个String,并将读出的String对象置于LinkedList中。请以相反次序印出LinkedList内的所有文本行。


Java程序设计B卷评分标准
 

  一:选择题:
  1~5CDCCD 6~10CBDDB 11~15CCAAC

  二:程序阅读

  (1)1234 (2)inSecondclass (3)abdcbdcb

  三:编程题

  1.

  import java.io.*;

  import java.util.*;

  public class E01_FileIntoList {

  // Report all exceptions to console:

  public static void main(String args[])

  throws Exception {

  LinkedList lines = new LinkedList();

  BufferedReader in =

  new BufferedReader(

  new FileReader("E01_FileIntoList.java"));

  String s;

  while((s = in.readLine())!= null)

  lines.add(s);

  in.close();

  ListIterator it =

  lines.listIterator(lines.size());

  while(it.hasPrevious())

  System.out.println(it.previous());

  }

  }


  附件:(试题) (评分标准)
复赛试题A卷 Java程序设计
 

  1、使用以下哪个保留字可以使只有在定义该类的包中的其他类才能访问该类?

  A)abstract    B)private

  C)protected   D)不使用保留字

  2、下列选项中哪一个是表达式1+2+"aa"+3的值()?

  A)"12aa3"B) "3aa3"C) "12aa"D) "aa3"

  3、考虑下面的类:

  1. class Test {

  2. void test(int i) {

  3.System.out.println(“I am an int.”);

  4. }

  5. void test(String s) {

  6.System.out.println(“I am a string.”);

  7. }

  8.

  9. public static void main(String args[]) {

  10. Test t=new Test();

  11. char ch=“y”;

  12. t.test(ch);

  13. }

  14. }

  下列哪一个结论是正确的

  A)第5行不能通过编译,因为void方法不能被重载。

  B)第12行不能通过编译,因为没有将一个将char类型作为参数的test() 方法。

  C)代码不能通过编译但是会在第12行抛出异常。

  D)代码能通过编译并会产生如下输出:I am an int.

  E)代码能通过编译并会产生如下输出:I am a String.

  4、下列哪些代码编译时没有错误

  A) int i=0;

  if (i) {

  System.out.println(“Hi”);

  }

   B) boolean b=true;

  boolean b2=true;

  if(b==b2) {

  System.out.println(“So true”);

  }

  C) int i=1;

  int j=2;

  if(i==1|| j==2)

  System.out.println(“OK”);

   D) int i=1;

  int j=2;

  if (i==1 &| j==2)

  System.out.println(“OK”);

  5、如果float f=4.2F;

  Float g=new Float(4.2F);

  Double d=new Double(4.2);

  则下列哪些表达式值为真?

  A)f==g

  B)g==g

  C)d==f

  D)d.equals(f)

  E)d.equals(g)

  F)g.equals(4.2)

  6、public class Test{

  public static void add3(Integer i){

  int val=i.intValue();

  val+=3;

  i=new Integer(val);

  }

  public static void main(String args[]){

  Integer i=new Integer(0);

  add3(i);

  System.out.println(i.intValue());

  }

  }

  以上代码的结果会是以下哪个选项?

  A) 编译出错。

  B) 输出 "0"

  C) 输出 "3"

  D) 编译成功但运行时会在第3行出现异常

  7、下面程序标记处应该插入哪个选项的代码?

  class EnclosingOne{

  public class InsideOne{}

  }

  public class InnerTest{

  public static void main(String args[]){

  EnclosingOne eo=new EnclosingOne();

  //insert code here

  }

  }

  A) InsideOne ei=eo.new InsideOne();

  B) eo.InsideOne ei=eo.new InsideOne();

  C) InsideOne ei=EnclosingOne.new InsideOne();

  D) InsideOne ei=eo.new InsideOne();

  E)  EnclosingOne.InsideOne ei=eo.new InsideOne();

  8、public class SychTest{

  private int x;

  private int y;

  public void setX(int i){ x=i;}

  public void setY(int i){ y=i;}

  public Synchronized void setXY(int i){

  setX(i);

  setY(i);

  }

  public Synchronized boolean check(){

  return x!=y;

  }

  }

  在下列哪种情况下,check()方法在被另一个不同的类调用时会返回true?

  A) check() 永远也不会返回true。

  B) 当通过多线程调用setXY () 时check() 能够返回true。

  C) 当通过多线程单独调用setX() 和setY()时check() 能够返回true。

  D) 只有当SychTest 被改为允许x和y单独设值时check() 才能够返回true。

  9、import java.awt.*;

  public class X extends Frame{

  public static void main(String[] args){

  X x=new X();

  x.pack();

  x.setVisible(true);

  }

  public X(){

  setLayout(new GridLayout(2,2));

  Panel p1=new Panel();

  add(p1);

  Button b1=new Button("One");

  p1.add(b1);

  Panel p2=new Panel();

  add(p2);

  Button b2=new Button("Two");

  p2.add(b2);

  Button b3=new Button("Three");

  p2.add(b3);

  Button b4=new Button("Four");

  add(b4);

  }

  }

  当frame改变大小时,

  A) 所有都会改变高度

  B) 所有都会改变宽度

  C) Button "One" 改变高度

  D) Button "Two"改变高度

  E) Button "Three" 改变宽度

  F) Button "Four"改变高度和宽度

  10、String或StringBuffer类的对象在调用以下哪个方法时其自身会发生更改?

  A) String类的charAt()方法。

  B) String类的toUpperCase()方法。

  C) String类的replace()方法。

  D) StringBuffer类的reverse ()方法。

  E) StringBuffer类的length ()方法。

  二. 简答题(每题5分,共10分)

  1、说明final, finally, finalize的区别?

  2、线程类的方法中sleep() 和 wait() 有什么区别?

  三. 写出下列程序的输出结果(第1题5分,第2题10分,共15分)

  1、以下程序段的输出结果为。

  intj=2;

  switch( j ) {

  case2:

  System.out.print(“Value is two.”);

  case2+1 :

  System.out.println(“Value is three.”);

  break;

  default:

  System.out.println(“value is “+j);

  break;

  }

  2、阅读以下程序段:

  classParent

  {

  voidprintMe()

  {

  System.out.println(“parent”);

  }

  }

  classChildextends Parent

  {

  voidprintMe()

  {

  System.out.println(“child”);

  }

  voidprintAll()

  {

  super.printMe();

  this.printMe();

  printMe();

  }

  }

  public class Test_this

  {

  public static void main(Stringargs[ ])

  {

  ChildmyC=newChild();

  myC.printAll();

  }

  }

  输出结果为:

   

  四. 编程题(共65分)

  1、用LinkedList实现一个stack,实现其中的push(),top()和pop()方法;其中push()实现向栈中加入一个元素,top()实现得到栈的最顶元素,pop()实现删除最顶元素。(25分)

   2、为Thread撰写两个子类,其中一个的run()在启动后取得第二个Thread object reference,然后调用wait()。另一个子类的run()在过了数秒之后调用notifyAll(),唤醒第一个线程,使第一个线程可以印出消息。(40分)

  附件:
复赛试题B卷
 

  一.选择题(每道题3分,共30分)

  1、异常包含下列哪些内容?

  A)程序中的语法错误B)程序执行过程中遇到的事先没有预料到的情况

  C)程序的编译错误D)程序事先定义好的可能出现的意外情况

  2、编译下列源程序会得到哪些文件?

  class A1{

  }

  class A2{

  }

  public class B{

  public static void main(String args[]){

  }

  }

  A) 只有B.class B)只有A1.class和 A2.class文件

  C)有A1.class、A2.class和B.class文件D) 编译不成功

  3、从下面中选择三个合法标识符。

  A)IDoLikeTheLongNameClass

  B)$byte

  C)const

  D)_ok

  E)3_case

  4、如何强制垃圾回收一个对象?

  A)垃圾回收不能被强制执行。

  B)调用System.gc()。

  C)调用System.gc(), 将要回收对象的引用作为参数传入。

  D)调用Runtime.gc()。

  E)将所有指向该对象的引用赋成新值(比如null)。  

  5、给定以下类,哪个是hashCode()方法的正确实现?

  class ValuePair {

  public int a, b;

  public boolean equals(Object other) {

  try {

  ValuePair o = (ValuePair) other;

  return (a == o.a && b == o.b)

  || (a == o.b && b == o.a);

  } catch (ClassCastException cce) {

  return false;

  }

  }

  public int hashCode() {

  //Provide implementation here.

  }

  }

  请选出3个正确答案。

  A)return 0;

  B)return a;

  C)return a + b;

  D)return a – b;

  E)return a ^ b;

  F)return (a << 16) | b;

  6、哪个运算符会一直计算所有操作数?请选出两个正确答案。

  A)||

  B)+

  C)&&

  D)? :

  E)%

  7、如果str表示一个String对象“73”,那么以下哪些表达式将会把这个字符串转换为int值73?请选出两个正确答案。

  A)Integer.intValue(str)

  B)((int) str)

  C)(new Integer(str)).intValue()

  D)Integer.parseInt(str)

  E)Integer.getInt(str)

  8、关于switch结构的说法哪些是正确的?请选出1个正确答案。

  A)所有switch说明都必须有一个默认标签。

  B)在一个switch说明中,每个代码片断都必须正好有一个标签。

  C)关键词continue永远不会在一个switch说明中出现。

  D)在一个单一switch说明里,没有case标签可以跟随一个默认标签。

  E)一个字符可以用做一个case标签的值。

  9、 String a = “hello”;

  String b = new String (a);

  String c = a;

  char[] d = {‘h’,‘e’,‘l’,‘l’,‘o’};

  请从以下选项中选出两个值为真的表达式。

  A)(a == “Hello”)

  B)(a == b)

  C)(a == c)

  D)a.equals(b)

  E)a.equals(d)

  10、String或StringBuffer类的对象在调用以下哪个方法时其自身会发生更改?

  A)String类的charAt()方法。

  B)String类的toUpperCase()方法。

  C)String类的replace()方法。

  D)StringBuffer类的reverse ()方法。

  E)StringBuffer类的length ()方法。

  二、简答题(每题5分,共10分)

  1、简述Overload和Override的区别。Overloaded的方法是否可以改变返回值的类型?

  2、Abstract Class和Interface有什么区别?

  三、写出下列程序的输出结果(第1题5分,第2题10分,共15分)

  1、写出以下程序的运行结果。

  class MyException extends Exception{

  private int detail;

  MyException( int a ){detail = a;}

  public String toString( ){return "MyException "+detail; }

  }

  public class ExceptionDemo{

  public static void compute(int a) throws MyException{

  System.out.println("called compute("+a+")");

  if( a>10 )throw new MyException(a);

  System.out.println("normal exit");}

  public static void main( String args[] ){

  try{compute(6 );compute( 12 );}

  catch( MyException e ){System.out.println("Caught "+e); }}

  }

  2、写出以下程序的运行结果。

  classStaticTest {

  staticintx=1;

  int y;

  StaticTest()

  {y++;}

  publicstaticvoidmain(Stringargs[ ]){

  StaticTestst=new StaticTest();

  System.out.println("x=" + x);

  System.out.println("st.y=" + st.y);

  st=new StaticTest();

  System.out.println("st.y=" + st.y);}

  static{ x++;}

  }

  四、编程题(共65分)

  1、用Linklist实现一个队列quene;实现put()方法向队列中加入一个元素,get()方法得到第一个元素,isEmpty()判断是否为空。(25分)

  2、撰写一个 myString class,其中包含一个String对象,可于构造函数中通过引数来设定初值。加入toString()和concatenate()。后者会将String对象附加于你的内部字符串尾端。请为myString()实现clone()。撰写两个static函数,令它们都接收myString referencex引数并调用x.concatenate(“test”)。但第二个函数会先调用clone()。请测试这两个函数并展示其不同结果。(40分)

  附件:
决赛试题 Java程序设计
 

  编程题:(共1题,180分)

  一.构建一个简单的在线购物系统,系统采用B/S结构,基本功能包括:商品的添加、删除和查询以及购物车功能.

开发环境:数据库使用ACCESS。

  功能模块:

  1、商品的添加(40分)

  建立商品信息表,包含字段:商品名,商品价格,商品描述,商品种类等。该模块实现将商品信息添加到表中。

  基本样式如图1所示。

图1 添加商品页面

  2、商品的查询(40分)

  允许组合多种查询条件查询系统商品,这些条件包括商品种类,商品名等。要求种类用下拉列表框表示,商品名使用文本框接收输入。查询采取模糊查询的方式。查询页面的基本样式如图2所示。

图2 商品查询页面效果图

  在图2中输入查询条件,点击确认后,可查看到图3所示页面。

图3 查询结果

  3、在该页面可以选择删除记录。(40分)

  注:该系统中的商品类别静态指定,有日用品、文具、玩具、饰物四种。以上图片仅供参考,编程人员可以自行扩展设计商品信息表,但商品名,商品价格,商品描述,商品种类4项是必需的。查询条件也可添加,但不能减少。

  4、购物车功能(60分)

  1) 将商品添加到购物车

  2) 从购物车中删除商品

  用户可自行修改购买商品的数量,系统根据用户购买的商品及数量计算出每种商品的价格,同时计算出所有商品的消费价格。


  附件:
 

Copyright © 2006 - 2008 www.itatedu.com All Rights Reserved.