日本黄色一级经典视频|伊人久久精品视频|亚洲黄色色周成人视频九九九|av免费网址黄色小短片|黄色Av无码亚洲成年人|亚洲1区2区3区无码|真人黄片免费观看|无码一级小说欧美日免费三级|日韩中文字幕91在线看|精品久久久无码中文字幕边打电话

當(dāng)前位置:首頁 > 芯聞號 > 充電吧
[導(dǎo)讀]1.1系統(tǒng)概要(1)?????? 進(jìn)入系統(tǒng)之前,用戶輸入密碼1234,進(jìn)入,共有3次機(jī)會(huì)。(2)?????? 用戶根據(jù)需要輸入(0~5)或(0~6)實(shí)現(xiàn)不同的功能,若輸入其他字符,則顯示按鍵錯(cuò)誤,并返

1.1系統(tǒng)概要

(1)?????? 進(jìn)入系統(tǒng)之前,用戶輸入密碼1234,進(jìn)入,共有3次機(jī)會(huì)。

(2)?????? 用戶根據(jù)需要輸入(0~5)或(0~6)實(shí)現(xiàn)不同的功能,若輸入其他字符,則顯示按鍵錯(cuò)誤,并返回界面讓用戶重新選擇。

(3)?????? 按0退出。

?

1.2基本功能要求

(1) 程序運(yùn)行時(shí)首先給出密碼輸入菜單:

?

(2)用戶進(jìn)入系統(tǒng)后,顯示6個(gè)或7個(gè)菜單的主要功能:

?

(3)流程圖

?

?

1.3主要知識(shí)點(diǎn)

(1) 使用鏈表。

(2) 用多文件管理工程。

(3) 使用switch~case語句。

(4) 用while語句實(shí)現(xiàn)循環(huán)。

(5) 用類實(shí)現(xiàn)封裝和管理數(shù)據(jù)。

(6) 用清屏函數(shù)

(7) 使用文件

?

1.4系統(tǒng)設(shè)計(jì)思路與算法

(1)?????? 打開open

?

(2)?????? 添加add

?

(3)?????? 保存save

?

(4)?????? 查找find

?

(5)?????? 顯示list

?

(6)?????? 退出exit

清屏前

?

清屏后

?

?

1.5源程序代碼

數(shù)組程序

/************************************************************************/

/* Student類???????????????????????????????????????????????????????????? */

/************************************************************************/

class student

{

public:

??????????? student()

??????????? {

??????????????????????? Name="noname";

??????????????????????? Num=0;

??????????????????????? Ponenum=0;

??????????????????????? Homework="noname";

??????????? }

??????????? void SetName();

??????????? void SetNum();

??????????? void SetPonenum();

??????????? void SetHomework();

??????????? string GetName()const{return Name;}

??????????? int GetNum()const{return Num;}

??????????? long GetPonenum()const{return Ponenum;}

??????????? string GetHomework()const{return Homework;}

??????????? void Setall();

??????????? void Display();

protected:

private:

??????????? int Num;

??????????? string Name;

??????????? long Ponenum;

??????????? string Homework;

};

/************************************************************************/

/* Setall()函數(shù)的實(shí)現(xiàn)??????????????????????????????????????????? ???????????*/

/************************************************************************/

void student::Setall()

{

??????????? SetNum();

??????????? SetName();

??????????? SetPonenum();

??????????? SetHomework();

}

/************************************************************************/

/* Set~()函數(shù)的實(shí)現(xiàn)?????????????????????????????????????????????????????? */

/************************************************************************/

??????????? void SetName()

??????????? {

??????????????????????? cout<<"請輸入學(xué)生的名字:";

??????????????????????? cin>>Name;

?

??????????? }

??????????? void SetNum()

??????????? {

??????????????????????? cout<<"請輸入學(xué)生的序號:";

??????????????????????? cin>>Num;

??????????? }

