.


:




:

































 

 

 

 


___ __________2015 .

 

-

___ __________2015 .

 

, 2015
1

 

 

- - C++.

:

- ;

- ( [1]);

- , .

, , , - , [2-4] - [3-8], .

 


2

 

 

(. . ), - .

- "- " (). "- ".

. (. ) Word- (*.rtf - ) (. [9]) .

. 14 , . , . , , .

:

- , (2- );

- - (8- );

- (9- );

- (10- );

- (12- );

- (14- ).

9-10 .

, , 30-40 . 2-3 , .

2-3 . :

- ;

- .

- - ;

- :

- ;

- ;

- ;

- ;

- .

 


3

 

3.1

 

- C++ [3-8, 11-12] C++ Windows .

, - .

, , [3, 4, 8].

 

3.2

 

( , .), .

( ) , , " ".

. : , , - . .

 

3.3

 

(, ..).

, .

:

) ();

) ;

.

.

) ;

) ;

) ;

) ;

) ;

) .

) -) .

 

3.4 ,

 

( ).

.

 

3.5

 

- : , ; UML; UML.

: , , .

, .

" " [1] :

) ;

) ;

) ;

) .

. " " " " /. .

 

 

3.6

 

, ​​ , .

. :

- , , ;

- ;

- ;

- ;

- ;

- .

.

.

.

.

- . .

/ .

.

 

3.7

 

3008-95 ". . " (. [9]).

( ) ).

 

3.8

 

:

) , UML:

1) ;

2) ;

) , UML:

1) ;

2) ;

3) ;

4) ;

) ;

) ;

) .

UML ) -) .

, :

- ( , );

- ( , ..).

3.1 " " (Cap_Rus.txt), .

 

3.1

  :   :
   
   
    /
   
    :
   
   
   
  ( )  
   
   
    :
  :  
   
   
     

 

3.1 " ". 3 :

 

3.1 - " "

 

 

) ( class1.h class2.h, class*.pp, main.cpp, , class*.h, market.vcproj , market.exe);

) :

1) Cap*.txt ;

2) menu*.txt ;

) (help.* , rukop.* ..).

" " . "" C ++:

) - ;

) ;

) ;

) ;

) C++.

:

- ;

- ( );

- ( , );

- ( ).

 

 

3.9

 

" " :

- -, , ..;

- , , , , ;

- ( , ..);

- (, ..).

. . [9].

 

3.10

 

, , , .

- 8, - 1.

[1]:

- " " (. . [9]);

- " " (. . [10]);

- " " (. . [9]).

:

- ( );

- ( );

- C++ .

C++ , .

.

"", "" "" " " (. ).

 


4

 

4.1

 

, :

) - MS Windows ( XP);

) () ++;

) .

 

4.2

 

. .

.

 

 


5

 

5.1

 

, . 5.1 Cap_Eng.txt Cap_Rus.txt. , n Cap_Eng.txt n Cap_Rus.txt.

 

5.1

Cap_Rus.txt Cap_eng.txt
1. 2. ... : . 3 DonNTU Chair AMI Press any key Created an object of the base class 1. The creation of an object of the base class 2. The display state of the object base class ERROR: you can not overload the unary operator. Select option 3

 

5.1 , .

:

) ;

) .

, 3.1 , Cap_*. txt, - menu_*. txt, - help.*.

:

) . :

1) exe- IDE ++;

2) () ;

3) ++ , :

char namef [20] = "help.txt";

char namef [20] = "uslovie.txt";

) , . :

1) exe- IDE ++;

2) (, );

3) C ++ , .

char namef [20] = "D:\STUDENTS\ PS\help.txt";

char namef [20] = "D:\STUDENTS\PS\ uslovie.txt";

) ) "".

) . , / ;

) "".

) , . / ;

) "".

C++ : . :

) :

1.

2.

3.

4.

5.

 

 

) lang . , 1 (True) , 0 (False) - . . :

int lang = 1;

) main_menu(), , " " ( 3):

cout << " : 1, 2, 3, 4, 5" << endl;

cin>> reply;

switch (reply)

{...

case 3: if (lang) lang = 0; else lang = 1; //

load_cap (); break;...

}

) :

const char nfile_r [12] = "Cap_Rus.txt";

const char nfile_e [12] = "Cap_Eng.txt";

 

) :

char nfile [12];

) :

const CCAPT = 35;

const LCAPT = 50;

char mas_cap [CCAPT][LCAPT];

