Java开发网 |
注册 |
登录 |
帮助 |
搜索 |
排行榜 |
发帖统计
|
您没有登录 |
» Java开发网 » Java SE 综合讨论区
打印话题 寄给朋友 订阅主题 |
作者 | 紧急的问题,请高手们解释(理解英語題目) |
kof821117
发贴: 31 积分: 0 |
于 2006-01-17 20:44
请尽量使用准确的文字描述作为标题 原來的标题: 紧急的问题,请高手们解释 关于这个问题的,希望高手们解释这个题目到底要我做什么。 This question checks your ability to write the methods as described below. It tests your ability to use System.out.println() method, and to change the values of instance variables inside "mutator" methods. The Copier needs developing to do some copying! A method to do this (i.e. to simulate it by taking in a string and outputting it to the terminal window) is added. A further, rather clumsy method, to make multiple copies is also added. Make a new version of your Copier project and edit the Copier class so that it has the following additional methods. public int makeCopy(String s) that takes a String as a parameter, and outputs it on a single line to the terminal window. It should also increment (add 1 to) the total number of copies made, and return this as an int, and decrement (subtract 1 from) the number of sheets of paper available. public int make5Copy(String s) that takes a String as a parameter and outputs it on five successive single lines to the terminal window. It should also increase the total number of copies made by 5, and return this total as an int, and reduce the number of sheets available by 5. cp03 testing code The code used to test the Copier Class also uses methods written in previous assessments: Copier c = new Copier(); c.testCopier(); if (c.makeCopy("makeCopy Works") == 1) { System.out.println("and registers copies made"); } else { System.out.println("but doesn't register copies made correctly"); } if (c.make5Copy("makeCopy Works") == 6) { System.out.println("and registers copies made"); } else { System.out.println("but doesn't register copies made correctly"); } When the code is run, the output to the Terminal Window should be the lines: Copier Working makeCopy Works and registers copies made makeCopy Works makeCopy Works makeCopy Works makeCopy Works makeCopy Works and registers copies made
why edited on 2006-01-17 23:58
关于 异常 。。。。 谢谢指教 |
话题树型展开 |
人气 | 标题 | 作者 | 字数 | 发贴时间 |
14294 | 紧急的问题,请高手们解释(理解英語題目) | kof821117 | 2027 | 2006-01-17 20:44 |
12050 | Re:紧急的问题,请高手们解释(理解英語題目) | why | 173 | 2006-01-18 00:04 |
12510 | Re:紧急的问题,请高手们解释(理解英語題目) | kof821117 | 403 | 2006-01-18 02:31 |
11944 | Re:紧急的问题,请高手们解释(理解英語題目) | why | 535 | 2006-01-18 04:07 |
12548 | Re:紧急的问题,请高手们解释(理解英語題目) | kof821117 | 2206 | 2006-01-18 04:31 |
12116 | Re:紧急的问题,请高手们解释(理解英語題目) | why | 680 | 2006-01-18 04:52 |
12644 | Re:紧急的问题,请高手们解释(理解英語題目) | kof821117 | 250 | 2006-01-18 09:57 |
11952 | Re:紧急的问题,请高手们解释(理解英語題目) | why | 640 | 2006-01-18 10:11 |
12534 | Re:紧急的问题,新的一个问题又来了,~~ | kof821117 | 309 | 2006-01-18 10:03 |
12492 | Re:紧急的问题,请高手们解释(理解英語題目) | kof821117 | 3610 | 2006-01-18 10:07 |
12086 | Re:紧急的问题,请高手们解释(理解英語題目) | why | 2950 | 2006-01-25 12:14 |
12645 | Re:紧急的问题,请高手们解释(理解英語題目) | kof821117 | 801 | 2006-01-18 00:26 |
12047 | Re:紧急的问题,请高手们解释(理解英語題目) | why | 121 | 2006-01-18 00:32 |
12573 | Re:紧急的问题,请高手们解释(理解英語題目) | kof821117 | 983 | 2006-01-18 00:43 |
12567 | Re:紧急的问题,请高手们解释(理解英語題目) | kof821117 | 640 | 2006-01-18 00:45 |
12798 | Re:紧急的问题,请高手们解释(理解英語題目) | kof821117 | 606 | 2006-01-18 00:51 |
11932 | Re:紧急的问题,请高手们解释(理解英語題目) | why | 2705 | 2006-01-18 01:01 |
12561 | Re:紧急的问题,请高手们解释(理解英語題目) | kof821117 | 75 | 2006-01-18 01:06 |
11994 | Re:紧急的问题,请高手们解释(理解英語題目) | why | 259 | 2006-01-18 01:19 |
12643 | Re:紧急的问题,请高手们解释(理解英語題目) | kof821117 | 58 | 2006-01-18 01:35 |
已读帖子 新的帖子 被删除的帖子 |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |