老师布置的课程设计做到这里不知道怎么写了大家先看看题目Video Rental Store Management Information System(影像资料管理信息系统)
Suppose your parents are thinking of opening a video rental store, they ask you to write a program to handle their inventory.
First, decide the major objects in a rental store (items to be rented and the people who rent them). You begin with the abstraction of the items to be rented – videotapes. 
Secondly, write a program to do the following tasks:
Create a list of video objects.
Search the list for a particular title.
Determine if there are any copies of a particular video currently in the store.
Print the list of video titles.
Thirdly, determine the characteristics of the customer and define a customer object. Write the operations and test them. Using this representation of a customer, write a program to do the following tasks:
Create a list of customers.
Search the list by customer name.
Search the list by customer identification number.
Print the list of customer names.
Fourthly, Combine the list of video objects and the list of customer objects into a program with the following capabilities:
Check out a video.
Check in a video.
Determine how many videos a customer has (by customer identification number).
Determine which customers have a certain video checked out (by title).(Hint: Create a hasVideo object that has a video title and a customer number.)
我是这样想的先设计一个光盘类文件,把光盘信息输入到文本文件中把借阅人的信息输入到文本文件中最后做一个联结输出文件可我做到第二步就不知道怎么办好了我的程序如下:#include <tchar.h>
#include <string>
#include <iostream>
#include <time.h>
#include <fstream>using namespace std;ofstream fout;enum mainIdVideos{PopMusic=1,CustomMusic};
enum indexIdVideos{Pop=1,Custom};void reverse( const char *const sPtr )
{  
   if ( sPtr[ 0 ] == '\0' )
      return;
   else {  
      reverse( &sPtr[ 1 ] );
      putchar( sPtr[ 0 ] );
   }
}struct person{
string Name;
int Id;
};class CBoyGirl
{
public:
CBoyGirl(void);
~CBoyGirl(void);
public:
void BoyGirlInfo();
private:
 person People;
};class COneVideo
{
public:
COneVideo(void);
~COneVideo(void);
bool videoInitialize(char[10],int,char[6],char);
bool videoInput(char[10],int,char[6],char);
bool videoOuput(char[10],int,char[6],char);
 private:
struct video{
              char Name[10];//设置光盘名称 
              char ID[5];//设置光盘ID,由两部分组成,主类(2位数字)从位(3位数字) 如0110代表流行音乐中得Love光盘 
              char videoInfo[500];//设置光盘信息,不超过500字
              int number;
  struct DATE{
  int year;
  int month;
  int day;
  } date;
  //设置光盘采集日期
  };
};CBoyGirl::CBoyGirl(void)
{
}CBoyGirl::~CBoyGirl(void)
{
}void CBoyGirl::BoyGirlInfo()
{
cout<<"Please input Boy's or Girl's Name"<<endl;
cin>>People.Name;
People.Id++;
}
COneVideo::COneVideo(void)
{
}COneVideo::~COneVideo(void)
{
}
bool COneVideo::videoInitialize(char[10],int,char[6],char)
{
return true;
}
bool COneVideo::videoInput(char[10],int,char[6],char)
{
/*在次需要确定一个判断语句,以此确定是否还有新书加入其中*/
 cout<<"Please input the name of the video"<<endl;
 video video;
 gets( video.Name );
 // modify
 string tmp(video.Name);
 //reverse(tmp.begin(),tmp.end());
 reverse( video.Name );
 // modify over
 strcpy(video.Name,tmp.c_str());
 cout<<"Please input the number of the video"<<endl;
 cin>>video.number;
 cout<<"Please input the main id of the video"<<endl;
 enum mainIdVideos mainIdVideo;
 const char *mainIdVideoId[]={"","PopMusic","CustomMusic"};
 
 int mainId,indexId;
 for(mainIdVideo=PopMusic;mainIdVideo<=CustomMusic;mainIdVideo=mainIdVideos(mainIdVideo+1))
cout<<mainIdVideo<<" stand for"<<mainIdVideoId[mainIdVideo]<<endl;
 cin>>mainId;
 cout<<"Please input the index id of the video"<<endl;
 enum indexIdVideos indexIdVideo;
 const char *indexIdVideoId[]={"","A","B"};  for(indexIdVideo=Pop;indexIdVideo<=Custom;indexIdVideo=indexIdVideos(indexIdVideo+1))
cout<<indexIdVideo<<" stand for  "<<indexIdVideoId[indexIdVideo]<<endl;
 cin>>indexId;
 // modify
 char sz[5];
 itoa(mainIdVideo,sz,10);
 strcpy(video.ID,sz);
 itoa(indexIdVideo,sz,10);
 strcat(video.ID,sz);// 此处需要进行缓冲区溢出检查,我没做
 //video.ID="mainIdVideo"+"indexIdVideo";
 cout<<"Please input the videoinfo of the video"<<endl;
 gets( video.videoInfo );
 reverse(video.videoInfo);
 cout<<"Please input the buy data(year mouth day) of the video,Enter number 1 means now ,enter 2 means what you input"<<endl;
 int number;
 tm time;
 time_t t;
 t=_getsystime(&time);
 cin>>number;
 switch (number){
 case 1:
  cin>>video.date.year;
cin>>video.date.month;
cin>>video.date.day;
break;
 default:
video.date.year=time.tm_year-100;
video.date.month=time.tm_mon+1;
video.date.day=time.tm_mday;
break;
 }
 FILE *cfPtr = fopen( "Video.txt", "a+" );
 if ( cfPtr == NULL ){//a+代表追加文件记录
cout<<"File could not be opened"<<endl;
 }
 else { 
        cout<<video.Name<<video.number<<video.ID<<video.date.year<<video.date.month<<video.date.day<<endl;
fclose(cfPtr);  
 }
return true;
}bool COneVideo::videoOuput(char[10],int,char[6],char)
{
return true;
}int _tmain(int argc, _TCHAR* argv[])
{
COneVideo Video;
char tmp10[10];
tmp10[0] = 0;
int i = 0;
char tmp6[6];
tmp6[0] = 0;
char t = 0;
Video.videoInput(tmp10,i,tmp6,t);
CBoyGirl BG;
BG.BoyGirlInfo();
return 0;
}
还有不少的问题
大家帮忙看看好吗

解决方案 »

  1.   

    为什么要写到文本文件里?用数据库来实现就简单得多了,用Access建两个表,sql语句,很快就能搞定。
      

  2.   

    我一般不用数据库,额外负担太大。一向用ini记录。但是你这个题目实在就是数据库的枪口,建议你用delphi或者vb什么的弄个简单的数据库,一天就搞定了。
      

  3.   

    可老师是c++  的啊这个是我门的课程设计啊谁会做发给我程序吧我的QQ369094566
      

  4.   

    ..... 直接要源碼不態好哦會做的可能很多 可是大家不一定有控呀數據庫 也沒什麼額外復旦呀ini的話 數據量大了也不好的
    可以采用 access 這種比較簡單的數據庫。。