35 -, 49 .

) load_cap(), - mas_cap:

 

void LoadCaption ()

{

if (lang)

strcpy (nfile, nfile_r);

else

strcpy (nfile, nfile_e);

 

ifstream fcapt;

fcapt.open (nfile);

 

 

if (fcapt.fail ())

{cerr << "" << nfile <<

" ." << Endl;

getch ();

exit (-1);

}

int i;

for (i = 0; i <CCAPT; i ++)

fcapt >> mas_cap [i];

}

) mas_cap ( ), :

 

void zastavka ()

{

clrscr ();

cout << endl;

cout.width (45); cout.setf (ios:: right);

cout << mas_cap [0] << endl;

cout.width (42); cout.setf (ios:: right);

cout << mas_cap [1] << endl;

cout.width (45); cout.setf (ios:: right);

cout << mas_cap [2] << endl;

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

...

}

void main_menu ()

{int reply;

cout.width (10);

cout << "1." << mas_cap [14];

cout.width (25);

cout << "2." << mas_cap [15];

cout.width (10);

cout << "3." << mas_cap [16];

cout.width (10);

cout << "4". << mas_cap [17] << endl;

 

}
6

 

 

.

 

1

Point, :

- X float X;

- Y float Y;

- void SetCoordinate(float X, float Y);

- X float GetX();

- Y float GetY();

- Point();

- Point(float X, float Y).

Point ColorPoint, :

- int Color;

- void SetColor (int Color);

- int GetColor ();

- ColorPoint ();

- ColorPoint (float X, float Y, int Color).

olorPoint ++ ( ), - ( 0..16).

 

2

Animal, :

- float Mass;

- char * Sex;

- char * Color;

- int Age;

- float GetMass();

- char * GetSex();

- int GetAge();

- char * GetColor();

- Animal(float Mass, char * Sex, char * Color, int Age).

Animal Dog, :

- char * Name;

- char * Race;

- (, , ..) char * Type;

 

- Dog(float Mass, char * Sex, char * Color, int Age, char * Name, char * Race, char * Type).

Animal -- ( ), - 0.1 ( 0,1 ).

 

3

Vegetable, :

- float Mass;

- int Ripeness;

- float GetMass();

- int GetRipeness();

- void Fertilize(); ( 0.1 )

- Vegetable(float Mass, int Ripeness).

Vegetable Tomato, :

- char * Type;

- char * Color;

- char * Size;

- Tomato(float Mass, int Ripeness, char * Type, char * Color, char * Size).

Tomato - (, ), - , .

 

4

Vehicle, :

- int Speed;

- int Mass;

- int GetMass();

- void Stop(); ( = 0);

- Vehicle(int Speed, int Mass).

Vehicle Truck, :

- int Capacity;

- int Cargo;

- Truck(int Speed, int Mass, int Capacity);

- int Load(int Mass); ( , 0, -1);

- int UnLoad(); ( 0).

Vehicle ++ ( ), - 10 / .

 

5

Veapon, :

- int Capacity;

- int Calibre;

- int Distance;

- void Charge();

- void UnCharge();

- Veapon(int Capacity, int Calibre, int Distance).

Veapon Gun, :

- int Number;

- char * BarrelType; (, )

- int State; ( )

- Gun (int Capacity, int Calibre, int Distance, int Number, char * BarrelType);

- void Shot ().

Gun ! ( ), - / .

 

6

Media, :

- long Size;

- int ReadSpeed;

- int WriteSpeed;

- char * Vendor;

- char * Data;

- char * Read();

- void Write(char * buffer);

- Media (long Size, int ReadSpeed, int WriteSpeed).

Media HDD, :

- char * Interface; (SATA, IDE, SCSI)

- int PartitionNum;

- HDD(long Size, int ReadSpeed, int WriteSpeed, char * Interface, int PartitionNum);

- void Format ();

- int Format(int PartitionNum); ( , , - 1, - 0).

Media ~ ( ), - .

 

7

File, :

- long Size;

- char * Date;

- char * Owner;

- char * Content;

- char * Read();

- void Write(char * buffer);

- File(long Size, char * Date, char * Owner).

File Document, :

- int FontSize;

- int FontColor;

- Document(long Size, char * Date, char * Owner, int FontSize, char * Color);

- void SetColor(char * Color).

Document + (, ), - .

 

8

Employee, :

- λ char * FIO;

- int Number;

- int Age;

- int Stage;