??????????? void SetPonenum()

??????????? {

??????????????????????? cout<<"請輸入學(xué)生的電話號碼:";

??????????????????????? cin>>Ponenum;?

??????????? }

??????????? void SetHomework()

??????????? {

??????????????????????? cout<<"請輸入學(xué)生的作業(yè)名:";

??????????????????????? cin>>Homework;

??????????? }

/************************************************************************/

/* Display()函數(shù)的實(shí)現(xiàn)?????????????????????????????????????????? ????????????*/

/************************************************************************/

void student::Display()

{

??????????? cout<<"學(xué)生的序號為:"<<GetNum()<<endl;

??????????? cout<<"學(xué)生的名字為:"<<GetName()<<endl;

??????????? cout<<"學(xué)生的電話號碼為:"<<GetPonenum()<<endl;

??????????? cout<<"學(xué)生的作業(yè)為:"<<GetHomework()<<endl;

}

/************************************************************************/

/* 密碼界面的實(shí)現(xiàn)?????????????????????????????????????????????????????? */

/************************************************************************/

??????????? for (int n=1;n<=3;n++)

??????????? {

??????????? ??? cout<<"請輸入密碼:";

??????????????????????? int code;

??????????????????????? cin>>code;

??????????????????????? if (code==1234)

??????????????????????? {

??????????????????????????????????? cout<<"????? 您成功進(jìn)入了系統(tǒng)!??? "<<endl;

??????????????????????????????????? cout<<"?????????????? ================================"<<endl;

??????????????????????? ??? cout<<"???????????????????? 歡迎使用作業(yè)管理系統(tǒng)!??? "<<endl;

??????????????????????? ??? cout<<"?????????????? ================================"<<endl;

??????????????????????????????????? i=1;

??????????????????????????????????? break;

??????????????????????? }

??????????????????????? else

??????????????????????????????????? cout<<"????? 您輸入的不正確,請重新輸入!"<<endl;

??????????? ???? ?????? i=0;

??????????? }

??????????? if (n==4)

??????????? cout<<"您已輸入三次,請下次再試!";

/************************************************************************/

/* 文件管理? 保存????????????????????????????????????????????????? */

/************************************************************************/

??????????????????????????????????? fout.open("c.txt",ios::app);

??????????????????????????????????? fout<<"學(xué)生的序號為:"<

??????????????????????????????????? fout<<"學(xué)生的名字為:"<

??????????? ? ? ? ? ? ? ? ? ? ? ? ??fout<<"學(xué)生的電話號碼為:"<

??????????? ? ? ? ? ? ? ? ? ? ? ? ??fout<<"學(xué)生的作業(yè)為:"<

??????????????????????????????????? fout<<endl;

??????????????????????????????????? fout.close();

/************************************************************************/

/* 文件管理? 打開???????????????????????????????????????????????? */

/************************************************************************/????? ????????????????????? ???????

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? fin.open("c.txt");

??????????????????????????????????? if(!fin)

??????????????????????????????????? {

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?cout<<"沒有找到您要的文件!"<<endl;

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?break;

??????????????????????????????????? }

??????????????????????????????????? while (fin.get(ch))

??????????????????????????????????? {

??????????????????????????????????????????????? cout<<ch;

??????????????????????????????????? }

??????????????????????????????????? cout<<endl;

??????????????????????????????????? fin.close();



本站聲明: 本文章由作者或相關(guān)機(jī)構(gòu)授權(quán)發(fā)布,目的在于傳遞更多信息,并不代表本站贊同其觀點(diǎn),本站亦不保證或承諾內(nèi)容真實(shí)性等。需要轉(zhuǎn)載請聯(lián)系該專欄作者,如若文章內(nèi)容侵犯您的權(quán)益,請及時(shí)聯(lián)系本站刪除( 郵箱:macysun@21ic.com )。
換一批
延伸閱讀
關(guān)閉