java难题_挑战java难题!!!高手进来

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

The LFG must be further studied to find the most appropriate LFG values that

produce “more random” sequences. A useful and simple technique is to use a visual

aid. For example, below is a Java program that plots the values of the random

sequence as a bar graph. It can also be used to generate a statistical plot of the

frequency of occurrences of each number in the random sequence.

Task

Write your own version of the visualiser tool for the part 1, LFG sequences. Your

Java program must be capable of generating bar graphs for both the raw sequence of

numbers, and a statistical plot of the frequency of occurrence of each number in the

sequence. Your program must allow the user to select a colour scheme, and setup the

parameter values. Errors in the value of the parameters can be displayed as a message

box or sent to the standard error stream.

The bar graphs are self-adjusting. That is, depending on the size of the sequence of

numbers, the scale of the bar graph fits almost exactly to the size of the display area.

Requirements

Students are required to produce their own solutions to this task by constructing the

following source code files:

• File: Visualiser.java

o The main java program for this task, it constructs a derived JFrame

object which contains the various visual elements of the program.

• File: LaggedFib.java

o The LFG class, contains an interface for specifying the LFG values and

for generating the pseudo random numbers.

o A Vector object must be used to store the LFG seed values within a

LFG object.

• File: Stats.java

o A simple tally class that can be used to record the number of times a

particular number appears in the LFG sequence.

• File: VisualiserException.java

o An exception class for errors in the Visualiser class

• File: LaggedFibException.java

o An exception class for errors in the LaggedFib class

Note: a Java package must be constructed to contain your source code.

Submission

An electronic copy of your assignment must be emailed to your lecturer by the due

date.

Marking Scheme

The part is worth 20% of your overall CP2004 grade.

Execution: 15 marks

• Testing the program with various LFG values

Coding: 5 marks

• Appropriate code organisation

• Ordinary comments (see Chap 2 of the textbook)

• Code Formatting

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值