- char * GetFIO();

- . int GetNumber();

- int GetStage();

- int GetAge();

- Employee(char * FIO, int Number, int Stage, int Age).

Employee Turner (), :

- int Experience;

- int Department;

- Turner(char * FIO, int Number, int Stage, int Age, int Department, int Experience);

- void ChangeDepartment (int NewDepartment).

Turner ++ ( ), - .

 

9

LightDevice, :

- int Light;

- int Power;

- int Voltage;

- int GetLight();

- int GetPower();

- int GetVoltage();

- LightDevice(int Light, int Power, int Voltage).

LightDevice Lamp, :

- (/) int State;

- int Color;

- Lamp(int Light, int Power, int Voltage, int Color);

- void On();

- void Off().

Lamp ++ ( ), - .

 

10

Confection, :

- char * Name;

- struct Date {int year; int month; int day} ProductDate;

- struct Date {int year; int month; int day} BestBefore;

- Filling () Filling * filling;

- int GetProductDate();

- int GetName();

- void AddFilling(Filling filling);

- Confection (char * Name, Date ProductDate, Date BestBefore, Filling * filling).

Filling, :

- int Number;

- char * Name;

- Filling (int Number, char * Name);

- void AddIngredient ();

- void DelIngredient ().

Confection ~ ( ), - .

 

11

Ellipse, :

- Point * Center;

- float a;

- float b;

- Point GetCenter();

- float Get_a();

- float Get_b();

- , int isCircle();

- Ellipse(Point * Center, float a, float b).

Point, :

- X float X;

- Y float Y;

- void SetCoordinate(float X, float Y);

- X float GetX();

- Y float GetY();

- Point(float X, float Y).

Ellipse - (, ), - .

 

12

Function, :

- char * FunctionString;

- int NumOfPointDiscontinuity;

- int NumOfVariables;

- char * GetFunctionString();

- int GetNumOfPointDiscountinuity();

- int GetNumOfVariables();

- Function(char * FunctionString, int NumOfPointDiscontinuity, int NumOfVariables).

Sin, :

- float Period;

- float Amplitude;

- void SetAmplitude(float A);

- void SetPeriod(float T);

- float GetValue(float x);

- Sin().

Sin -- ( ), - 0.1.

 

13

Fly, :

- int Speed;

- int Height;

- int Distance;

- int NumOfPass;

- int GetSpeed​​();

- int GetDistance();

- int GetHeight();

- int GetNumOfPass();

- , int IsFlying(int Height);

- Fly(int Speed, int Distance, int NumOfPass, int Height).

Helicopter, :

- int NumOfScrew;

- int Capacity;

- int AddFuel(int Fuel); ( , - 1, - 0)

- Helicopter(int Speed, int Distance, int NumOfPass, int Height, int NumOfScrew, int Capacity).

Helicopter ~ ( ), - .

 

14

CelestialBody, :

- float Mass;

- float Radius;

- int GetMass();

- int GetRadius();

- float GetDensity();

- CelestialBody(float Mass, float Radius).

Planet, :

- float RotatePeriod;

- float RotationPeriod;

- float Distance;

- float GetRotatePeriod();

- float GetRotationPeriod();

- float GetDistance ();

- Planet (float Mass, float Radius, float RotatePeriod, float RotationPeriod, float Distance).

CelestialBody + (, ), - ( ).

 

15

MobilePhone, :

- char * Vendor;

- char * Model;

- SIM- SIM * card;

- ( + ) char * GetName();

- void Call();

- SMS void SendSMS();

- SIM void InsertSIM(SIM card);

- MobilePhone(char * Vendor, char * Model).

SIM, :

- char * Number;

- char * Operator;

- SIM(char * Operator, char * Number).

MobilePhone ~ (y, ), - SIM-.

 

16

Money, :

- char * Currency;

- long Sum;

- char * GetCurrency();

- long GetSum();

- Money(char * Currency, long Sum).

Account, :

- λ char * FIO;

- long ident;

- void AddMoney(long Sum);

- long SubMoney(long Sum); (-1 )

- Account(char * FIO, long Ident, Money m).

Account ! (, ), - .

 

17

Print, :

- char * Title;

- int Number;

- char * GetTitle();

- int GetNumberPage();

- Print(char * Title, int Number).

Print Book, :

- char * Author;

- char * Publicator;

- int Count;

- Book(char * Publicator, int Count, char *).

Book ++ (, ) - 10 .

 

