CHALLENGE #6
Write a Fraction Class.
A fraction consists of 2 integers – the numerator (num) and the denominator (denom). If the fraction is 1/2, then 1 is the numerator and 2 is the denominator.
Your fraction class should contain appropriate constructors, accessors and mutators. It should also overload the following operators:- +, -, *, /, ++, –, ==, !=, , =
Write your program in 3 files –
fraction.h – a header file (interface)
fraction.cpp – an implementation file
source.cpp – a project file that demonstrates your fraction class
ความท้าทาย #6เขียนแบบเศษส่วนส่วนประกอบของจำนวนเต็มที่ 2 (น้ำ) ตัวเศษและตัวส่วน (denom) ถ้าเศษส่วน 1/2 แล้ว 1 เป็นตัวเศษ และ 2 เป็นตัวหารเรียนเศษส่วนควรประกอบด้วยตัวสร้างที่เหมาะสม อิง accessors และ mutators นอกจากนี้มันยังควรเกินตัวต่อไปนี้: - +, -, *, /, ++, –, ==, ! =, <> < = > =เขียนโปรแกรมในไฟล์ 3 –fraction.h – ส่วนหัวของแฟ้ม (อินเตอร์เฟซ)fraction.cpp – การใช้งานsource.cpp – แฟ้มโครงการที่แสดงเศษส่วนชั้น
การแปล กรุณารอสักครู่..

CHALLENGE # 6 เขียนคลาสเศษส่วน. เศษประกอบด้วย 2 จำนวนเต็ม - เศษ (NUM) และหาร (denom) หากส่วนนี้เป็น 1/2 แล้ว 1 คือเศษและ 2 เป็นตัวหาร. ชั้นส่วนของคุณควรมีการก่อสร้างที่เหมาะสม accessors และ mutators นอกจากนี้ยังควรเกินผู้ประกอบการดังต่อไปนี้: - +, -, *, / ++ - == =, <,>, <=> = เขียนโปรแกรมของคุณใน 3 ไฟล์ - fraction.h - ส่วนหัว ไฟล์ (Interface) fraction.cpp - แฟ้มการดำเนินsource.cpp - ไฟล์โครงการที่แสดงให้เห็นถึงระดับส่วนของคุณ
การแปล กรุณารอสักครู่..
