文件名称:shuijing-cpu-java
-
所属分类:
- 标签属性:
- 上传时间:2016-04-24
-
文件大小:31.44kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
用类描述计算机中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
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
(系统自动生成,下载前可以参看下载内容)
下载文件列表
shuijing cpu java.docx
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.