Location:
Search - uml test java
Search list
Description: uml 实验全部....里面有12个不同的uml项目-uml test all .... there are 12 different projects uml
Platform: |
Size: 2251776 |
Author: tiantang |
Hits:
Description: 用类描述计算机中CPU的速度和硬盘的容量。要求Java应用程序有4个类,名字分别是PC、CPU、HardDisk和Test,其中Test是主类。
PC类与CPU和HardDisk类关联的UML图如下:
其中,CPU类要求getSpeed()返回speed的值,要求setSpeed(int m)方法将参数m的值赋值给speed。HardDisk类要求getAmount()返回amount的值,要求setAmount(int m)方法将参数m的值赋值给amount。PC类要求setCPU(CPU c)将参数c的值赋值给cpu,要求setHardDisk(HardDisk h)方法将参数h的值赋值给HD,要求show()方法能显示cpu的速度和硬盘的容量。
主类Test的要求
(1) main方法中创建一个CPU对象cpu,cpu将自己的speed设置为2200;
(2) main方法中创建一个HardDisk对象disk,disk将自己的amount设置为200;
(3) main方法中创建一个PC对象pc;
(4) pc调用setCPU(CPU c)方法,调用时实参是cpu;
(5) pc调用setHardDisk(HardDisk h)方法,调用时实参是disk
(6) pc调用show()方法。-With class describes the computer CPU speed and hard drive capacity. Requirements Java application has four categories, names are PC, CPU, HardDisk and Test, where Test is the main class. PC with UML class diagram CPU and HardDisk class association as follows: where, CPU type requires getSpeed () Returns the value of the speed, requiring setSpeed (int m) method of the value of the parameter m is assigned to speed. HardDisk class requires getAmount () Returns the value of the amount of required setAmount (int m) method parameter m is assigned to amount. PC class requires setCPU (CPU c) the value of the parameter c is assigned to cpu, requires setHardDisk (HardDisk h) method parameter values h is assigned to HD, requirements show () method can show cpu speed and hard drive capacity. Requirements main class Test of (1) main method to create a CPU target cpu, cpu own speed is set to 2200 (2) main method to create a HardDisk targe
Platform: |
Size: 31744 |
Author: 张文蔷 |
Hits: