| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1011 人关注过本帖
标题:英国Sheffield 大学开学第六周的作业!! thx for any help
只看楼主 加入收藏
lingminglee
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2004-11-16
收藏
 问题点数:0 回复次数:0 
英国Sheffield 大学开学第六周的作业!! thx for any help
COM1010: Introduction to Programming: Assignment 7 Dr Louise Guthrie 1. Overview Any work that you hand in for this assignment must be your own work. Plagiarism will result in a mark of 0. Allowing someone else to knowingly copy your work will also result in a mark of 0, as you would be facilitating and encouraging plagiarism. The following programming exercise is intended to help you learn the Java language. The question reinforces the use of Java Standard Library, JavaDoc tool, and concepts covered in the corresponding lecture. For the assessment details, please refer to http://www.dcs.shef.ac.uk/~louise/campus_only/com1010/ 2. The programming problem 1. This question involves designing, implementing and using a class called QandA. The main program should implement a simple arithmetic game for children. It starts by asking for the name of the child. She types in her name and is then given 10 random arithmetic questions, involving addition and subtraction, where the operands and answers are all in the range 0..20. (See Math.random for a method that returns a random number.) The child should be told what the correct answer is if she gets the answer wrong. After 10 questions have been answered the player’s score is displayed, along with a relevant message, e.g. “Well done”. There should be a different message for each score out of 10 and the child’s name should be included in the message. You need to write a class called QandA that generates a single question and answer as part of the constructor. The generated question and answer could be stored as attributes of the class. A method could be supplied to retrieve the question (perhaps as a String). Another method could be supplied to retrieve the answer or, alternatively, to check a supplied answer against the one stored for the question. You must decide what are the useful attributes and methods. A tricky part is designing the algorithm to generate a question, since the operands and answers must all be in the range 0..20 As part of the handin material for this particular question you should run javadoc on your class for a question and print out the contents of the resulting Web page describing the methods. See the Sun's website http://java.sun.com/j2se/javadoc/ for documentation on JavaDoc. Example: > Java ProgName Start of program… Type in your name: Jo Hello Jo Question 1. 13 + 4 = ? Answer? 17 Good Question 2. 12 - 6 = ? Answer ? … and so on… … Question 10. 19-13 = ? Answer? 12 The correct answer is 6. You scored 7 out of 10. A good score Jo.
搜索更多相关主题的帖子: 英国 thx Sheffield help 作业 
2004-11-17 20:42
快速回复:英国Sheffield 大学开学第六周的作业!! thx for any help
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015022 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved