3道练习题

Learn-anything 2009-05-19 07:57:03
1. a.Some of the characteristics of a book are title, author(s),publishers,ISBN,price,and year of publication.Design the class Book that defines the book as an ADT.

Each object of the class Book can hold the following information about a book:title, up to four authors,publisher,ISBn,price,and number of copies in stock. To keep track of the number of authors,add another instrance variable.
Include the methods to proform various operations on the objects of Book. For example, the usual operations that can be performed on the title are to show the title, and check whether a title is the actual title of the book.Similarly, the typical operations than can be performed on the number of copies in stock, update the number of ncopoes in stock,and return the number of copier in stock.Add similar operations for the publisher,ISBN,book price,and author.Add the appropriate constructors and a finalizer(if one is needed)

b.Write the definitions of the methods of the class Book.
c.write a program that uses the class Book and tests various operations on the objects of class Book.Declare an array of 100 components of the type Book. Some of the operations that you should perform are to search for a book by its title, search by ISBN, and update the number of copies of a book.



2. In this exercise, you willdesign the class Member
a. Each object of Member can hold the name of a person, member ID,number of books bought, and amount spent.
b. Include the methods to perform the various operations on the objects of the class Member- for exampl,modify,set,and show a person's name.Similarly update,modify,and show the numberof booksbought and the amount spent.
c.Add the appropriate constructors and a finalizer (if one needed).
d.Write the definition of the methodsof the class Member.


3. Using the classes designed in Programming Exercise 1 and 2, write a program to simulate a bookstore. The bookstore has two types of customers:those who are members of bookstore and those who buybooks from the bookstore only occasionally, Each member has to pay a $10 yearly membership fee and receivers a 5% discount on each book bought.

For each member,the bookstore keeps track of the bought and the total amount spent. For every eleventh book that a member buys, the bookstore takes the average of the total amount of the last 10 books bought, applies this amount as a discount, and then resets the total amount spent to 0.

write a program that can peocess up to 1000 book titles and 500 members. Your program should contain a menu that user different choices to effectively run the program; in other words, your program should be menu-driven.


帮忙写写,谢谢
...全文
195 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
kingssman 2009-05-20
  • 打赏
  • 举报
回复
自己动手丰衣足食
这么问还不如不去学
Learn-anything 2009-05-20
  • 打赏
  • 举报
回复
主要是给别人问的啊
我不是学Java的
sachmx1234 2009-05-20
  • 打赏
  • 举报
回复
晕哦。。还搞全英文。。- -!
ovemoon 2009-05-20
  • 打赏
  • 举报
回复
晕! 作业哦!
猿敲月下码 2009-05-20
  • 打赏
  • 举报
回复
意思大体是这样的:

  创建一个类,一些特点是一本书,书名、作者(s),出版商,ISBN、价格、出版设计类的书,这本书更像是一个应当责令定义。
  
  每个对象的类的书可以持以下信息:标题、一本书的作者,出版商的四个,ISBn、价格、数量的拷贝的存货。跟踪这个数目的作者,加上另一个保险由按变量。
  包括了各种操作方法来实行的对象的书。例如,通常可以执行操作的标题是指冠军头衔,并检查是否有实际的书名的。同样,典型的行动比可以执行的份数存货,更新ncopoes数量的股票,并返回这个数目的复印机存货添加类似的行动为出版商,ISBN、图书价格,作者加入适当的建设者和finalizer(如果需要)。
  
  b。定义该Book类的方法
  c.write是一个程序,使用这个类书籍和测试各种操作对象的类的书声明一个数组的组件类型的书100。有些作业,你应该执行是寻找一本书的标题,搜索的功能,并更新号码元的一本书的副本。
  
  
  2。在这个练习中,你将设计类成员
  一。每个对象的会员可持有某个人的名字会员号码,数字图书购买,并花费。
  b。包括了执行各种操作方法对对象的类成员-为航班计划、修改设置,显示一个人的名字同样的更新、修改和显示numberof booksbought和花费。
  c。加入适当的建设者和finalizer(如果需要)。
  d。写的定义,methodsof类成员。
  
  
  3。使用类设计在编程练习1和2、编写一个程序,模拟一个书店。书店有两种类型的客户:那些成员的书店和那些buybooks只是偶尔从那家书店,每个成员都要付10美元的年度会费和接收机5%的折扣,每有人买一本书。
  
  每一个成员,书店买的花,总金额。11书,每一个成员,书店买的平均花费的总金额,适用于去年10本书买这个金额作为一个折扣,然后重置总花费为0。
  
  编写一个程序,可以演变到1000书名和500个成员。你的程序应该包含一个菜单,用户选择不同的程序来有效地运行,换句话说,你的程序应该菜单驱动的。

