skip to main
|
skip to sidebar
JAVA程式設計學習
2009年4月25日 星期六
Homework 8 : Fraction Multiplication
Write a program to implement a method that can multiply 2 fractions. You will implement a class called Fraction consisting of a numerator and a denominator. The multiplication of
2 fractions should be equal to a fraction.
Use 1/2 * 1/3 as the test.
Hints:
Fraction f1, f2;
f1।multiply(f2);
兩數相乘後利用輾轉相除法取分子、分母的最大公因數進行約分
1/2 * 1/3 = 1/6
8/7 * 3/4 = 6/7
沒有留言:
張貼留言
較新的文章
較舊的文章
首頁
訂閱:
張貼留言 (Atom)
我的網誌清單
●色々な世界○
なりたい
16 年前
張耀仁教授
21不是盡頭 柳暗花明又一村
16 年前
インターネット システム デザイン
Lab 45 : Packet Sniffer
16 年前
標籤
其他
(2)
Homework
(10)
Lab
(31)
網誌存檔
▼
2009
(43)
►
6月
(5)
►
5月
(9)
▼
4月
(5)
Lab 18 : Class definition 3
Lab 19 : Lab ADT
Homework 8 : Fraction Multiplication
Lab 17 : Fraction equality test
Lab 16 : Fraction Addition
►
3月
(19)
►
2月
(5)
最新回應
載入中…
關於我自己
武
中原大學電子工程系大四生
檢視我的完整簡介
沒有留言:
張貼留言