본문 바로가기

structured approach using C++

Project 9-67 Euclid's method to get the Greate commom divisor and the Least common muliple 유클리드 소거법으로 최대공약수, 최소공배수 구하기 //============================================================================ // 제출일 : 2005. 4. 12 // 작업환경 : Windows XP SP1, VC++ 6.0, Pentium4 // 연습문제 9-67 //============================================================================ #include int get_gcd(int a, int b); //recursive fuction int main() { int gcd; int a, b; cout > a; cout > b; gcd = get_gcd(a, b); cout 더보기
Project 4-41 Create customers' bills 영수증 발행 //============================================================================ // 제출일 : 2005. 3. 12 // 작업환경 : Windows XP SP1, VC++ 6.0, Pentium4 // 연습문제 4-41 // : Call by Reference를 사용하기 위하여 메인함수에 값을 받아오는 함수를 // 추가하였습니다. 클래스 구조를 사용할 경우 굳이 사용할 필요는 없습니다만 // 주어진 조건에 충실하기 위하여 추가하였습니다. //============================================================================ #include #include #define LABOR 0.35 .. 더보기
Project 4-40 Random number 랜덤 //============================================================================ // 제출일 : 2005. 3. 12 // 작업환경 : Windows XP SP1, VC++ 6.0, Pentium4 // 연습문제 4-40 //============================================================================ #include #include #include #include int main() { float number; int rand_num; float product; //Process No. cout > number; //2 cout 더보기
Project 4-39 Temperature convertor : Fathrenheit VS Centigrade 온도변환기 : 화씨 섭씨 //============================================================================ // 제출일 : 2005. 3. 12 // 작업환경 : Windows XP SP1, VC++ 6.0, Pentium4 // 연습문제 4-39 //============================================================================ #include void C2F(float input) //썹씨를 화씨로 고치는 함수 { float output; output = 32 + input*(180/100); //변환식 cout 더보기
Project 4-38 Compute the interest and print the balance //============================================================================ // 제출일 : 2005. 3. 12 // 작업환경 : Windows XP SP1, VC++ 6.0, Pentium4 // 연습문제 4-38 //============================================================================ #include #include #include #include #include float calc(float input); //이자의 계산 void print(float input); //출력 int main() { float begining_balance; cout > begining.. 더보기
Project 4-37 Prepare a payroll earnings statement //============================================================================ // 제출일 : 2005. 3. 12 // 작업환경 : Windows XP SP1, VC++ 6.0, Pentium4 // 연습문제 4-37 // data.txt로 부터 세일즈맨의 정보를 읽어와 처리함 //============================================================================ #include #include #include #include #include class Salesperson { public: Salesperson(); //Default 생성자 ~Salesperson(); //소멸자 voi.. 더보기
Problem 4-35 print the ceiling, floor, and rounded value of a floating-point number //============================================================================ // 제출일 : 2005. 3. 12 // 작업환경 : Windows XP SP1, VC++ 6.0, Pentium4 // 연습문제 4-35 //============================================================================ #include #include float round(float num); int main() { float num; cout > num; cout 더보기
Problem 4-33 Modify the "Add two digit" grogram //============================================================================ // 제출일 : 2005. 3. 12 // 작업환경 : Windows XP SP1, VC++ 6.0, Pentium4 // 연습문제 4-33 //============================================================================ #include //using namespace std; // Prototype Declarations int addThreeDigits (int num); int firstDigit (int); int secondDigit (int); int thirdDigit (int); int ma.. 더보기