几道作业题目据说是剑桥大学研究生一年级的作业

xxsteven 2003-10-30 12:19:45
G6DICP 2 Tim Brailsford, October 2003.
Task A (10% Marks)
Write a program called cw1a (ie the main method will be in a class called “cw1a”). This program should
print out the title banner for the coursework and your name as shown below.
|-------------------------------------------------
| G6DICP Coursework 1 - FizBuz Simulator
| by <Your name goes here>
|-------------------------------------------------
Task B (30% Marks)
Write a program called cw1b . This program should print out the title banner and then print out a table
containing numbers 1-100. Your program should use loops to achieve this, and the output will look similar
to that shown below.
|-------------------------------------------------
| G6DICP Coursework 1 - FizBuz Simulator
| by <Your name goes here>
|-------------------------------------------------
1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30
31 32 33 34 35 36 37 38 39 40
41 42 43 44 45 46 47 48 49 50
51 52 53 54 55 56 57 58 59 60
61 62 63 64 65 66 67 68 69 70
71 72 73 74 75 76 77 78 79 80
81 82 83 84 85 86 87 88 89 90
91 92 93 94 95 96 97 98 99 100
Task C (35% Marks)
Write a program called cw1c. This program should print out a table similar to that of task B, but instead of
the number, numbers divisible by 5 will be replaced by “Fiz” and numbers divisible by 7 will be replaced
by “Buz”
Task D (25% Marks)
Write a program called cw1d. This program should print out a table similar to that of task C, but “Fiz”
should also be used to replace numbers that contain a 5, and “Buz” should also be used to replace numbers
that contain a 7 (nb this is in addition to replacing the numbers divisible by 5 and 7). Finally draw a neat
box around your table.
Task E
Document your code by writing instructions explaining how to run it, listing all of the files you have
submitted, and specifying any limitations (eg you might want to say what platforms you would expect it to
run on, and what platforms you have tested it on). This document should be written as a plain text file (ie
ASCII – MS Word binary files are not acceptable) – and this file should be called README.TXT.
This, together with the comments in your source code, will constitute your documentation. There will be
marks in each task for documentation – which is why a specific allocation isn’t given here.
G6DICP 3 Tim Brailsford, October 2003.
Coursework Submission
The submission procedure will be the same for all three courseworks – so it is well worth getting it right
now! If you get this wrong, then you might loose some (or even all) of the marks for that coursework. We
do not gratuitously penalize trivial mistakes in the submission procedure, but failing to follow these
instructions could cause your work to get lost or to be misunderstood by a marker. If that happens then it is
your problem, not ours!
1. important that you follow these instructions exactly because parts of the submission and administration
process are automated.
2. Prepare your files for submission. Compile your programs, and place both the source code and
binaries for each task into a directory called, taskA, taskB, taskC and taskD respectively (the
README.TXT file should not be in a directory, since this is applicable to all tasks).
Assuming that you have used a single class per program, you should have the following files:
cw1/README.TXT
cw1/taskA/cw1a.java
cw1/taskA/cw1a.class
cw1/taskB/cw1b.java
cw1/taskB/cw1b.class
cw1/taskC/cw1c.java
cw1/taskC/cw1c.class
cw1/taskD/cw1d.java
cw1/taskD/cw1d.class
3. Your source code should contain a comment at the top in the format shown below - modified to
contain your name and username (not mine!).
/**
* Author : T.J. Brailsford
* Date : 3/10/03
* Module : G6DICP
* Title : ICP Coursework 1
* SCSiT Username : tjb
*/
4. Compress all of these files into a single ZIP archive – preserving the directory structure. Name the zip
file as your username, and the coursework number. For example, if your username is tjb03m and this
is coursework 1 then name the file tjb03m-cw1.zip.
5. Attach your zip file to a single e-mail, which you should send to an address that will be provided by
the submission deadline. At the time of writing this address is not available – it will be posted on the
module web site before the submission deadline – please wait for this DO NOT SEND
COURSEWORK DIRECTLY TO ME!
The Subject field should contain the text "ICP-CW1" followed by your last name, and then your
initials. For example - my submission would be:
ICP-CW1 BRAILSFORD, TB
If your name is Colin Coder, then the subject field of your submission should be:
ICP-CW1 CODER, C
Do not include any text in the body of your e-mail – submissions are batch processed - they won't be
read!! If you need to include any explanatory notes, then please place them as comments in your
source code -underneath the heading comment described above. After submitting the work you should
receive a confirmation of receipt. If you don't get this (allow some time - it is usually almost instant,
but it could take over an hour), then first check that the address you used is correct, and then failing
that contact me (Tim.Brailsford@nottingham.ac.uk).
6. University e-mail systems (usually SCSiT) should be used for submission of work. DO NOT use
outside systems such as Hotmail. At times of high traffic these systems can be unreliable for mail with
attachments, and loosing coursework in Hotmail will not be considered an excuse for non-submission
or late submission!
NOTE for people who want to e-mail from home. The SCSiT e-mail system is accessible from outside
the Nottingham domain – you can access your account from anywhere in the world. This is supported by
TSG, and details of how to configure your mailer are available on the TSG web site. You are very strongly
advised to use university mail services (either SCSiT or IS) for all university business.
Hints
1. You should always develop your programs in stages – the tasks here are designed to help you to do
this.
2. Leave the box around the output until everything else is working – it is much easier if this is the last
apect of the program that you implement.
3. Use a nested loop for task B.
4. Implement the Buz functionality on its own at first. When this is working, then implementing Fiz will
be identical – you just change a 5 into a 7. If you design your code carefully, you could even use
exactly the same code for both.

