Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wowow #39

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions CCpp2017
Submodule CCpp2017 added at c30ee0
22 changes: 22 additions & 0 deletions CCppExamples-master/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Auto detect text files and perform LF normalization
* text=auto

# Custom for Visual Studio
*.cs diff=csharp
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union

# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
215 changes: 215 additions & 0 deletions CCppExamples-master/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
#################
## Eclipse
#################

*.pydevproject
.project
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# CDT-specific
.cproject

# PDT-specific
.buildpath


#################
## Visual Studio
#################

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.sln.docstates

# Build results

[Dd]ebug/
[Rr]elease/
x64/
build/
[Bb]in/
[Oo]bj/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.log
*.scc

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile

# Visual Studio profiler
*.psess
*.vsp
*.vspx

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
*.ncrunch*
.*crunch*.local.xml

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.Publish.xml
*.pubxml

# NuGet Packages Directory
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
#packages/

# Windows Azure Build Output
csx
*.build.csdef

# Windows Store app package directory
AppPackages/

# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.[Pp]ublish.xml
*.pfx
*.publishsettings

# RIA/Silverlight projects
Generated_Code/

# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# SQL Server files
App_Data/*.mdf
App_Data/*.ldf

#############
## Windows detritus
#############

# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Mac crap
.DS_Store


#############
## Python
#############

*.py[co]

# Packages
*.egg
*.egg-info
dist/
build/
eggs/
parts/
var/
sdist/
develop-eggs/
.installed.cfg

# Installer logs
pip-log.txt

# Unit test / coverage reports
.coverage
.tox

#Translations
*.mo

#Mr Developer
.mr.developer.cfg
32 changes: 32 additions & 0 deletions CCppExamples-master/ComputerSales_oo/include/Computer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#ifndef COMPUTER_H
#define COMPUTER_H

#include <string>
using std::string;

class Computer
{
public:
string getModel(){
return this->model;
}
int getTotal(){
return this->total;
}
void add(int num){
this->total+=num;
}
void sub(int num){
this->total-=num;
}
bool equal(Computer* other){
return this->model == other->model;
}
void input();

private:
string model;
int total;
};

#endif // COMPUTER_H
14 changes: 14 additions & 0 deletions CCppExamples-master/ComputerSales_oo/include/ComputerSales.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#ifndef COMPUTERSALES_H
#define COMPUTERSALES_H

#include "Menu.h"

class ComputerSales{
public:
ComputerSales();
int run();
private:
Menu menu;
};

#endif // COMPUTERSALES_H
17 changes: 17 additions & 0 deletions CCppExamples-master/ComputerSales_oo/include/EnterWareHouse.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#ifndef ENTERWAREHOUSE_H
#define ENTERWAREHOUSE_H

#include "MenuItem.h"

#include "WareHouse.h"

class EnterWareHouse:public MenuItem{
public:
EnterWareHouse():MenuItem("电脑入库"){}
virtual bool act(){
wareHouse.in();
return false;
}
};

#endif // ENTERWAREHOUSE_H
18 changes: 18 additions & 0 deletions CCppExamples-master/ComputerSales_oo/include/Exit.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#ifndef EXIT_H
#define EXIT_H

#include <iostream>
using namespace std;

#include "MenuItem.h"

class Exit:public MenuItem{
public:
Exit():MenuItem("退出程序"){}
bool act(){
cout << "退出程序!" << endl;
return true;
}
};

#endif // EXIT_H
17 changes: 17 additions & 0 deletions CCppExamples-master/ComputerSales_oo/include/ListWareHouse.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#ifndef LISTWAREHOUSE_H
#define LISTWAREHOUSE_H

#include "MenuItem.h"

#include "WareHouse.h"

class ListWareHouse:public MenuItem{
public:
ListWareHouse():MenuItem("查看库存"){}
bool act(){
wareHouse.list();
return false;
}
};

#endif // LISTWAREHOUSE_H
19 changes: 19 additions & 0 deletions CCppExamples-master/ComputerSales_oo/include/Menu.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#ifndef MENU_H
#define MENU_H

#include <vector>

#include "MenuItem.h"

class Menu{
public:
virtual ~Menu();
void append(MenuItem* mi);
int run();
private:
void show();

vector<MenuItem*> items;
};

#endif // MENU_H
19 changes: 19 additions & 0 deletions CCppExamples-master/ComputerSales_oo/include/MenuItem.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#ifndef MENUITEM_H
#define MENUITEM_H

#include <string>
using namespace std;

class MenuItem{
public:
MenuItem(string c):caption(c){}
virtual ~MenuItem(){}
string getCaption(){
return caption;
}
virtual bool act() = 0; //if return true ,then exit program
private:
string caption;
};

#endif // MENUITEM_H
Loading