第十五周實驗報告(一)

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

第十二周實驗報告二

/* (程式頭部注釋開始)* 程式的著作權和版本聲明部分* Copyright (c) 2011, 煙台大學電腦學院學生 * All rights reserved.* 檔案名稱:                              * 作    者:               鮑增凱       * 完成日期:       2012  年      5 月       21 日* 版 本 號:          * 對任務及求解方法的描述部分* 輸入描述: * 問題描述: *

第十三周實驗報告二

<span style="font-size:18px;">/*【任務】下面給出了基類Animal和main()函數。(任務.1)根據main()函數給出的注釋提示,設計出相關的各個類。(任務.2)顯然,Animal設計為抽象類別更合適,Animal不需要能夠執行個體化,是專門作基類使用的。改造程式,使Animal設計為抽象類別,這時main()函數中p = new

第十二周實驗報告一

/* (程式頭部注釋開始)  * 程式的著作權和版本聲明部分  * Copyright (c) 2011, 煙台大學電腦學院學生   * All rights reserved.* 檔案名稱:通過撞錯理解訪問限定符和繼承方式 * 作 者: 鮑增凱* 完成日期:2012 年5月21日 * 版 本 號: vc.1 * 對任務及求解方法的描述部分 * 輸入描述:  *

第十三周實驗報告三

<span style="font-size:18px;">//【任務】寫一個程式,定義抽象基類Shape,由它派生出個衍生類別,Circle(圓形)、Rectangle(矩形)、Triangle(三角形)。用如下的mian()函數,求出定義的幾個幾何體的面積和。</span> 來源程式及運行結果  <span style="font-size:18px;">#include<iostream>#define pi 3.14using

第六周實驗報告(三)

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; // 縱座標

第七周實驗 報告(二)

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

第四周實驗報告(二)

#include<iostream> using namespace std;                                                       class Time      {      public:      void set_time( );             void show_time( ); inline void add_a_sec();             inline void add_a_minute(); 

第六周實驗 報告(四)

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

第八周實驗報告(1-1)

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-(

第四周實驗報告(三)

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.

第七周實驗報告(一)

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

第八周實驗報告(1-2)

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

第十五周實驗報告(二)

FractionDlg.cppvoid CmyfractionDlg::OnSysCommand(UINT nID, LPARAM lParam){if ((nID & 0xFFF0) == IDM_ABOUTBOX){CAboutDlg dlgAbout;dlgAbout.DoModal();}else{CDialog::OnSysCommand(nID, lParam);}}// 如果向對話方塊添加最小化按鈕,則需要下面的代碼// 來繪製該表徵圖。對於使用文檔/視圖模型的 MFC

第八周實驗報告(1-3)

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

第十三周實驗報告(四)

/* (程式頭部注釋開始)* 程式的著作權和版本聲明部分* Copyright (c) 2011, 煙台大學電腦學院學生 * All rights reserved.* 檔案名稱: * 作 者:鮑增凱 * 完成日期: 2012 年 5 月 28 日* 版 本 號: * 對任務及求解方法的描述部分* 輸入描述: * 問題描述: *

第三周實驗報告(三)

#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

第三周實驗報告(四)

#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>>

第四周實驗報告(一)

#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

第四周實驗報告(四)

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( );

總頁數: 61357 1 .... 16615 16616 16617 16618 16619 .... 61357 Go to: 前往

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.