ImageVerifierCode 换一换
格式:DOCX , 页数:42 ,大小:687.02KB ,
资源ID:355275      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/355275.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(面向对象程序设计实验指导书51162.docx)为本站会员(b****1)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

面向对象程序设计实验指导书51162.docx

1、面向对象程序设计实验指导书51162面向对象程序设计实验指导书黄利萍 刘国奇东北大学软件学院2010.9前 言面向对象的思想可以渗透到需求分析、系统建模、体系结构设计、程序设计与实现、系统测试等多个方面,它是描述现实世界复杂对象的相当直接而且直观的有效手段,对于提高系统质量、开发效率和代码重用率,都有明显的效果。面向对象程序设计课程是软件工程专业的重要专业基础课程之一,该门课程注重实践性和实用性,主要通过面向对象程序设计思想和Java语言结合起来,让学生掌握面向对象程序设计思想,以及熟练使用Java语言进行面向对象的编程,因此学生不能满足于只听懂老师讲授的课堂内容,看懂书上的程序,应将课堂教学

2、与实践环节紧密结合,使得学生加深对讲授内容的理解,学会上机调试程序。也就是善于发现程序中的错误,并且能很快地排除这些错误,使程序能正确运行。面向对象程序设计是结合卡耐基梅隆大学的SSD3而形成的课程,该课程的教学体系和实验体系都很完整,并且东北大学软件学院也提供了良好的教学实验环境,希望同学们能够充分利用实验条件,认真完成实验,从实验中得到应有的锻炼和培养。希望同学们在使用本实验指导书及进行实验的过程中,能够帮助我们不断地发现问题,并提出建议,使面向对象程序设计真正能够帮助同学们学习。实验要求面向对象程序设计课程实验的目的是为了使学生在课堂学习的同时,通过一系列的实验,使学生加深了解和更好地掌

3、握面向对象程序设计课程教学大纲要求的内容。在面向对象程序设计的课程实验过程中,要求学生做到:(1)预习实验指导书有关部分,认真做好实验内容的准备,就实验可能出现的情况提前作出思考和分析。(2)仔细观察调试程序过程中出现的各种问题,记录主要问题,作出必要说明和分析。(3)遵守机房纪律,服从辅导教师指挥,爱护实验设备。(4)实验课程不迟到,如有事不能出席,所缺实验一般不补。(5)本实验采用的开发环境为Eclipse,同学在做实验之前要求熟悉该集成开发环境。 Experiment 1 Implementing the Gourmet Coffee System(4 Hours)Prerequisit

4、es, Goals, and OutcomesPrerequisites: Before you begin this exercise, you need mastery of the following: Object Oriented Programming o Knowledge of class design Class attributes Constructors Accessor methods Mutator methods o Knowledge of inheritance How to implement a specialization/generalization

5、relationship using inheritance Goals: Reinforce your ability to implement Java classes using inheritance. Outcomes: You will demonstrate mastery of the following: Implementing the constructors, accessors, and mutators of a Java class Using inheritance to implement a specialization/generalization rel

6、ationship Background This assignment asks you to implement some of the classes in the Gourmet Coffee System specified on Exercise 2.DescriptionIn this assessment, you will implement the classes and relationships illustrated in the following class diagram:Figure 1 Portion of Gourmet Coffee System cla

7、ss diagramThe class specifications are as follows:Class ProductThe class Product models a generic product in the store.Instance variables: code. The unique code that identifies the product description. A short description of the product price. The price of the product Constructor and methods: public

8、 Product(String initialCode, String initialDescription, double initialPrice)Constructor that initializes the instance variables code, description, and price. public String getCode(). Returns the value of instance variable code. public String getDescription(). Returns the value of instance variable d

9、escription. public double getPrice(). Returns the value of instance variable price. boolean equals(Object object). Overrides the method equals in the class Object. Two Product objects are equal if their codes are equal. String toString(). Overrides the method toString in the class Object. Returns th

10、e string representation of a Product object. The String returned has the following format: code_description_priceThe fields are separated by an underscore ( _ ). You can assume that the fields themselves do not contain any underscores.Class CoffeeThe class Coffee models a coffee product. It extends

11、class Product.Instance variables: origin. The origin of the coffee roast. The roast of the coffee flavor. The flavor of the coffee aroma. The aroma of the coffee acidity. The acidity of the coffee body. The body of the coffee Constructor and methods: public Coffee(String initialCode, String initialD

12、escription, double initialPrice, String initialOrigin, String initialRoast, String initialFlavor, String initialAroma, String initialAcidity, String initialBody)Constructor that initializes the instance variables code, description, price, origin, roast, flavor, aroma, acidity, and body. public Strin

13、g getOrigin(). Returns the value of instance variable origin. public String getRoast(). Returns the value of instance variable roast. public String getFlavor(). Returns the value of instance variable flavor. public String getAroma(). Returns the value of instance variable aroma. public String getAci

14、dity(). Returns the value of instance variable acidity. public String getBody(). Returns the value of instance variable body. String toString(). Overrides the method toString in the class Object. Returns the string representation of a Coffee object. The String returned has the following format: code

15、_description_price_origin_roast_flavor_aroma_acidity_bodyThe fields are separated by an underscore ( _ ). You can assume that the fields themselves do not contain any underscores.Class CoffeeBrewerClass CoffeeBrewer models a coffee brewer. It extends class Product.Instance variables: model. The model of the coffee brewer waterSupply. The water supply (Pour-over or Automatic) numberOfCups. The capacity of the coffee brewer Constructor and methods: public CoffeeBrewer(String initialCode,

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1