- 博客(49)
- 收藏
- 关注
原创 MyBatis实现增删改查
实体类:package com.company.project.entity;public class User { private String userId;//用户ID private String userName;//用户名 private String userPassword;//用户密码 private String userInfo;//用户信息 priv
2017-08-04 16:25:09 353
原创 关于JAVA开发的命名规范小结
每次写代码之前总是会想一个这样的问题,我的代码是不是规范的,是不是大家都是这样的,所以也会畏手畏脚。所以还是总结了一套比较规范的命名方式,希望能够保持一个良好的编程风格。1.关于数据库数据库命名方式:全部小写,用下划线分隔开来,以项目名开头,后面还可以加上一些其他的东西。比如我的TestMaven项目:test_maven数据表命名方式:全部小写,数据库名开头,后面带表名,下划
2017-08-04 10:14:10 307
原创 使用maven创建web项目,并且整合SSM框架
实习也快一个月了,本以为做的是C++方面,机缘巧合,还是回到了JAVA,并且接触到了SSM,自我感觉还是挺好用的,但为了预防遗忘,还是打算写一篇完整的教程。废话不多说,接下来我们就开始吧。首先说说环境的搭建:1.JDK的安装,根据自己的系统选择64或者32位,安装后配置好环境变量,并且通过cmd命令测试一下是否成功。
2017-08-03 20:02:44 3246
原创 第七章第六题
#include #include using namespace std;struct student{int num; char name[20]; double score;};int main(){student stud[3]={1001,"Li",78,1002,"Wang",89.5,1004,"Fun",90},stud1[3]; c
2015-06-02 19:55:00 297
原创 第七章第五题
#include #include using namespace std;struct staff{int num; char name[20]; int age; double pay;};int main(){staff staf[7]={3898,"Fan",34,1200,3899,"Wang",23,6740,2448,"Chen",54,77
2015-06-02 19:53:36 256
原创 第七章第四题
#include #include using namespace std; //fun1函数从键盘输入20个整数,分别存放在两个磁盘文件中void fun1(){int a[10]; ofstream outfile1("f1.dat"),outfile2("f2.dat"); //分别定义两个文件流对象 if(!outfile1)
2015-06-02 19:43:22 330
原创 第七章第三题
#include #include using namespace std;int main(){ for(int n=1;n<8;n++) cout<<setw(20-n)<<setfill(' ')<<" " <<setw(2*n-1)<<setfill('B')<<"B"<<endl; return 0;}
2015-06-02 19:36:26 295
原创 第七章第二题
#include #include using namespace std;int main(){float a[5]; cout<<"input data:"; int i=0; for( i=0;i<5;i++) cin>>a[i]; cout<<setiosflags(ios::fixed)<<setprecision(2); for(i=0
2015-06-02 19:33:43 293
原创 第七章第一题
#include #include using namespace std;int main(){double a,b,c,s,area; cout<<"please input a,b,c:"; cin>>a>>b>>c; if (a+b<=c) cerr<<"a+b<=c,error!"<<endl; else if(b+c<=a) cerr<<
2015-06-02 19:29:23 226
原创 本科生以及研究生信息
#include "iostream"#include "string"#include "list"using namespace std;class Student{protected: string Name; string Num; string Major; public: Student(){} Student(string Na, string Nu,
2015-05-27 19:48:07 288
原创 第六章第六题
#include using namespace std;//定义抽象基类Shapeclass Shape{public: virtual double area() const =0; //纯虚函数};//定义Circle(圆形)类class Circle:public Shape{public:Circle(d
2015-05-21 10:44:10 296
原创 创建三角形类
//扩展程序:创建一个三角形类//修改create_object函数,使得程序支持三角形的创建//和求面积、打印等操作#include #include "cmath"using namespace std;class Shape { public: virtual double getArea() const =0; virtual void print() const
2015-05-20 13:02:21 499
原创 第五章第十题
#include #include using namespace std;class Teacher //教师类 {public: Teacher(int,char [],char); //声明构造函数 void display(); /
2015-05-11 13:59:20 232
原创 第五章第九题
#include#include using namespace std;class Teacher {public: Teacher(string nam,int a,char s,string tit,string ad,string t); void display(); protected: string name; int age; cha
2015-05-11 13:54:58 198
原创 第五章第三题
#include using namespace std;class Student //声明基类{public: //基类公用成员 void get_value(); void display( ); protected : //基
2015-05-11 13:50:42 235
原创 第五章第二题
#include using namespace std;class Student{public: void get_value() {cin>>num>>name>>sex;} void display( ) {cout<<"num: "<<num<<endl; cout<<"name: "<<name<<endl; cout<<"sex: "<
2015-05-11 13:47:13 228
原创 第五章第一题
#include using namespace std;class Student{public: void get_value() {cin>>num>>name>>sex;} void display( ) {cout<<"num: "<<num<<endl; cout<<"name: "<<name<<endl; cout<<"sex: "<
2015-05-11 13:44:00 350
原创 data time
#include "iostream"using std::cin;using std::cout;using std::endl;using std::istream;using std::ostream;class Time{protected: int hour; int minute; int second;public: Time(int h =
2015-05-11 13:15:48 257
原创 用重载运算符做String
#ifndef _STRING_#define _STRING_#include "iostream"using std::ostream;using std::istream;class String{private:char *s;public:String();String(int n);String(const
2015-04-27 17:28:22 235
原创 第四章第七题
#include using namespace std;#include "string.h"class Student{public:Student(int,char[],char,float); int get_num(){return num;} char * get_name(){return name;} char get_sex(){return
2015-04-27 12:34:56 241
原创 第四章第六题
#include using namespace std;class Complex {public: Complex(){real=0;imag=0;} Complex(double r){real=r;imag=0;} Complex(double r,double i){real=r;imag=i;} operator double(){retur
2015-04-27 12:30:21 202
原创 第四章第五题
#include >using namespace std;class Matrix {public: Matrix(); friend Matrix operator+(Matrix &,Matrix &); friend ostream& operator friend istream& operator>>(istream&,Matrix&);
2015-04-27 12:27:49 173
原创 第四章第四题
#include using namespace std;class Matrix //定义Matrix类 {public:Matrix(); //默认构造函数 friend Matrix operator+(M
2015-04-24 14:15:30 225
原创 第四章第三题
#include using namespace std; class Complex {public: Complex(){real=0;imag=0;} Complex(double r,double i){real=r;imag=i;} Complex operator+(Complex &c2); Complex opera
2015-04-24 14:14:01 271 1
原创 第四章第二题
#include using namespace std;class Complex {public: Complex(){real=0;imag=0;} Complex(double r,double i){real=r;imag=i;} Complex operator+(Complex &c2); Complex operator-(Complex
2015-04-24 14:12:10 263
原创 第四章第一题
#include using namespace std;class Complex {public: Complex(){real=0;imag=0;} Complex(double r,double i){real=r;imag=i;} double get_real(); double get_imag(); void display();
2015-04-24 14:11:48 229
原创 第三章第12题
#include using namespace std;templateclass Compare {public: Compare(numtype a,numtype b); numtype max(); numtype min(); private: numtype x,y; };template Compare::Compa
2015-04-22 12:30:03 182
原创 第三章第十一题
#include using namespace std;class Time;class Date {public: Date(int,int,int); friend Time;private: int month; int day; int year; }; Date::Date(int m,int d,int y):m
2015-04-22 12:27:31 221
原创 第三章第十题
#include using namespace std;class Date;class Time {public: Time(int,int,int); friend void display(const Date &,const Time &); private: int hour; int minute; int sec;
2015-04-22 12:26:17 172
原创 第三章第九题
#include using namespace std;class Product {public: Product(int n,int q,float p):num(n),quantity(q),price(p){}; void total(); static float average(); static void display();
2015-04-22 12:24:38 230
原创 第三章第八题
#include using namespace std;class Student {public: Student(int n,float s):num(n),score(s){} void change(int n,float s) {num=n;score=s;} void display() {cout private: int num;
2015-04-22 12:21:12 198
原创 第三章第七题
#include using namespace std;class Student {public: Student(int n,float s):num(n),score(s){} void change(int n,float s) const {num=n;score=s;} void display() const {cout private:
2015-04-22 12:18:02 199
原创 第三章第五题
#include using namespace std;class Student {public: Student(int n,float s):num(n),score(s){} int num; float score; }; void main(){Student stud[5]={ Student(101,78.5),Stude
2015-04-22 12:14:49 218
原创 第三章第四题
#includeusing namespace std;class Student{public:void get_student();void display(); private:int num;int score;};void Student::get_student(){cin>>num>>score;} vo
2015-04-22 11:21:28 172
原创 第三章第三题
#includeusing namespace std;class Date{public:Date (int m=1,int d=1,int y=2005):month(m),day(d),year(y){};void display(); private:int month;int day;int year;};void Date::di
2015-04-22 11:00:56 159
原创 第二章第六题
#includeusing namespace std;class V{public:void set_lwh();void volume();void show_v();private:double length;double width;double height;double tiji;} ; int main(){V a
2015-04-10 15:40:48 233
原创 第二章第五题
//arraymax.h#includeusing namespace std;class Array_max{public:void set_value();void max_value();void show_value();private:int array[10];int max; } ;//arraymax.cpp#
2015-04-10 14:31:25 247
原创 第二章第四题
//main.cpp#includeusing namespace std;#include"student.h"int main(){student stdu;stdu.set_value();stdu.display();return 0;} //student.h#include#includeusing namespace
2015-04-10 14:17:51 209
原创 第二章第三题
#includeusing namespace std;class Time {public:void set_Time(); void show_Time();private:int hour;int minute;int sec;}; int main(){Time t1; t1.set_Time(); t1.show_
2015-04-10 13:55:28 185
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人