18

Matrix, :

- Size s;

- int Data [s.Raw, s.Column];

- int GetRaw();

- int GetColumn();

- int GetValue(int i, int j);

- Matrix(Size s, int InitialValue).

Size, :

- ​​int Raw;

- int Column;

- Size(int Raw, int Column).

Matrix ++ (, ), - .

 

19

Wood, :

- char * Type;

- int Age;

- int humidity;

- int GetType();

- int GetAge();

- int GetHumidity();

- Wood (char * Type, int Age, int humidity).

Timber (), :

- int Length;

- float Square;

- void Truncate(int length);

- Timber(char * Type, int Age, int humidity, int Length, float Square).

Wood -- ( ), - 5%.

 

20

Mebel, :

- char * Vendor;

- char * Material;

- char * GetVendor();

- char * GetMaterial();

- Mebel(char * Vendor, char * Matrial).

Mebel Table, :

- int Num;

- int Height;

- int Width;

- int Length;

- float Perimeter();

- Table(char * Vendor, char * Material, int Num, int Height, int Width, int Length).

Table ++ ( ), - .


 

 

1. . - .: , 1982. - 128 c.

2. . UML. . .: , 2002. 144.

3. . ++. - .: , , 2004. - 1104.

4. . ++. . . - .: , 2005. - 1102.

5. .. C/C++. . - .: , 2006. - 461.

6. .. ++. . - .: , 2008. 560.

7. . ++: . - .: , 2006. - 528.

8. .., .. C++. - .: . , 2003. - 1152 .

9. " ( " ") / ... . - , , 2001. - 56.

10. ( 6.050103 - ). . 1./ i: .. , I.. . - , , 2010. - 128 .


 

____________________ (, , ) _____

 

1 ________________________________________________

_____________________________________________________________

2 __________ "__.__.____"

() ()

3. : __________________________________

_____________________________________________________________

4. : ___________________________

_____________________________________________________________

_____________________________________________________________

5 : _____________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

6. ________. 02. 20___

  . .    
  . . ) ; ) . 1-2:      
  - : ) - ; ) ; ) ; ) . 3-8:   3-4 4-5 5-6   6-8    
  : ) : , ; ) ; ) .    
  : ) ; ) : 1) ; 2) ; 3) . 5-10: 5-6     6-7 7-9 9-10  
  9-12  
  11-12  
     
     
     

 

________________ () __________ ()

"___" 20___ .

()

 


" "

 

 

" "

 

..

___________

__. 03.20__ ..

 

 

"- "

: "-

" " "

 

: :

 

_______ . () . -__

 

_________________ __________________

__. 03.20__ . __. 03.20__ .

 

20__

 

- (). , , , , . . , , .NET - . .

. - . - .

. - , - ++.

, ϔ.

market.exe - . , - ++.

 

1

 

- , .

 

2

 

market.exe - .

, :

) Market SelfM - :

1) ;

2) - Getxx (Get-);

3) - Setxx (Set-);

4) ;

5) - Actionxx;

) Market -=;

) SelfM !;

) Market SelfM ;

) :

1) ( );

2) ( );

3) .

MS Windows XP.

 

3

 

3.1

 

:

) ;

) ( );

) ;

) .

:

) : , ;

) : ;

:

) : , ;

) :

1) , ;

2) , .

) :

1) , ;

2) , ;

3) , .

:

) : , , ;

) :

1) , , ;

2) - / ( );

) :

1) , , ;

2) - / ( );

3) .

:

) : , ;

) :

1) , ;

2) ;

3) , .

) :

1) , ;

2) ;

3) , .

4) .

:

) : ;

) :

1) ;

2) .

:

) : ;

) - :

1) ( );

2) ( );

3) .

:

) :

1) ( );

) :

1) ( , / );

) :

1) ( / );

2) .

:

) :

1) ( );

2) ;

3) ;

) :

1) ( );

2) ;

3) ;

 

3.2

 

:

) ;

) , ;

) ;

) , .

 

3.3

 

̔.

, .

 

3.4

 

(, , ).

 

3.5

 

++ MS Windows XP.

 

4

 

:

) ;

) ;

) .

 

5

 

.5.1

5.1 -

  . .    
  . . ) ; ) . 1-2:    


<== | ==>
| ,
:


: 2015-09-20; !; : 837 |


:

:

, , .
==> ...

1705 - | 1606 -


© 2015-2024 lektsii.org - -

: 0.654 .