Time of Update: 2018-12-04
MyTriangle.hclass Triangle{public:Triangle(){a = 1; b = 1; c = 1;}Triangle(double x, double y, double z){a = x; b = y; c = z;}double area(void);double perimeter(void);private:double a, b, c;};MyTriangle.cpp#include "stdafx.h"#include
Time of Update: 2018-12-04
/* (程式頭部注釋開始)* 程式的著作權和版本聲明部分* Copyright (c) 2011, 煙台大學電腦學院學生 * All rights reserved.* 檔案名稱: * 作 者: 鮑增凱 * 完成日期: 2012 年 5 月 21 日* 版 本 號: * 對任務及求解方法的描述部分* 輸入描述: * 問題描述: *
Time of Update: 2018-12-04
<span style="font-size:18px;">/*【任務】下面給出了基類Animal和main()函數。(任務.1)根據main()函數給出的注釋提示,設計出相關的各個類。(任務.2)顯然,Animal設計為抽象類別更合適,Animal不需要能夠執行個體化,是專門作基類使用的。改造程式,使Animal設計為抽象類別,這時main()函數中p = new
Time of Update: 2018-12-04
/* (程式頭部注釋開始) * 程式的著作權和版本聲明部分 * Copyright (c) 2011, 煙台大學電腦學院學生 * All rights reserved.* 檔案名稱:通過撞錯理解訪問限定符和繼承方式 * 作 者: 鮑增凱* 完成日期:2012 年5月21日 * 版 本 號: vc.1 * 對任務及求解方法的描述部分 * 輸入描述: *
Time of Update: 2018-12-04
<span style="font-size:18px;">//【任務】寫一個程式,定義抽象基類Shape,由它派生出個衍生類別,Circle(圓形)、Rectangle(矩形)、Triangle(三角形)。用如下的mian()函數,求出定義的幾個幾何體的面積和。</span> 來源程式及運行結果 <span style="font-size:18px;">#include<iostream>#define pi 3.14using
Time of Update: 2018-12-04
03.#include<iostream> 04.#include<Cmath> 05.using namespace std; 06. 07.enum SymmetricStyle {axisx, axisy, point}; //分別表示按x軸, y軸, 原點對稱 08.class CPoint 09.{ 10.private: 11. double x; // 橫座標 12. double y; // 縱座標
Time of Update: 2018-12-04
01.#include <iostream> 02.using namespace std; 03.class Time 04.{public: 05. Time(int h,int m,int s):hour(h),minute(m),sec(s){} 06. void display1(); //成員函式宣告 07. friend void display2(Time &); //友元函式宣告 08. int
Time of Update: 2018-12-04
#include<iostream> using namespace std; class Time { public: void set_time( ); void show_time( ); inline void add_a_sec(); inline void add_a_minute();
Time of Update: 2018-12-04
06.#include<iostream> 07.#include<Cmath> 08.using namespace std; 09. 10.class CPoint 11.{ 12.private: 13. double x; // 橫座標 14. double y; // 縱座標 15.public: 16. void input(); //以x,y 形式輸入座標點 17. float
Time of Update: 2018-12-04
01.#include <iostream> 02. 03.using namespace std; 04.class Complex 05.{ 06.public: 07. Complex(){real=0;imag=0;} 08. Complex(double r,double i){real=r;imag=i;} 09. Complex operator+(Complex &c2); 10. Complex operator-(
Time of Update: 2018-12-04
01.#include<iostream> 02. 03.using namespace std; 04. 05.class NaturalNumber 06.{ 07.private: 08. int n; 09.public: 10. void setValue (int x);//置資料成員n的值,要求判斷是否是正整 11. int getValue(); //返回私人資料成員n的值 12.
Time of Update: 2018-12-04
01.#include<iostream> 02.#include<Cmath> 03.using namespace std; 04. 05.class CPoint 06.{ 07.private: 08. double x; // 橫座標 09. double y; // 縱座標 10.public: 11. void input(); //以x,y 形式輸入座標點 12. float
Time of Update: 2018-12-04
01.#include <iostream> 02. 03.using namespace std; 04.class Complex 05.{ 06.public: 07. Complex(){real=0;imag=0;} 08. Complex(double r,double i){real=r;imag=i;} 09. friend Complex operator+(Complex &c1,Complex &c2); 10
Time of Update: 2018-12-04
FractionDlg.cppvoid CmyfractionDlg::OnSysCommand(UINT nID, LPARAM lParam){if ((nID & 0xFFF0) == IDM_ABOUTBOX){CAboutDlg dlgAbout;dlgAbout.DoModal();}else{CDialog::OnSysCommand(nID, lParam);}}// 如果向對話方塊添加最小化按鈕,則需要下面的代碼// 來繪製該表徵圖。對於使用文檔/視圖模型的 MFC
Time of Update: 2018-12-04
01.#include <iostream> 02. 03.using namespace std; 04.class Complex 05.{ 06.public: 07. Complex(){real=0;imag=0;} 08. Complex(double r,double i){real=r;imag=i;} 09. friend Complex operator+(Complex &c1,Complex &c2); 10
Time of Update: 2018-12-04
/* (程式頭部注釋開始)* 程式的著作權和版本聲明部分* Copyright (c) 2011, 煙台大學電腦學院學生 * All rights reserved.* 檔案名稱: * 作 者:鮑增凱 * 完成日期: 2012 年 5 月 28 日* 版 本 號: * 對任務及求解方法的描述部分* 輸入描述: * 問題描述: *
Time of Update: 2018-12-04
#include <iostream>using namespace std;class Time{public: void set_time();void show_time(); void change_time(); void add_seconds(int n); void add_minutes(int n); void add_hours(int n);private:bool is_time(int,int,int); void
Time of Update: 2018-12-04
#include<iostream>using namespace std;class Box{public:void get_value();void display();float volume();float area();private:float length;float width;float height;};void Box::get_value(){cout<<"please input length,width,height:";cin>>
Time of Update: 2018-12-04
#include <iostream> #include <Cmath> using namespace std; class Triangle {public: void Setabc(float x, float y, float z);//置三邊的值,注意要能成三角形 void Getabc(float *x, float *y, float *z);//取三邊的值 float
Time of Update: 2018-12-04
01.#include <iostream> 02.using namespace std; 03.class Salary 04.{ 05.public: 06. void set_salarys( ); 07. void add_salarys(); 08. void sort_salarys(); 09. void show_salarys( );