1223C实验报告 本文关键词:实验,报告
1223C实验报告 本文简介:usingSystem;usingSystem.Text;namespaceConsoleApplication14{classcas{privatestringnum;privatestringname;privatestringalx;privatestringmoney;privatestri
1223C实验报告 本文内容:
using
System;
using
System.Text;
namespace
ConsoleApplication14
{
class
cas
{
private
string
num;
private
string
name;
private
string
alx;
private
string
money;
private
string
min;
private
string
sec;
public
string
Name
{
get
{
return
name;
}
set
{
name
=
value;
}
}
public
string
Num
{
get
{
return
num;
}
set
{
num
=
value;
}
}
public
string
Alx
{
get
{
return
alx;
}
set
{
alx
=
value;
}
}
public
string
Money
{
get
{
return
money;
}
set
{
money
=
value;
}
}
public
void
outmoney()
{
double
i;
double
sum;
int
min1,sec1;
DateTime
dt
=
new
DateTime();
dt
=
DateTime.Now;
min1
=
dt.Minute
-
Convert.ToInt32(min);
sec1
=
dt.Second
-
Convert.ToInt32(sec);
for
(int
n
=
0;
n
1))
{
Console.Write(“输入无效,输入您的选择“);
s=Console.ReadLine();
}
if((s[0]>=
1
)
k++;
if
(k
==
29)
Console.WriteLine(“超出预算的账户数目“);
break;
case
2
:
string
number;
Console.WriteLine(“输入要查询的账户账号“);
number
=
Console.ReadLine();
bool
key2
=
false;
for
(int
p
=
0;
p
<
30;
p++)
{
if
((person[p].Num
!=
number)
key=false;
}
else
if
(key2
==
false)
{
person[p].inmoney();
key
=
false;
key2
=
true;
}
}
break;
case
3
:
string
number1;
Console.WriteLine(“输入要查询的账户账号“);
number1
=
Console.ReadLine();
bool
key3
=
false;
for
(int
p
=
0;
p
<
30;
p++)
{
if
((person[p].Num
!=
number1)
key
=
false;
}
else
if
(key3
==
false)
{
person[p].outmoney();
key
=
false;
key3
=
true;
}
}
break;
case
4
:
string
number3;
Console.WriteLine(“输入要查询的账户账号“);
number3
=
Console.ReadLine();
bool
key1
=
false;
for
(int
p
=
0;
p
<
30;
p++)
{
if
((person[p].Num
!=
number3)
key
=
false;
}
else
if
(key1
==
false)
{
person[p].showmoney();
key
=
false;
key1
=
true;
}
}
break;
case
5
:
break;
}
}
else
Console.WriteLine(“没有此项选择,请重新选择“);
}while(s[0]!=
5
);
}
}
}