---------------------------
Translated from YOUDAO!
justinavril 2009-05-20
  • 打赏
  • 举报
回复
我看了一下,题目不难,大致的翻一下,细节楼主在研究吧。


1. a.Some of the characteristics of a book are title, author(s),publishers,ISBN,price,and year of publication.Design the class Book that defines the book as an ADT. //设计一个抽象数据类型Book,来定义它的属性:书名,作者,发行商,ISBN号,价格和发行年份。

Each object of the class Book can hold the following information about a book:title, up to four authors,publisher,ISBn,price,and number of copies in stock. To keep track of the number of authors,add another instrance variable.
Include the methods to proform various operations on the objects of Book. For example, the usual operations that can be performed on the title are to show the title, and check whether a title is the actual title of the book.Similarly, the typical operations than can be performed on the number of copies in stock, update the number of ncopoes in stock,and return the number of copier in stock.Add similar operations for the publisher,ISBN,book price,and author.Add the appropriate constructors and a finalizer(if one is needed)

b.Write the definitions of the methods of the class Book. //编写Book类的方法
c.write a program that uses the class Book and tests various operations on the objects of class Book.Declare an array of 100 components of the type Book. Some of the operations that you should perform are to search for a book by its title, search by ISBN, and update the number of copies of a book.//写一个程序来使用Book类,并且要测试Book类里面的方法。还要你去实现一个依照书名,或者ISBN号来搜索和update Book实例的功能,


2. In this exercise, you willdesign the class Member //设计一个类Member,其实就是借书人的对象,要有姓名,ID,他所借的书,以及结束所花费的钱
a. Each object of Member can hold the name of a person, member ID,number of books bought, and amount spent.
b. Include the methods to perform the various operations on the objects of the class Member- for exampl,modify,set,and show a person's name.Similarly update,modify,and show the numberof booksbought and the amount spent.
c.Add the appropriate constructors and a finalizer (if one needed).
d.Write the definition of the methodsof the class Member.


3.//利用前面两个类,来模拟实现一个书店。
Using the classes designed in Programming Exercise 1 and 2, write a program to simulate a bookstore. The bookstore has two types of customers:those who are members of bookstore and those who buybooks from the bookstore only occasionally, Each member has to pay a $10 yearly membership fee and receivers a 5% discount on each book bought.

For each member,the bookstore keeps track of the bought and the total amount spent. For every eleventh book that a member buys, the bookstore takes the average of the total amount of the last 10 books bought, applies this amount as a discount, and then resets the total amount spent to 0.

write a program that can peocess up to 1000 book titles and 500 members. Your program should contain a menu that user different choices to effectively run the program; in other words, your program should be menu-driven.
胡须棉花糖 2009-05-19
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 bao110908 的回复:]
作业帖!应该删除!
[/Quote]
qgqch2008 2009-05-19
  • 打赏
  • 举报
回复
cky417 2009-05-19
  • 打赏
  • 举报
回复
自己做吧,看楼主的技术分不低,应该难不了你的
Girl_my_lover 2009-05-19
  • 打赏
  • 举报
回复
就是叫你设计两个类嘛
然后使用两个类。。楼主加油哦!
xnjnmn 2009-05-19
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 bao110908 的回复:]
作业帖!应该删除!
[/Quote]

1 Design the class Book

2 design the class Member

3 Using the classes designed in Programming Exercise 1 and 2
write a program that can peocess up to 1000 book titles and 500 members.

很基础


LZ要加油了
  • 打赏
  • 举报
回复
作业帖!应该删除!

62,614

社区成员

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

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