博客來網路書店查詢

書名

博客來網路書店查詢

星期五, 5月 27, 2016

C++與SQLite--引用項目

#include
#include
#include
#include
#include
using namespace std;
#include "sqlite3.h"
#define DB "sea.s3db"
bool isOpenDB = false;
sqlite3 *dbfile;
bool ConnectDB ( );
void DisonnectDB ( );

組裝時的問題-馬達與感測器




Arjin Chen老師回應:
那一條是GND, 接在任一GND(接地)即可, 以你目前線色看來
綠-->5V
藍-->A0(左)/2(中)/4(右)
紫-->A1(左)/3(中)/5(右)
灰-->GND

Litamei Chen 老師回應:
您好
黑色線是接地GND

吳慧琳老師回應:

A.二個馬達二條各接IDE板GND+5V

B.感測三組四條接法一樣如下:
最左邊接5V
最右邊接GND
其他中間二個又分如下:
左感應接A0,1
中感應接A2,3
右感應接A4,5




我再補一張圖片說明感測器

星期六, 5月 21, 2016

C Sharp 上課六次的主題

理論上是有點多,所以希望上課的學員先上過C/C++初進階之後再上我的課程,比較能了解我在說甚麼。
因為書本太厚加上時間太短,所以我自己有安排主題,六天課程我的安排進度如下
 第一天 數值計算、資料輸入與例外處理、條件分析
第二天 迴圈、陣列、引用VB的inputbox進行練習
第三天 亂數、ArrayList、圖片控制項的使用
第四天 兩個按鈕使用同一個函數、大量圖片使用、三個骰子遊戲
第五天 textBox能力的繼承、自己建立DLL檔案、使用者控制項轉為dll、影音播放
第六天 快顯選單、多表單、點唱機

當然如果大家之後有其他想法可以跟我說,我們上課主題可以變更。

人類繼承觀念內的子類別部分

class son1:public father1
{
public:
      float money;
    son1( )
    {
        money=father1::money*0.6;
        father1::money=father1::money- money;
        cout << "son1 father1 money="<        cout << "son1  money="<    }
};
class son2:public father1
{
public:
      float money;
    son2( )
    {
        cout << "son2 father1 money="<        money=father1::money*0.4;
    }
};
class grandson:public son1
{
public:
    float money;
    grandson( )
    {
        cout << "grandson father1 money="<        money=son1::money*0.6;
        son1::money=son1::money-money;
        cout << "grandson  money="<< money<< endl;
        cout << "grandson son1 money="<< son1::money<< endl;
    }
};

星期五, 5月 20, 2016

關於this

class部分
class Box
{
   public:
      Box(double l=2.0, double b=2.0, double h=2.0)
      {
         cout <<"建立物件" << endl;
         length = l;
         breadth = b;
         height = h;
      }
      double Volume()
      {
         return length * breadth * height;
      }
      int compare(Box box)
      {
         return this->Volume() > box.Volume();
      }
   private:
      double length;     
      double breadth;     
      double height;     
};
 
程式流程
 
   Box Box1(3.3, 1.2, 1.5);    
   Box Box2(8.5, 6.0, 2.0);    

   if(Box1.compare(Box2))
   {
      cout << "Box2 小於 Box1" <<endl;
   }
   else
   {
      cout << "Box2 大於等於 Box1" <<endl;
   }