任务 - DVD类 [英] Task - DVD Class

查看:119
本文介绍了任务 - DVD类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!


我正在尝试编写一个DVD类,它将以多种方式为DVD建模。我写了一个测试驱动程序来练习我的课程。我希望每张DVD都有一个假的序列号。 ,第一个数字应该从1开始并且增加。


我在编写这段代码时遇到了麻烦,因为我在java上是新的,所以我根本就没有技能,哈哈!


我的程序需要拥有这些DVD Public" Constants" (用于方法界面)


REGION_FREE(0)不会干扰指定的区域代码

NTSC_FORMAT(1)

PAL_FORMAT(2)

DVD_SECTOR_SIZE(2048)(字节)


和这些DVD方法

1. DVD (字符串标题,int区域,int格式,双倍长度) - 创建一个带有标题,区域代码,格式和特定​​长度(以分钟为单位)的DVD。

2. static String getClassAuthor() - 返回作者姓名

3. double getLength() - 以分钟为单位返回DVD的长度

4. long getSectorNumber(双分钟) - 检索与时间戳关联的扇区号假设电影的视频速率为4.096 Mbps,第一个电影扇区为1024.(假设Mbps为每秒10 ^ 6位)。

5. int getRegion() - 返回区域代码

6. String getTitle() - 返回DVD的标题

7。 int getSerialNumber() - 返回DVD的序列号

8. String toString() - 返回DVD的文本表示:

serial_number,Title,Region ,格式,numberMinut es)。例如1,史瑞克II,1,1,105。默认的double to string转换是可以接受的。


这是我将用于与我的程序接口的驱动程序代码...

Hi!

I am trying to write a DVD class that will model a DVD in several ways. I wrote a test driver program to exercise my class. I want each DVD to have a fake serial number. The first number should start at 1 and increase.

I''m having trouble writing this code because I am SOOOOOO new at java, so i have no skill at all, haha!

My program needs to have these DVD Public "Constants" (used in method interface)

REGION_FREE (0) which won''t interfere with the assigned region codes
NTSC_FORMAT (1)
PAL_FORMAT (2)
DVD_SECTOR_SIZE (2048) (in Bytes)

and these DVD Methods
1. DVD(String title, int region, int format, double length) - creates a DVD with a title, region code, format, and with a specific length in minutes)
2. static String getClassAuthor() - returns name of author
3. double getLength() - returns length of dvd in minutes
4. long getSectorNumber( double minutes ) - retrieve sector number associated with a time stamp assuming the video rate for the movie is 4.096 Mbps and the first movie sector is 1024. (Assume that Mbps is 10^6 bits per second).
5. int getRegion() - returns the region code
6. String getTitle() - returns the title of the DVD
7. int getSerialNumber() - return the serial number of the DVD
8. String toString() - returns a text representation of the DVD:
"serial_number,Title,Region,Format,numberMinut es). Such as "1,Shrek II,1,1,105". The default double to string conversion is acceptable.

This is my driver code that i will use for interface with my program...

展开 | 选择 | 换行 | 行号

推荐答案

本网站的专家非常乐意帮助您解决问题,但他们无法为您完成任务/计划。首先尝试自己的作业/计划并发布有关您遇到的任何困难或有关您不知道如何实现的特定代码功能的问题。


请阅读< a href =http://www.thescripts.com/forum/faq.php?faq=posting_guidelines\"target =_ blank>发布指南,特别是课程作业发布指南


然后当你准备好发布一个新的这个帖子中的问题。


MODERATOR
The experts on this site are more than happy to help you with your problems but they cannot do your assignment/program for you. Attempt the assignment/program yourself first and post questions regarding any difficulties you have or about a particular function of the code that you don''t know how to achieve.

Please read the Posting Guidelines and particularly the Coursework Posting Guidelines.

Then when you are ready post a new question in this thread.

MODERATOR


好的,所以我staretd在这看起来更难,这是我到目前为止...它编译好,但后来我查看了交互窗口(没有GUI),我在''DVD''中得到了这个错误没有''main''方法带参数:([Ljava.lang.String;)。 "这是我的代码......我的测试用例

ok, so i staretd looking harder at this and this is what i have so far...it compiles fine, but then i look in the interactions window (there is no GUI) and i get this error "No ''main'' method in ''DVD'' with arguments: ([Ljava.lang.String;)." Here''s my code...with my test case

展开 | 选择 | Wrap | 行号


DVD不是使用main方法的类,Driver2是。您可以通过以下命令从命令行启动程序:

DVD isn''t the class with a main method, Driver2 is. You launch your program from the command line by writing:

展开 | 选择 | Wrap | 行号


这篇关于任务 - DVD类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