Академический Документы
Профессиональный Документы
Культура Документы
.
Microsoft Visual C++ 2005
(). .
++
( :
(1) Gilberg R.F., Forouzan B. Data Structures: A Pseudocode Approach with C, 2nd ed., Course Technology
(Thomson Learning), 2005
(2) Forouzan B., Mosharraf F. Foundations of Computer Science, 2nd ed., Thomson Learning, 2008
(3) .. . /C++. . -, 2006
(4) .., .. : , 5- ., .--, 2008
(5) .. - ++, 2- ., .
, 2001
(6) ., . Visual C++ , -, 2008
(7) . ++. , . ., 5- ., , 2007
(8) .., . , . ., , 2001
(9) Heathfield R., Kirby L., et al. C Unleashed, SAMS Publ., 2000)
,
,
,
.
, , ;
.
,
.
,
. ,
,
. - ?
, ,
, ,
. , , UML (.
, Pseudocode, ., CS 341).
, , ,
(),
(, -
UML,
-). , UML
(. ). ()
.
(computer and programming researchers and scientists) 3
(. . 3 )
1
(), .. ,
, :
- (sequence) / 1 /
- (decision) / 2 /
- (repetition) / 3 /.
, ,
(). ()
UML :
/ 1 /
/ 2 /
/ 3 /
,
(, , ). , ,
, (
).
, ()
, Pascal C (, -
/ / ).
, ,
, , :
(1)
, ,
(
).
(2) , /
,
, ,
: ;
, ,
.
: ()
,
. ,
; ()
,
2
(-) (-) , :
() .
, null
.
(, , )
:
:
,
:
- ,
:
(true), ; (false),
(3) (statements)
, (assign), (input),
(output), (add), (loop). (nested
statements), .. , ,
(
/). , ..
/, { }.
(--),
1,
(). , /C++
for, while do-while .
1
{
termPro
resTemp
resTemp tempPro totalExam
2
{
termPro <-
resTemp <-
totalExam <- termPro + resTemp
( 1 2)
(.
);
(stepwise refinement) (.
Program Development by Stepwise Development, Comm. ACM, 14, 4, (Apr 1971), pp. 221-227).
. , ,
: ( . )
ITiSCE (2002 .).
- 21 , .
, (assign)
(add) ; ,
,
. ,
.
, ,
() .
,
; ()
.
, :
(1) (.. a, x, y, z ..),
(2) () ,
sum, denom, total ..
(sumOfNumbers, gradesTotal ..)
() ;
,
sum total,
(3) - ,
sum of numbers sumNum, total of
grades gradTotal.
,
, ..
++ (), ;
,
_ (underscore symbol).
(, int, for, double, break ).
, , ,
31.
. , i, j k (, l
() ,
1 (); )
, s t ,
, ,
. .
, , , arrsize, arrSize arr_size,
, . ,
, ,
. (),
, .
(namespaces) ++
.
,
:
, ,
{ },
4
, ,
, ,
,
, ,
-
, , ( )
,
,
- ,
,
, .
, ,
. ,
, , .
. , ,
, : (1) , (2)
, (3) . ,
(, )
typeName arrayName[arraySize];
(arraySize)
(, 10*sizeof(double)),
.
,
; , . C++ , ..
0 ().
[A] , ,
:
# = sizeof(typeName)* arraySize
[B] () ,
, ( ) :
# = sizeof(arrayName)/ sizeof(typeName)
/C++
. (-)
,
. ,
(), ,
, ,
, .
, ..
. ++ ,
, , ,
( ):
int test[5] = {16,4,-7,251,93};
// Ok
5
int test1[5];
double test2[6] = {5.2,4,3.8};
int test3[ ] = {2,-116,9};
test1 = test;
//
//
//
//
//
//
//
Ok ( )
Ok (3
)
Ok (
)
( !)
++
, ..
, . ,
int arr[3][10];
3 10, .. , 3 10
.
arr[0], arr[1] arr[2],
, 10 . , arr[0] ,
0 () 9, .. arr[0][0], arr[0][1],,
arr[0][9].
++ (STL) Vector. ,
.
( . )
(#1)
1.
0 24 ().
.
//
//
//
//
//
//
//
//
//
----------------------------------------------------------------------
: < , , ( XXX)
: Microsoft Visual C++ 2005
: 01.11.2008
: ( ,
, )
------------------------------------------------------------------------
#include <iostream>
using namespace std;
const int arrSize = 25;
//
int main( )
{
double factorials[arrSize];
int i;
// ()
, factorials[ ]
double, .. .
int (,
), unsigned int (
). ( double int
double unsigned int factorials)? (!)
, double
.
( )
17! int 14!
unsigned int.
// ----------------------------------------------------------------------//
// (
//
//
//
//
func( ) .1)
: Microsoft Visual C++ 2005
: 05.11.2008
------------------------------------------------------------------------
#include <iostream>
using namespace std;
void func (double [ ]);
// () func( )
(. ,
. 4-5 ),
, ,
,
,
,
.
,
<< >>, .. ,
(. stream).
() (endl fixed)
(setprecision),
<iomanip>.
#include <iostream>
#include <iomanip>
using namespace std;
const int arrSize = 25;
//
int main( )
{
... ... ... ... ...
for(i = 0; i < arrSize; i++)
cout << i << "!= " << fixed << setprecision(0) << factorials[i] << endl;
... ... ... ... ...
(. 1(2))
( . 7)
2. (- )
,
( 10- )
.
:
min max
10 (10 )
-> 13 5 37 -20 10 8 54 17 5 27
[min] : -20
[max] : 54
( min max) 15.25
3. (- )
, N1Op1N 2Op 2 ...Op n N n , N i
( i 1, n ) , Opi ( i 1, n )
(+) (-).
:
(, 7-3+5+4-2) <Enter>
-> 8-1+3-2+5
13
-
(, 7-3+5+4-2) <Enter>
-> 6+2*4-1+9
[x] : * .
(, 7-3+5+4-2) <Enter>
-> 6+2-4-1+9
12
9
-
(, 7-3+5+4-2) <Enter>
-> 6-2+12+4-3
[x] : .
4. (- )
, , , ()
- () , ()
- .
- ( char [ ]).
:
:
- 1 -->
- 2 -->
-> 1
: 357
(): 001101010111
PS.
:
- .., .. ++
(http://www.proklondike.com/contentview.php?content=462 )
- ., . ++ (. .)
( http://www.proklondike.com/contentview.php?content=31 )
- . ++ / 7.3 (
++), Price
- ++. ( IT, 2007)
- ++ (,
++).
( )
10