2.2
This presentation is the property of its rightful owner.
Sponsored Links
1 / 24

2.2 数据的表示与处理 PowerPoint PPT Presentation


  • 117 Views
  • Uploaded on
  • Presentation posted in: General

2.2 数据的表示与处理. 程序设计中,往往要处理各种各样的数据,不同的程序设计语言有不同的数据类型。 在不同的程序设计语言中 , 数据表示与处理方法不尽相同 . 在 VB 中数据到底是如何表示的 ? 如何赋值、计算、输出数据呢?. 数据类型. 数据类型实际上是一种约定。不同的约定,计算机分配的存储空间也是不同的。 在 VB 中,为了便于数据的表示与处理, VB 提供了 数值型 、 字符串型 、 布尔型 、 日期型 等基本数据类型。. 一、数值型. 如果要存储数据的是整数而不是小数,则可声明它为 Integer 或 Long.

Download Presentation

2.2 数据的表示与处理

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


2 2

2.2


2 2

,.VB?


2 2

VBVB


2 2


2 2

IntegerLong

1IntergerLong

0

369-369+369

369.03977612345678


2 2

2. .

3.14159100 3.14159E0

0.3141591010.314159E1

0.03141591020.314159E231.415910131.4159E1

3141.591033141.59E3


2 2

3.6 106

7.210-3

5.25100


String

String

String

VBASCII


2 2

Visual Basic 123.456 everyone

2065535


Boolean

Boolean

Boolean,,//truefalseVB0-1

7>8

8*7+2>57?


2 2

Date

Date

100/1/1/~9999/12/31

VB#

#2005/09/10# 2005910

#09/10/2005#

#2005-09-10#

#September 102005#


2 2

:

21

A

235a_1

235679578

-2.785642E21

#1999/06/17#

:

2.057568E+2

1.797561897E-300

-1.5E-31


2 2

1

A"Visual"B"" C " " D//Basic//

2

Amm/dd/yyyyBmm-dd-yyyy

Cmm&dd&yyyyDAB

3VB A BC D

4VB DimA,B As StringAB A B C D

5x1234567193456X()ASingle BInteger CDouble DDate


2 2

S=Vt,StVSt

S=3.14*R^2


2 2

366 486756785 28.9127

ab463456*##pp88

trueflase

#2006/2/17#

Const As

Const PI=3.1415926


2 2

Dim r As Single

Dim c As Single

Dim s As Single

r = InputBox("r")

c = 2 *3.14 * r

s =3.14 * r * r

Print c

Print s

Const PI = 3.14

Dim r As Single

Dim c As Single

Dim s As Single

r = InputBox("r")

c = 2 * PI * r

s = PI * r * r

Print c

Print s

Inputbox()

3.14159265


2 2


2 2

1..

2.

3.255

4. VB

5. VB.

6.

strAbc iCount

dblx sYz


2 2

ElSE

_sysflay

Sum

_6

123.4

pice

number-of-moves

.5

HELLO


2 2

  • strAbc iCount

  • dblx sYz


2 2

VB

Dim <> AS <>

Dim N As Integer

:

Dim x as integer,y as integer

Dim a as date,b as date


2 2

:

1

AConst a As Single=1.1BConst a As Double=Sin(1)

CConst a="OK"DConst a As Integer=12

2

A255

B

C

D

3VB

AEnglishB11-EnglishC123.45DEnglish-1

4VB

AEnglishEngl_ishBEnglishENGLIsh

CEnglishEnglDEnglishEngland


2 2

5Dim max,min As Singlemax

ABCD

6.,( )A BC D

7.( )A xyz B 123abc C integer D X-Y

8.( )A ABC $ B ABC C ABC D ABC

9VBAABCabc Bb1234 C28wed Dcmd

10VBAx23 B8xy CEND DX8[B]


2 2

5

  • Dim I as integer,x as integer

  • X=1

  • For I=1 to 5

  • X=x*I

  • Next I

  • Print x


  • Login