文件名称:CPD3314-Assign6
介绍说明--下载内容来自于网络,使用问题请自行百度
java的小练习,练习继承 class method 的调用。- Exercise#2- Car Class
*
* Write a class named Car that has the following fields:
*- yearModel. The yearModel field is an int that holds the car s year model.
*- make. The make field references a String object that holds the make of the car.
*- speed. The speed field is an int that holds the car s current speed.
* In addition, the class should have the following constructor and other methods.
*- Constructor. The constructor should accept the car s year model and make as
* arguments. These values should be assigned to he object s yearModel and
* make fields. The constructor should also assign 0 to the speed field.
*- Accessors. Appropriate accessor methods should get the values stored in an
* object s yearModel, make, and speed fields.
*- accelerate. The accelerate method should add 5 to the speed field each time
* it is called.
*- brake. The brake method should subtract 5 the speed field each time it
* is called.
* In the main class (CPD3314As
*
* Write a class named Car that has the following fields:
*- yearModel. The yearModel field is an int that holds the car s year model.
*- make. The make field references a String object that holds the make of the car.
*- speed. The speed field is an int that holds the car s current speed.
* In addition, the class should have the following constructor and other methods.
*- Constructor. The constructor should accept the car s year model and make as
* arguments. These values should be assigned to he object s yearModel and
* make fields. The constructor should also assign 0 to the speed field.
*- Accessors. Appropriate accessor methods should get the values stored in an
* object s yearModel, make, and speed fields.
*- accelerate. The accelerate method should add 5 to the speed field each time
* it is called.
*- brake. The brake method should subtract 5 the speed field each time it
* is called.
* In the main class (CPD3314As
(系统自动生成,下载前可以参看下载内容)
下载文件列表
CPD3314-Assign6/.git/config
CPD3314-Assign6/.git/FETCH_HEAD
CPD3314-Assign6/.git/HEAD
CPD3314-Assign6/.git/index
CPD3314-Assign6/.git/logs/refs/heads/master
CPD3314-Assign6/.git/logs/refs/remotes/origin/master
CPD3314-Assign6/.git/objects/pack/pack-d54c4bd5ef07689002ee6a01cbae1e9e638a2ed1.idx
CPD3314-Assign6/.git/objects/pack/pack-d54c4bd5ef07689002ee6a01cbae1e9e638a2ed1.pack
CPD3314-Assign6/.git/refs/heads/master
CPD3314-Assign6/.git/refs/remotes/origin/master
CPD3314-Assign6/build/built-jar.properties
CPD3314-Assign6/build.xml
CPD3314-Assign6/Deposits.txt
CPD3314-Assign6/manifest.mf
CPD3314-Assign6/nbproject/build-impl.xml
CPD3314-Assign6/nbproject/genfiles.properties
CPD3314-Assign6/nbproject/private/private.properties
CPD3314-Assign6/nbproject/private/private.xml
CPD3314-Assign6/nbproject/project.properties
CPD3314-Assign6/nbproject/project.xml
CPD3314-Assign6/README.md
CPD3314-Assign6/src/cpd3314/assign6/Car.java
CPD3314-Assign6/src/cpd3314/assign6/Circle.java
CPD3314-Assign6/src/cpd3314/assign6/CPD3314Assign6.java
CPD3314-Assign6/src/cpd3314/assign6/SavingsAccount.java
CPD3314-Assign6/test/cpd3314/assign6/CarTest.java
CPD3314-Assign6/test/cpd3314/assign6/CircleTest.java
CPD3314-Assign6/test/cpd3314/assign6/SavingsAccountTest.java
CPD3314-Assign6/Withdrawals.txt
CPD3314-Assign6/_gitignore
CPD3314-Assign6/.git/logs/refs/remotes/origin
CPD3314-Assign6/.git/logs/refs/heads
CPD3314-Assign6/.git/logs/refs/remotes
CPD3314-Assign6/.git/refs/remotes/origin
CPD3314-Assign6/.git/logs/refs
CPD3314-Assign6/.git/objects/pack
CPD3314-Assign6/.git/refs/heads
CPD3314-Assign6/.git/refs/remotes
CPD3314-Assign6/src/cpd3314/assign6
CPD3314-Assign6/test/cpd3314/assign6
CPD3314-Assign6/.git/logs
CPD3314-Assign6/.git/objects
CPD3314-Assign6/.git/refs
CPD3314-Assign6/nbproject/private
CPD3314-Assign6/src/cpd3314
CPD3314-Assign6/test/cpd3314
CPD3314-Assign6/.git
CPD3314-Assign6/build
CPD3314-Assign6/nbproject
CPD3314-Assign6/src
CPD3314-Assign6/test
CPD3314-Assign6
CPD3314-Assign6/.git/FETCH_HEAD
CPD3314-Assign6/.git/HEAD
CPD3314-Assign6/.git/index
CPD3314-Assign6/.git/logs/refs/heads/master
CPD3314-Assign6/.git/logs/refs/remotes/origin/master
CPD3314-Assign6/.git/objects/pack/pack-d54c4bd5ef07689002ee6a01cbae1e9e638a2ed1.idx
CPD3314-Assign6/.git/objects/pack/pack-d54c4bd5ef07689002ee6a01cbae1e9e638a2ed1.pack
CPD3314-Assign6/.git/refs/heads/master
CPD3314-Assign6/.git/refs/remotes/origin/master
CPD3314-Assign6/build/built-jar.properties
CPD3314-Assign6/build.xml
CPD3314-Assign6/Deposits.txt
CPD3314-Assign6/manifest.mf
CPD3314-Assign6/nbproject/build-impl.xml
CPD3314-Assign6/nbproject/genfiles.properties
CPD3314-Assign6/nbproject/private/private.properties
CPD3314-Assign6/nbproject/private/private.xml
CPD3314-Assign6/nbproject/project.properties
CPD3314-Assign6/nbproject/project.xml
CPD3314-Assign6/README.md
CPD3314-Assign6/src/cpd3314/assign6/Car.java
CPD3314-Assign6/src/cpd3314/assign6/Circle.java
CPD3314-Assign6/src/cpd3314/assign6/CPD3314Assign6.java
CPD3314-Assign6/src/cpd3314/assign6/SavingsAccount.java
CPD3314-Assign6/test/cpd3314/assign6/CarTest.java
CPD3314-Assign6/test/cpd3314/assign6/CircleTest.java
CPD3314-Assign6/test/cpd3314/assign6/SavingsAccountTest.java
CPD3314-Assign6/Withdrawals.txt
CPD3314-Assign6/_gitignore
CPD3314-Assign6/.git/logs/refs/remotes/origin
CPD3314-Assign6/.git/logs/refs/heads
CPD3314-Assign6/.git/logs/refs/remotes
CPD3314-Assign6/.git/refs/remotes/origin
CPD3314-Assign6/.git/logs/refs
CPD3314-Assign6/.git/objects/pack
CPD3314-Assign6/.git/refs/heads
CPD3314-Assign6/.git/refs/remotes
CPD3314-Assign6/src/cpd3314/assign6
CPD3314-Assign6/test/cpd3314/assign6
CPD3314-Assign6/.git/logs
CPD3314-Assign6/.git/objects
CPD3314-Assign6/.git/refs
CPD3314-Assign6/nbproject/private
CPD3314-Assign6/src/cpd3314
CPD3314-Assign6/test/cpd3314
CPD3314-Assign6/.git
CPD3314-Assign6/build
CPD3314-Assign6/nbproject
CPD3314-Assign6/src
CPD3314-Assign6/test
CPD3314-Assign6
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.