文件名称:test
介绍说明--下载内容来自于网络,使用问题请自行百度
5.16 创建一个Fraction类执行分数运算。要求如下:
(1) 用整形数表示类的private成员变量:f1(分子),f2(分母);
(2) 提供构造方法,要求传入两个整型数,初始化分子、分母;
(3) 提供两个分数相加、减、乘、除的方法;
(4) 提供a/b的形式打印分数;
(5) 提供以浮点数形式打印分数;
(6) 编写测试类测试分数类的各方法。
5.18 编程实现以下简单超市管理,具体要求如下:
(1) 实现描述超市的类Suppermacket类,具有货架属性,记录系统中现有商品,定义盘点商品的函数check(盘点各类商品的数量,并输出盘点结果),查询商品的函数query,并显示查询结果;
(2) 定义商品类Goods,具有商品名称Name,商品价格Price,商品产地Producer等属性,操作Sale(销售商品,余额不足时给予提示)、Add(商品上架操作)和ShowMe(显示商品信息)。
(3) main函数,测试以上所要求的各种功能,即可以根据菜单命令增加、删除、查询商品、盘点商品,以及商品销售和商品上架的操作
提示:① 超市货架可以使用商品数组,数组大小100表明存放100个商品。
② 注意实现商品查询的多态性,要求可以根据商品的名称或产地或价格查询商品的数量。-5.16 Creating a Fraction class perform fractional arithmetic. Requirements are as follows: (1) the number of plastic surgery, said private member variables of the class: f1 (numerator), f2 (denominator) (2) provide a constructor, passing two integers requirements, initialize the numerator and denominator (3) provides two scores are added, subtracted, multiplied, methods other and (4) provide a/b on the printed score (5) provided in the form of print float fraction (6) the preparation of test scores for each test class method class . 5.18 The following simple programming supermarket management, specific requirements are as follows: (1) the class is implemented as class Suppermacket supermarket, with shelves property recording system existing products, check the function definition merchandise inventory (inventory number of various types of goods, and the output inventory results), the function of commodities query query and display the query results (2) the definition of commodity
(1) 用整形数表示类的private成员变量:f1(分子),f2(分母);
(2) 提供构造方法,要求传入两个整型数,初始化分子、分母;
(3) 提供两个分数相加、减、乘、除的方法;
(4) 提供a/b的形式打印分数;
(5) 提供以浮点数形式打印分数;
(6) 编写测试类测试分数类的各方法。
5.18 编程实现以下简单超市管理,具体要求如下:
(1) 实现描述超市的类Suppermacket类,具有货架属性,记录系统中现有商品,定义盘点商品的函数check(盘点各类商品的数量,并输出盘点结果),查询商品的函数query,并显示查询结果;
(2) 定义商品类Goods,具有商品名称Name,商品价格Price,商品产地Producer等属性,操作Sale(销售商品,余额不足时给予提示)、Add(商品上架操作)和ShowMe(显示商品信息)。
(3) main函数,测试以上所要求的各种功能,即可以根据菜单命令增加、删除、查询商品、盘点商品,以及商品销售和商品上架的操作
提示:① 超市货架可以使用商品数组,数组大小100表明存放100个商品。
② 注意实现商品查询的多态性,要求可以根据商品的名称或产地或价格查询商品的数量。-5.16 Creating a Fraction class perform fractional arithmetic. Requirements are as follows: (1) the number of plastic surgery, said private member variables of the class: f1 (numerator), f2 (denominator) (2) provide a constructor, passing two integers requirements, initialize the numerator and denominator (3) provides two scores are added, subtracted, multiplied, methods other and (4) provide a/b on the printed score (5) provided in the form of print float fraction (6) the preparation of test scores for each test class method class . 5.18 The following simple programming supermarket management, specific requirements are as follows: (1) the class is implemented as class Suppermacket supermarket, with shelves property recording system existing products, check the function definition merchandise inventory (inventory number of various types of goods, and the output inventory results), the function of commodities query query and display the query results (2) the definition of commodity
(系统自动生成,下载前可以参看下载内容)
下载文件列表
test/
test/.classpath
test/.project
test/.settings/
test/.settings/org.eclipse.jdt.core.prefs
test/bin/
test/bin/Fraction.class
test/bin/TestFrac.class
test/bin/sssu/
test/bin/sssu/Goods.class
test/bin/sssu/Mytest.class
test/bin/sssu/SuperMarket.class
test/bin/sssu/Test.class
test/src/
test/src/Fraction.java
test/src/TestFrac.java
test/src/sssu/
test/src/sssu/Goods.java
test/src/sssu/Mytest.java
test/src/sssu/SuperMarket.java
test/src/sssu/Test.java
test/.classpath
test/.project
test/.settings/
test/.settings/org.eclipse.jdt.core.prefs
test/bin/
test/bin/Fraction.class
test/bin/TestFrac.class
test/bin/sssu/
test/bin/sssu/Goods.class
test/bin/sssu/Mytest.class
test/bin/sssu/SuperMarket.class
test/bin/sssu/Test.class
test/src/
test/src/Fraction.java
test/src/TestFrac.java
test/src/sssu/
test/src/sssu/Goods.java
test/src/sssu/Mytest.java
test/src/sssu/SuperMarket.java
test/src/sssu/Test.java
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.