首页 新闻 聚焦 科技 财经 创业 综合 图片 视频

IT界

旗下栏目: 行业 生态 IT界 创新

PROG2111程序辅导、辅导C/C++,Python编程

来源:互联网 发布时间:2021-10-18
PROG2111程序辅导、辅导C/C++,Python编程
Relational Databases – PROG2111 Assignment #1
Maximum group size: 2  
Objectives:
‐  To review file I/O basics
‐  To simulate a database service by using any method like the one given in the requirements OR by
using Threads OR by simple File handling using multiple programs at the same time.
Description:  
Method 1:
You will write a client‐server software system that demonstrates how a database system normally
operates in a network environment. Generally, a database system runs as a service that responds to
requests from an arbitrary list of sources. It is up to the database system to make sure data is secure and
integrity is maintained. For example, only those sources that are permitted should access or update the
data; and only one source can update data at a time – even though several sources may be requesting to
update at the same time.   
Method 2:
You can write a program that uses Threads for accessing and updating the same text file by many
processes.
Method 3:
Write down programsthat try to accessthe same file simultaneously running with each other. So, in effect
you will be needing one program/application that creates a text file and then other applications/programs
that can access and update the contents. You can use three applications/programs for this purpose.  
Requirements:
1. The database file consists of records with the following fields:
A. MemberID (as an integer)
B. FirstName (as a variable length string)
C. LastName (as a variable length string)
D. DateOfBirth (as a Date format supported by your OS)
2. Write a server program that will run continuously, listening for requests to write to the
database. There are only 3 requests that the server can respond to:
A. INSERT ‐ allows the insertion of new data. The data should be provided only as the
The server should only handle up to 40,000 records. This means that IDs of 1‐40,000 would
be valid.
If the INSERT command is not successful, an error should be returned to the client.
B. UPDATE – allows the modification of existing records. The client must provide a valid
MemberID, FirstName, LastName and DateOfBirth. Even though the data may not change,
all four values should be in the parameter list.
If the UPDATE command is not successful, an error should be returned to the client.
C. FIND – allows a client program to get the information of a specific MemberID. The server
should return all four data fields.
If the FIND command is not successful, an error should be returned to the client.
3. Write a client program that can query the database allowing you to use INSERT, UPDATE and
FIND commands
Hand in:
Method 1 Submission:
1. The Server command definitions/protocol document
2. All source code
3. Installation and usage instructions
4. Document stating any problems or deficiencies (bug list) in the submitted program.
Method 2 Submission:
1. All source codes
2. Usage instructions
Method 3 Submission:
1. All source codes
2. Usage instructions
Please discuss if you are still unclear about the requirements by dropping an email. I will be available for
discussion on our class day that is Tuesday September 22,2020 after our regular class for some time.
 
请加QQ:99515681 或邮箱:99515681@qq.com   WX:codehelp
  免责声明:珠穆朗玛网对于有关本网站的任何内容、信息或广告,不声明或保证其正确性或可靠性,用户自行承担使用网站信息发布内容的真假风险。
责任编辑:珠穆朗玛网