...全文
106 20 打赏 收藏 转发到动态 举报
写回复
用AI写文章
20 条回复
切换为时间正序
请发表友善的回复…
发表回复
fancy05 2003-11-01
  • 打赏
  • 举报
回复
学习
make1me1laugh 2003-11-01
  • 打赏
  • 举报
回复
就是看e文看得烦了,题目倒是好办
xxsteven 2003-11-01
  • 打赏
  • 举报
回复
可以帮着做做吗?都怪我,我确实对java一点都不懂呀
mygerald 2003-10-31
  • 打赏
  • 举报
回复
extremely easy
nettman 2003-10-31
  • 打赏
  • 举报
回复
呵呵~~!
ivanrong 2003-10-31
  • 打赏
  • 举报
回复
实在是太简单啦:做了两题就已经不想再做啦

for(int i = 1 ;i<= 100 ;i++){
String temp ;
if(i%5 == 0 ){
temp = "Fiz";
}else if (i%7 == 0){
temp = "Buz";
}else{
temp = String.valueOf(i);
}
System.out.print(temp);
System.out.print(" ");
if(i%10 == 0){
System.out.println("");
}
}
junyi2003 2003-10-31
  • 打赏
  • 举报
回复
那么多英语,看得我头昏
sadenxu 2003-10-31
  • 打赏
  • 举报
回复
Too easy……
不屑一顾
xiachedan 2003-10-31
  • 打赏
  • 举报
回复
晕,英语的看不懂!!!
clapton 2003-10-31
  • 打赏
  • 举报
回复
后面的还是有点烦琐的
nightwishlzw 2003-10-31
  • 打赏
  • 举报
回复
NND是不是大家的英语水平都不错啊?
我怎么什么都看不懂啊
真是太高深了
看来还是准备一本字典还是比较爽
呵呵
bluesmile979 2003-10-31
  • 打赏
  • 举报
回复
难度不是很大,不过是很不错的作业题
xxsteven 2003-10-30
  • 打赏
  • 举报
回复
hehe
xxsteven 2003-10-30
  • 打赏
  • 举报
回复
有兴趣的麻烦作一下,有些我也觉得不是很简单,呵呵。
nanye18 2003-10-30
  • 打赏
  • 举报
回复
看看!
xxsteven 2003-10-30
  • 打赏
  • 举报
回复
帮个忙哈,我也是帮朋友,不过我只回c,不会java,我都答应帮她了,妈的。
xxsteven 2003-10-30
  • 打赏
  • 举报
回复
哪个帮忙写一下哈,我一点也做不来,帮帮忙。写就有分
spook_l 2003-10-30
  • 打赏
  • 举报
回复
mark
symyx 2003-10-30
  • 打赏
  • 举报
回复
haha,it's easy,every easy.
北极猩猩 2003-10-30
  • 打赏
  • 举报
回复
挺容易的,估计是Java课程的作业,留给初学者作的

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