版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
/XX大學(xué)遠(yuǎn)程教育學(xué)院《數(shù)據(jù)庫(kù)應(yīng)用程序設(shè)計(jì)》課程作業(yè)姓名:學(xué)號(hào):年級(jí):學(xué)習(xí)中心:—————————————————————————————作業(yè)第一章1.5如何保存Delphi的項(xiàng)目?嘗試自己動(dòng)手創(chuàng)建一個(gè)項(xiàng)目,并保存。答:執(zhí)行File|Save
All菜單命令或單擊工具欄中的Save
All按鈕便可保存,在保存時(shí)可以對(duì)工程文件和單元文件進(jìn)行改名,但后綴名不能改。保存文件之后,單擊工具中的Run按鈕或按F9鍵,系統(tǒng)將開(kāi)始編譯、連接、運(yùn)行該工程。1.7嘗試設(shè)計(jì)如圖1-10所示的窗體?!矆D見(jiàn)教材P15頁(yè)圖1-10圖1-10第二章2.8設(shè)計(jì)如圖2-5所示的界面。單擊"按鈕1”或"按鈕2”時(shí)在標(biāo)簽上顯示用戶(hù)所執(zhí)行的操作。單擊"開(kāi)啟/停用按鈕"可控制"按鈕1”和"按鈕2”是否可用,單擊"退出系統(tǒng)"按鈕時(shí),結(jié)束程序的運(yùn)行。2.9設(shè)計(jì)如圖2-6所示的界面。當(dāng)單擊按鈕時(shí),可控制文本框中字體的顏色。圖2-5 圖2-6
unit
test;
interface
uses
Windows,
Messages,
SysUtils,
Variants,
Classes,
Graphics,
Controls,
Forms,
Dialogs,
StdCtrls;
type
TForm1
=
class<TForm>
showLabel:
TLabel;
btn1:
TButton;
//按鈕1
btn2:
TButton;
//按鈕2
ctlBtn:
TButton;
//開(kāi)啟停用按鈕exitBtn:
TButton;
//退出按鈕procedure
btn1Click<Sender:
TObject>;
procedure
btn2Click<Sender:
TObject>;
procedure
exitBtnClick<Sender:
TObject>;
procedure
ctlBtnClick<Sender:
TObject>;
private
{
Private
declarations
}
public
{
Public
declarations
}
end;
var
Form1:
TForm1;
ctlStatus:integer
=
0;
//控制按鈕1和2的開(kāi)啟和關(guān)閉,0表示當(dāng)前為開(kāi)啟,1表示關(guān)閉implementation
{$R
*.dfm}
procedure
TForm1.btn1Click<Sender:
TObject>;begin
form1.showLabel.Caption
:=
'您點(diǎn)擊了按鈕1';
end;
procedure
TForm1.btn2Click<Sender:
TObject>;
begin
form1.showLabel.Caption
:=
'您點(diǎn)擊了按鈕2';
end;
procedure
TForm1.exitBtnClick<Sender:
TObject>;
begin
form1.Close;
end;
procedure
TForm1.ctlBtnClick<Sender:
TObject>;
begin
if
ctlStatus
=
0
then
begin
form1.btn1.Enabled
:=
false;
form1.btn2.Enabled
:=
false;
ctlStatus
:=
1;
end
else
begin
form1.btn1.Enabled
:=
true;
form1.btn2.Enabled
:=
true;
ctlStatus
:=
0;
end;
end;
end.
2.9:unit
test;
interface
uses
Windows,
Messages,
SysUtils,
Variants,
Classes,
Graphics,
Controls,
Forms,
Dialogs,
StdCtrls;
type
TForm1
=
class<TForm>
Label1:
TLabel;
Edit1:
TEdit;
btnRed:
TButton;
btnGreen:
TButton;
btnBlue:
TButton;
procedure
btnRedClick<Sender:
TObject>;
procedure
btnGreenClick<Sender:
TObject>;
procedure
btnBlueClick<Sender:
TObject>;
private
{
Private
declarations
}
public
{
Public
declarations
}
end;
var
Form1:
TForm1;
implementation
{$R
*.dfm}
procedure
TForm1.btnRedClick<Sender:
TObject>;
begin
form1.Edit1.Font.Color
:=
clred;end;
procedure
TForm1.btnGreenClick<Sender:
TObject>;
begin
form1.Edit1.Font.Color
:=
clgreen;
end;
procedure
TForm1.btnBlueClick<Sender:
TObject>;
begin
form1.Edit1.Font.Color
:=
clblue;
end;
end.第三章3.8下列實(shí)數(shù)中哪些是合法的,哪些是不合法的?不合法的請(qǐng)說(shuō)明理由?!睞0.25E+02 〔B.25+2 〔C25E+2〔D34.5 〔E.123 〔F-3E-4〔A合法,即為25
〔B不合法,小數(shù)點(diǎn)前必須有數(shù)字,如表示為0.25+2
〔C合法,即為2500
〔D合法,即為34.5
〔E不合法,同〔2
〔F合法,即為‐0.0003
3.12數(shù)學(xué)式子sin30。寫(xiě)成Delphi表達(dá)式是下列哪個(gè)?〔ASin30 〔BSin<30> 〔CSIN〔30?!睤Sin<30*Pi/180>D,需要把角度轉(zhuǎn)化為弧度第四章4.7利用3個(gè)數(shù)字編輯框分別輸入小時(shí)、分、秒,換算共有多少秒,然后使用標(biāo)簽輸出。unit
test;
interface
uses
Windows,
Messages,
SysUtils,
Variants,
Classes,
Graphics,
Controls,
Forms,
Dialogs,
StdCtrls,
Spin;
type
TForm1
=
class<TForm>
SpinEdit1:
TSpinEdit;
Label1:
TLabel;
Label2:
TLabel;
SpinEdit2:
TSpinEdit;
Label3:
TLabel;
SpinEdit3:
TSpinEdit;
Label4:
TLabel;
procedure
SpinEdit1Change<Sender:
TObject>;
procedure
SpinEdit2Change<Sender:
TObject>;
procedure
SpinEdit3Change<Sender:
TObject>;
private
{
Private
declarations
}
procedure
CalculateTimeToSencond<timeKind:String;
time:integer>;
public
{
Public
declarations
}
end;
var
Form1:
TForm1;
hour:
integer
=
0;
minute:
integer
=
0;
second:
integer
=
0;
tot:integer
=
0;
implementation
{$R
*.dfm}
procedure
TForm1.CalculateTimeToSencond<timeKind:String;
time:integer>;
begin
if
timeKind
=
'hh'
then
hour
:=
time
else
if
timeKind
=
'mi'
then
minute
:=
time
else
if
timeKind
=
'ss'
then
second
:=
time;
tot
:=
hour
*
60
*
60
+
minute
*
60
+
second;
form1.Label4.Caption
:=
'總共為'
+
IntToStr<tot>
+
'秒';
end;
procedure
TForm1.SpinEdit1Change<Sender:
TObject>;
begin
Form1.CalculateTimeToSencond<'hh',
StrToInt<Form1.SpinEdit1.Text>>;
end;
procedure
TForm1.SpinEdit2Change<Sender:
TObject>;
begin
Form1.CalculateTimeToSencond<'mi',
StrToInt<Form1.SpinEdit2.Text>>;
end;
procedure
TForm1.SpinEdit3Change<Sender:
TObject>;
begin
Form1.CalculateTimeToSencond<'ss',
StrToInt<Form1.SpinEdit3.Text>>;
end;
end.
4.8在編輯框中輸入一個(gè)實(shí)數(shù),利用備注框輸出該實(shí)數(shù)及其平方和平方根。unit
Unit1;
interface
uses
Windows,
Messages,
SysUtils,
Variants,
Classes,
Graphics,
Controls,
Forms,
Dialogs,
StdCtrls;
type
TForm1
=
class<TForm>
Edit1:
TEdit;
Label1:
TLabel;
Memo1:
TMemo;
Label2:
TLabel;
procedure
Edit1Change<Sender:
TObject>;
private
{
Private
declarations
}
public
{
Public
declarations
}
end;
var
Form1:
TForm1;
num1
:
Real;
//原實(shí)數(shù)
num2
:
Real;
//實(shí)數(shù)平方num3
:
Real;
//實(shí)數(shù)平方根
implementation
{$R
*.dfm}
procedure
TForm1.Edit1Change<Sender:
TObject>;
begin
if
form1.Edit1.Text
<>
''
then
begin
num1
:=
StrToFloat<form1.Edit1.Text>;
num2
:=
Sqr<num1>;
num3
:=
Sqrt<num1>;
form1.Memo1.Lines.Clear;
form1.Memo1.Lines.Add<'實(shí)數(shù)為
:
'
+
FloatToStr<num1>>;
form1.Memo1.Lines.Add<'平方為
:
'
+
FloatToStr<num2>>;
form1.Memo1.Lines.Add<'平方根為
:
'
+
FloatToStr<num3>>;
end;
end;
end.第五章5.11任意給定3個(gè)實(shí)數(shù),按照從大到小的順序依次輸出這3個(gè)數(shù)。unit
Unit1;
interface
uses
Windows,
Messages,
SysUtils,
Variants,
Classes,
Graphics,
Controls,
Forms,
Dialogs,
StdCtrls;
type
TForm1
=
class<TForm>
num1Edit:
TEdit;
Label1:
TLabel;
Label2:
TLabel;
resultLabel:
TLabel;
num2Edit:
TEdit;
num3Edit:
TEdit;
procedure
num1EditChange<Sender:
TObject>;
procedure
num2EditChange<Sender:
TObject>;
procedure
num3EditChange<Sender:
TObject>;
private
{
Private
declarations
}
procedure
CompareNumber<>;
public
{
Public
declarations
}
end;
var
Form1:
TForm1;
num1
:
Real;
//數(shù)字1
num2
:
Real;
//數(shù)字2
num3
:
Real;
//數(shù)字3
compnum
:
Real;
//比較時(shí)轉(zhuǎn)換2數(shù)outStr
:
String;
//輸出結(jié)果;
implementation
{$R
*.dfm}
procedure
TForm1.CompareNumber<>;
begin
if
<trim<form1.num1Edit.Text>
<>
''>
And
<trim<form1.num2Edit.Text>
<>
''>
And
<trim<form1.num3Edit.Text>
<>
''>
then
begin
num1
:=
StrToFloat<form1.num1Edit.Text>;
num2
:=
StrToFloat<form1.num2Edit.Text>;
num3
:=
StrToFloat<form1.num3Edit.Text>;
if
num2
>
num1
then
begin
compnum
:=
num1;
num1
:=
num2;
num2
:=
compnum;
end;
if
num3
>
num1
then
begin
compnum
:=
num1;
num1
:=
num3;
num3
:=
compnum;
end;
if
num3
>
num2
then
begin
compnum
:=
num2;
num2
:=
num3;
num3
:=
compnum;
end;
outStr
:=
FloatToStr<num1>
+
','
+
FloatToStr<num2>
+
','
+
FloatToStr<num3>;
form1.resultLabel.Caption
:=
outStr;
end;
end;
procedure
TForm1.num1EditChange<Sender:
TObject>;
begin
form1.CompareNumber;
end;
procedure
TForm1.num2EditChange<Sender:
TObject>;
begin
form1.CompareNumber;
end;
procedure
TForm1.num3EditChange<Sender:
TObject>;
begin
form1.CompareNumber;
end;
end.
5.13假設(shè)工資的增幅標(biāo)準(zhǔn)為:若基本工資大于等于1000元,增加工資20%;若小于1000元大于等于800元,則增加工資15%;若小于800元,則增加工資10%。請(qǐng)根據(jù)用戶(hù)在文本框中輸入的基本工資,計(jì)算出增加后的工資。unit
Unit1;
interface
uses
Windows,
Messages,
SysUtils,
Variants,
Classes,
Graphics,
Controls,
Forms,
Dialogs,
StdCtrls;
type
TForm1
=
class<TForm>
Label1:
TLabel;
Edit1:
TEdit;
Label2:
TLabel;
resultLabel:
TLabel;
procedure
Edit1Change<Sender:
TObject>;
private
{
Private
declarations
}
public
{
Public
declarations
}
end;
var
Form1:
TForm1;
salary:
Real;
outSalary:
Real;
implementation
{$R
*.dfm}
procedure
TForm1.Edit1Change<Sender:
TObject>;
begin
salary
:=
StrToFloat<form1.Edit1.Text>;
if
<salary
>=
1000>
then
outSalary
:=
salary
*
<1
+
0.2>
else
if
<salary
<
1000>
And
<salary
>=
800>
then
outSalary
:=
salary
*
<1
+
0.15>
else
if
<salary
<
800>
then
outSalary
:=
salary
*
<1
+
0.1>;
form1.resultLabel.Caption
:=
FloatToStr<outSalary>;
end;
end.
第六章6.5設(shè)s=1X2X3X…Xn,求s不大于20000時(shí)最大的n。unit
Unit1;
interface
uses
Windows,
Messages,
SysUtils,
Variants,
Classes,
Graphics,
Controls,
Forms,
Dialogs,
StdCtrls;
type
TForm1
=
class<TForm>
Label1:
TLabel;
Edit1:
TEdit;
Label2:
TLabel;
resultLabel:
TLabel;
procedure
FormCreate<Sender:
TObject>;
private
{
Private
declarations
}
public
{
Public
declarations
}
end;
var
Form1:
TForm1;
number,
n,
tot:
Integer;
implementation
{$R
*.dfm}
procedure
TForm1.FormCreate<Sender:
TObject>;
begin
tot
:=
1;
n
:=
0;
number
:=
StrToInt<form1.Edit1.Text>;
While
tot
<=
number
do
begin
n
:=
n
+
1;
tot
:=
tot
*
n;
end;
form1.resultLabel.Caption
:=
IntToStr<n‐1>;
end;
end.
6.10在標(biāo)簽上輸出100~200之間的所有的奇數(shù),其中3的倍數(shù)除外。unit
Unit1;
interface
uses
Windows,
Messages,
SysUtils,
Variants,
Classes,
Graphics,
Controls,
Forms,
Dialogs,
StdCtrls;
type
TForm1
=
class<TForm>
resultLabel:
TLabel;
procedure
FormCreate<Sender:
TObject>;
private
{
Private
declarations
}
public
{
Public
declarations
}
end;
var
Form1:
TForm1;
number,
i:
Integer;
outStr:
String;
implementation
{$R
*.dfm}
procedure
TForm1.FormCreate<Sender:
TObject>;
begin
for
i:=
100
to
200
do
begin
if
i
mod
2
<>
0
then
if
i
mod
3
<>
0
then
outStr
:=
outStr
+
'
'
+
IntToStr<i>;
form1.resultLabel.Caption
:=
outStr;
end;
end;
end.第七章7.4求1~200這200個(gè)數(shù)的和,當(dāng)和大于10000時(shí)結(jié)束計(jì)算?!惨笫褂棉D(zhuǎn)向語(yǔ)句unit
Unit1;
interface
uses
Windows,
Messages,
SysUtils,
Variants,
Classes,
Graphics,
Controls,
Forms,
Dialogs,
StdCtrls;
type
TForm1
=
class<TForm>
Label1:
TLabel;
procedure
FormCreate<Sender:
TObject>;
private
{
Private
declarations
}
public
{
Public
declarations
}
end;
var
Form1:
TForm1;
sum,
n
:
integer;
implementation
{$R
*.dfm}
procedure
TForm1.FormCreate<Sender:
TObject>;
begin
sum
:=
0;
n
:=
0;
repeat
n
:=
n
+
1;
sum
:=
sum
+
n;
if
<sum
>
10000>
then
break;
until
n
>=
200;
form1.Label1.Caption
:=
'總和為'
+
IntToStr<sum>;end;
end.
第八章8.8編寫(xiě)函數(shù),輸出100~500之間所有能同時(shí)被3和13整除的數(shù)。unit
Unit1;
interface
uses
Windows,
Messages,
SysUtils,
Variants,
Classes,
Graphics,
Controls,
Forms,
Dialogs,
StdCtrls;
type
TForm1
=
class<TForm>
Label1:
TLabel;
procedure
FormCreate<Sender:
TObject>;
private
{
Private
declarations
}
Function
checkNum<num:integer>:boolean;
public
{
Public
declarations
}
end;
var
Form1:
TForm1;
implementation
{$R
*.dfm}
Function
TForm1.checkNum<num:integer>:boolean;
var
n
:boolean;
begin
if
<num
mod
3
=
0>
And
<num
mod
13
=
0>
then
n
:=
true
else
n
:=
false;
result
:=
n;
end;
procedure
TForm1.FormCreate<Sender:
TObject>;
var
i
:
integer;
var
out
:
string;
begin
for
i
:=
100
to
500
do
begin
if
checkNum<i>
then
out
:=
out
+
'
'
+
IntToStr<i>;
end;
form1.Label1.Caption
:=
out;
end;
end.
第九章9.2打開(kāi)對(duì)話(huà)框組件和打開(kāi)圖片對(duì)話(huà)
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 發(fā)動(dòng)機(jī)噴油系統(tǒng)的穩(wěn)態(tài)與動(dòng)態(tài)特性考核試卷
- 發(fā)射設(shè)備在抗電磁干擾技術(shù)的研究考核試卷
- 保險(xiǎn)客戶(hù)風(fēng)險(xiǎn)偏好與產(chǎn)品匹配考核試卷
- 美術(shù)課程設(shè)計(jì)手繪
- 2025年全球及中國(guó)智能汽車(chē)ADCU控制器行業(yè)頭部企業(yè)市場(chǎng)占有率及排名調(diào)研報(bào)告
- 英文口語(yǔ)直播課程設(shè)計(jì)
- 窯洞課程設(shè)計(jì)
- 鏜刀課程設(shè)計(jì)
- 鸚鵡主題課程設(shè)計(jì)表
- 預(yù)算課程設(shè)計(jì)內(nèi)容
- 青島版(五年制)四年級(jí)下冊(cè)小學(xué)數(shù)學(xué)全冊(cè)導(dǎo)學(xué)案(學(xué)前預(yù)習(xí)單)
- 退學(xué)費(fèi)和解協(xié)議書(shū)模板
- 2024至2030年中國(guó)對(duì)氯甲苯行業(yè)市場(chǎng)全景調(diào)研及發(fā)展趨勢(shì)分析報(bào)告
- 智能教育輔助系統(tǒng)運(yùn)營(yíng)服務(wù)合同
- 心功能分級(jí)及護(hù)理
- DLT 572-2021 電力變壓器運(yùn)行規(guī)程
- 重慶育才中學(xué)2025屆化學(xué)九上期末教學(xué)質(zhì)量檢測(cè)試題含解析
- 成都市2022級(jí)(2025屆)高中畢業(yè)班摸底測(cè)試(零診)數(shù)學(xué)試卷(含答案)
- 【云南省中藥材出口現(xiàn)狀、問(wèn)題及對(duì)策11000字(論文)】
- 服裝板房管理制度
- 河北省興隆縣盛嘉恒信礦業(yè)有限公司李杖子硅石礦礦山地質(zhì)環(huán)境保護(hù)與治理恢復(fù)方案
評(píng)論
0/150
提交評(píng)論