在线视频国产欧美另类,偷拍亚洲一区一区二区三区,日韩中文字幕在线视频,日本精品久久久久中文字幕

<small id="qpqhz"></small>
  • <legend id="qpqhz"></legend>

      <td id="qpqhz"><strong id="qpqhz"></strong></td>
      <small id="qpqhz"><menuitem id="qpqhz"></menuitem></small>
    1. 如何寫vc實驗報告

      時間:2020-10-11 11:24:44 報告 我要投稿

      如何寫vc實驗報告

        篇一:VC++實驗報告 (2)

      如何寫vc實驗報告

        VC++實驗報告

        班號:0904101

        學號:090410123

        姓名:仲維祎

        實驗一VC++開發(fā)環(huán)境的熟悉和C++基礎(chǔ)知識實驗

        一、實驗?zāi)康?/p>

        1. 掌握C++語言的特點。

        2. 掌握C++的各種數(shù)據(jù)類型及基本運算。

        3. 掌握C++各種控制結(jié)構(gòu)及使用技巧。

        4. 掌握C++的.函數(shù)、數(shù)組、指針的相關(guān)概念和使用方法。

        5. 靈活運用C++相關(guān)基礎(chǔ)知識進行綜合程序設(shè)計。

        6. 回顧面向過程程序設(shè)計方法。

        7. 熟悉Visual C++的開發(fā)環(huán)境

        8.掌握用應(yīng)用程序向?qū)?chuàng)建一個控制臺應(yīng)用項目的方法。

        9.掌握源代碼文件的新建、打開、保存和關(guān)閉等基本操作。

        10.掌握Visual C++項目的編譯、連接和執(zhí)行。

        11.掌握代碼簡單語法錯誤修正和調(diào)試的一般過程。

        二、實驗知識點概念

        注意C++中同C的不同之處,包括數(shù)據(jù)類型,輸入輸出等相關(guān)的差異。

        三、實驗題目

        1. 采用插入排序法,輸入10個整數(shù)按升序排序后輸出。要求編寫一個通用的插入排序函數(shù),它帶有三個參數(shù),第一個參數(shù)是含有n個元素的數(shù)組,這n個元素已按升序排序;第二個參數(shù)給出當前數(shù)組中元素個數(shù);第三個參數(shù)是要插入的整數(shù)。該函數(shù)的功能是將一個整數(shù)插入到數(shù)組中,然后進行排序。另外還需要一個用于輸出數(shù)組元素的函數(shù),要求每一行輸出5個元素。

        2. 有5個學生,每個學生的數(shù)據(jù)結(jié)構(gòu)包括學號、姓名、年齡、C++成績,數(shù)學成績和英語成績、總平均分,從鍵盤輸入5個學生的學號、姓名、3門課的成績,計算3門課的總平均分,最后將5個學生的數(shù)據(jù)輸出。要求各個功能用函數(shù)實現(xiàn)。

        3. 對程序加入斷點簡單調(diào)試。

        四、程序思路

        五、程序源代碼

        1:代碼如下

        #include

        using namespace std;

        void (char iArray[],int nCount,int nNumber)

        {

        int i=nCount-1,j=0;

        char *iArray2;

        iArray2=iArray;

        *(iArray2+nCount)=nNumber;//多分配一個空間給傳入數(shù)據(jù) for(i;i>=0;i--)

        {

        if(nCount==1)

        *iArray=nNumber;

        if (*(iArray2+i)<*(iArray+i+1))

        {

        j=*(iArray2+i);

        iArray2[i]=iArray2[i+1];

        iArray2[i+1]=j;

        }

        }

        cout<<"the array is ";

        for(i=0;i<nCount;i++)

        {cout<<a[i]<<" ";}

        }

        int main()

        {

        char a[80]={0},i,sArray=0;

        for(i=0;i<10;i++)

        {

        cout<<"please type into numbers"<<endl;

        cin>>a[i];

        if (a[i]<=999999&&a[i]>=0)

        {

        (a,sArray+1,a[i]);

        sArray++;

        }

        }

        return 1;

        }

        2:代碼如下:

        #include

        using namespace std;

        class InfStud

        {

        public:

        int id;

        char name[20];

        int age;

        int cpp;

        int math;

        int eng;

        void print();

        int all();

        };

        int InfStud::all()

        {

        int all;

        all=math+cpp+eng;

        return all;

        };

        void InfStud::print()

        {

        cout<<"the id is "<<" "<<id<<" "

        <<"the name is"<<" "<<name<<" "

        <<"the age is "<<" "<<age<<" "

        <<"the cpp is"<<" "<<cpp<<" "

        <<"the eng is"<<" "<<eng<<" "

        <<"the math is"<<" "<<math<<" "

        <<"the all is"<<" "<<all()<<" "

        <<"the avg is"<<" "<<all()/3<<endl;

        };

        void main()

        {

        InfStud student[5];

        int i=0,j;

        for(i;i<=4;i++)

        { cout<<"type the id name age c++ eng math in"<>student[i].id>>student[i].name>>student[i].age>>student[i].cpp>>student[i].eng>>student[i].math; }

        篇二:VC實驗報告

        實驗報告

        班級:網(wǎng)絡(luò)Z091

        學號:094552

        姓名:李丹

        一、

        1.

        2.

        二、

        1.

        2.

        三、

        1. 實驗?zāi)康?掌握數(shù)據(jù)庫的基本知識、ODBC程序設(shè)計 掌握列表框和組合框控件 實驗內(nèi)容 在VC++6.0中編寫程序 數(shù)據(jù)庫應(yīng)用程序基本設(shè)計和購物表設(shè)計 編程序 數(shù)據(jù)庫

        步驟:設(shè)置->控制面板->管理工具->數(shù)據(jù)源->添加->MicroSoft Access Driver(*mdb) 選擇(剛建好的數(shù)據(jù)庫)、數(shù)據(jù)源名(comp)

        定義的變量:CCompanySet m_set;(CCompanySet自己添加的類,基類為CRecordSet)CListCtrl m_list;

        CString m_chax;

       、懦跏蓟

        void CCompanyView::OnInitialUpdate()

        {

        m_list.InsertColumn(0,"num");

        m_list.InsertColumn(1,"sex");

        m_list.InsertColumn(2,"age");

        m_list.InsertColumn(3,"wage");

        m_list.SetColumnWidth(0,100);

        m_list.SetColumnWidth(1,100);

        m_list.SetColumnWidth(2,100);

        m_list.SetColumnWidth(3,100);

        CString sql="select * from comp";

        m_set.Open(AFX_DB_USE_DEFAULT_TYPE,sql);//打開記錄集

        int i=0;

        while(!m_set.IsEOF())

        {

        m_list.InsertItem(i,m_set.m_num);

        m_list.SetItemText(i,1,m_set.m_sex);

        CString str;

        str.Format("%d",m_set.m_age);

        m_list.SetItemText(i,2,str);

        m_list.SetItemText(i,3,m_set.m_wage);

        m_set.MoveNext();

        i++;

        }

        m_set.Close();

        }

       、啤疤砑印闭{(diào)出新對話框(IDD_DIALOG1)

        創(chuàng)建一個新類CCompDlg,并添加頭文件” #include "CompDlg.h"”

        及成員變量(CString m_num; int m_sex; CString m_wage; int m_age;)

        void CCompanyView::OnAdd()

        {

        CCompDlg dlg;

        if(dlg.DoModal()==IDOK)

        {

        m_set.Open(AFX_DB_USE_DEFAULT_TYPE,NULL); m_set.AddNew();

        m_set.m_num=dlg.m_num;

        if(dlg.m_sex==0)

        m_set.m_sex="男";

        else

        m_set.m_sex="女";

        m_set.m_age=dlg.m_age;

        m_set.m_wage =dlg.m_wage;

        m_set.Update();

        m_set.Close();

        }

        }

       、恰皠h除”

        void CCompanyView::OnDel()

        {

        int i=m_list.GetSelectionMark();

        if(i<0)

        this->MessageBox("先選取記錄");

        else

        {

        CString xnum1;

        char xnum[10];

        int x=m_list.GetItemText(i,0,xnum,10);

        xnum1.Format("%s",xnum);

        CString sql="select * from comp where num='"+xnum1+"'"; m_set.Open(AFX_DB_USE_DEFAULT_TYPE,sql); m_set.Delete();

        m_set.Close();

        }

        }

       、取盀g覽”

        void CCompanyView::OnScan()

        {

        m_list.DeleteAllItems();

        CString sql="select * from

        comp";

        m_set.Open(AFX_DB_USE_DEFAULT_TYPE,sql);int i=0;

        while(!m_set.IsEOF())

        m_list.InsertItem(i,m_set.m_num);

        m_list.SetItemText(i,1,m_set.m_sex);

        CString str;

        str.Format("%d",m_set.m_age);

        m_list.SetItemText(i,2,str);

        m_list.SetItemText(i,3,m_set.m_wage);

        m_set.MoveNext();

        i++;

        }

        m_set.Close();

        }

       、伞靶薷摹

        void CCompanyView::OnEdit()

        {

        CCompDlg dlg;

        int i=m_list.GetSelectionMark();

        if(i<0)

        {

        this->MessageBox("先選取記錄");

        return;

        }

        CString xnum0,xnum1;

        char xnum[10];

        int x=m_list.GetItemText(i,0,xnum,10);

        xnum1.Format("%s",xnum);

        dlg.m_num=xnum1;

        xnum0=xnum1;

        CString str="select * from comp where num='"+xnum0+"'"; m_set.Open(AFX_DB_USE_DEFAULT_TYPE,str);dlg.m_num=m_set.m_num;

        dlg.m_age=m_set.m_age;

        dlg.m_wage=m_set.m_wage;

        if(m_set.m_sex=="男")

        dlg.m_sex=0;

        else

        dlg.m_sex=1;

        dlg.DoModal();

        m_set.Edit();

        m_set.m_num=dlg.m_num;

        m_set.m_age=dlg.m_age;

        m_set.m_wage=dlg.m_wage;

        if(dlg.m_sex==0)

        m_set.m_sex="男";

        m_set.m_sex ="女";

        m_set.Update();

        m_set.Close();

        }

       、省安樵儭

        void CCompanyView::OnQuery()

        {

        this->UpdateData();

        CString sql;

        sql="select * from comp where num='"+m_chax+"'"; m_set.Open(AFX_DB_USE_DEFAULT_TYPE,sql); m_set.Requery ();

        if(m_set.IsEOF())

        {

        AfxMessageBox("ERROR");

        return ;

        }

        m_list.DeleteAllItems();

        int i=0;

        while(!m_set.IsEOF())

        {

        m_list.InsertItem(i,m_set.m_num);

        m_list.SetItemText(i,1,m_set.m_sex);

        CString str;

        str.Format("%d",m_set.m_age);

        m_list.SetItemText(i,2,str);

        m_list.SetItemText(i,3,m_set.m_wage);

        m_set.MoveNext();

        i++;

        }

        m_set.Close();

        }

        2. 購物表設(shè)計

        添加了兩個結(jié)構(gòu)體

        struct GoodsType

        {

        char * type;

        char * name;

        int price;

        }goods[]={

        "日常用品","牙刷",2,

        "日常用品","牙膏",3,

        "日常用品","毛巾",5,

      【如何寫vc實驗報告】相關(guān)文章:

      實驗報告范文01-20

      倉儲實踐實驗報告01-13

      實驗報告范文(15篇)01-20

      實驗報告范文15篇01-20

      實驗報告范文(集錦15篇)01-20

      《血染的實驗報告》讀后感01-20

      民間文學課題實驗報告01-20

      如何寫公函12-18

      如何寫好議案05-09

      議案如何寫04-09