1
cs3157 – Advanced Programming
Summer 2014, Project 1, 150 points
June 17, 2014
Follow these step-by-step instructions. This homework must be submitted electronically by
Sunday night July 6th, 11pm. Please start early, so we can help if you get stuck.
In this project you will be making use of c’s pointers, arrays, dynamic memory allocation, i/o and your
perl knowledge etc.
Goal: the overall goal of your project is to develop a website which allows you to coordinate a shared
calendar between users. Any user can create a meeting (think of a class) which a specific schedule
(weekly, monthly, etc). A meeting has a title, subject, time, address, and description associated with it.
Creativity counts, so feel free to improvise as long as you cover the general gist of the assignment.
I am breaking down the assignment into section parts and then into steps to allow you to manage the
project more efficiently. In addition we will be doing some of the work in class.
Do not forget to comment, and create a makefile for the project. Please break the project into relevant .h
and .c files so that it is easier to maintain and debug. In you readme make sure to note what each file does,
and how each step is related to a specific file. You should submit final files which everything working (as
much as you can). In addition, if you will need to demonstrate a working website to the TA either via
showing it on your laptop or on a publicly available webspace. The front end cgi can be perl if you like,
but the underlying data should be in c/c++ as relevant. For all design decisions please document in the
README file.
Step 1 (15 points) Initial Login Page
Create a single cgi file which when loaded up for the first time presents the user with a login form (that is
there is no external html page only output from the cgi on empty input).
The form should contain a user field box and password field box. When typed, the password should show
stars and not text. You should name this file MainProject1.c and create a MainProject1.h. The form action
destination should point to the script itself.
The top of the page should contain the title. The bottom of the main page you should display some
information about yourself (and link to your homepage if you have one). Feel free to make it as fancy as
you like.
Step 2 (25 points) Create account
Add a link to the initial page saying “click here to create an account”. This should call a
CreateAccount.cgi program which will ask the user for their name, password, and email and add it to a
password file.
The password file is a simple text file with the following format:
USER=MD5PASSWORD=email
USER2=MD5PASSWORD2=email2
2
Each password is kept as an md5 of the password, and = can not be part of the user name.
Before adding a new user to the file you should check if it is in the file already. If its not you can append
it to the end.
Verify this works by creating 2 accounts, and then visually inspecting the password.txt file.
When this script is done, it should spit out the original login page. You can do this by calling the
appropriate function which renders the page from the other.c file (ask me if this isn’t clear). This is why
we split out the html page into a separate function in class.
You should use pointers, make sure you are freeing the memory. As discussed in class, use any md5
library you want.
Step 3 (30 points) Main page
If the original cgi is presented with a user name and password, you need to verify it in the password file.
If it is verified, you will now create a subdirectory in the system to store appointments for the user (only
done first time).
Now the user is presented with the following links:
1) add new meeting
this will allow the user to add a new meetings into the system with another form
2) view all meetings
this will show all current meetings added to the system by this user
3) system information
show some information such as how many meetings are in the system and how many users
for each of the above steps you should be calling the original script. Which means you need to embed
information in the link when you call yourself. For example you can create a link for a test.cgi and pass
information:
<a href=”test.cgi?todo=newmeet”>Click here for new appointment</a>
that will pass in a query string with todo set to “newmeet” so your script can check for that combination
and act appropriately.
Now add appropriate forms for a new meeting. Here you will collect the start date, start time, end date,
end time, subject, and text info about the meeting. You need to decide how to save the meeting
information as a file. For example you can choose each meeting as a separate file in a unique directory
(made up from the usersname) and name them with the “startdate-starttime.app.txt”.
For the view all meetings you can simply spit back a large html page with all the information….you
should look into html tables as a way of organizing the information nicer.
System information should run through all users directories and collect the correct stats info.
3
Step 4 (30 points) Navigation page
We want to add a browser-able calendar feature. The idea is that once a user logs in, they can browse
through an html calendar (basically a large html table with 7 columns (ie day of week) and be able to click
on a entry to add an event.
You will be creating a calendar class which will be able to take a month to display and be able to print out
the month correctly.
The English calendar has probably the simplest rules for figuring out how many days per month. Trickier
is to figure out what the day of the week is…..if you can’t think of a trick please email me for hints…
Note that the cells in the calendar page should be passing in information to whatever cgi component or
argument is responsible for creating events.
Step 5 (30 points) Search Engine
We will now add a search capability for the specific user’s schedule. Present a form which allows the user
to query their
1) entire schedule history (show all appointments)
2) all schedules between 2 dates (starting and end date)
3) all schedule between 2 dates (starting and end) and between specific times (example : all
appointments between july 1 2014 and july 20 2014, between 10:00 am and 11:00 am
4) search through the text info for specific string.
This might require you to reorganize the appointment representation on the back end. No reason why
the data might not be stored in multiple forms to help search.
In order to do this step cleanly, create a search class which has specific functions to help specific
searches. For example step 2 and 3 are related and can be coded as one function if you play around
with the times.
Step 6 (30 points) Find a free spot
In this step you want the user to be able to schedule a group appointment between X users on the system.
You will need to allow the user to check off specific users on the system (will need to list all current
users).
Then the user can input a starting date (july 15, 2014), starting time (11am) and length of time (3 hour
appointment (meeting) ).
The system needs to search though all the users and find the first occurring timeslot where everyone is
free for the length of the appointment.
You need to show both first free timeslot and first date which has that time and free time slot.
So for the above example, you might return
1) July 15, 2014 at 6:00pm everyone is free for 3 hours.
2) July 20, 2014 at 11am everyone is free for 3 hours.
4
The user can then click on one of the above and it will insert a group appointment into everyone’s
schedule.
Good Luck and Extra Credit for graphics and originality.
Submit your project.
You need to submit the following files for this homework: README, Makefile, plus all the files
generated above. Submit it over courseworks.
- 浏览: 1010948 次
最新评论
-
18335864773:
很多公司项目 都在使用pageoffice 来操作word,e ...
用java生成word文档 -
Gozs_cs_dn:
请问下博主, 怎样将sitemesh3.xsd绑定 sitem ...
SiteMesh3配置 -
Rose_06:
springside4.0quick-start.bat报错原因 -
ilemma:
我也是刚参见工作啊,经理让自学这个,有些东西不太懂,能不能发个 ...
Apache Shiro在Web中的应用 -
shanbangyou:
你废了
程序员上班打酱油的方法
相关推荐
C语言程序设计(4) 课件 第10章 字符串.ppt C语言程序设计(4) 课件 第11章 指针和数组.ppt C语言程序设计(4) 课件 第12章 结构体和数据结构基础.ppt C语言程序设计(4) 课件 第13章 文件操作.ppt C语言程序设计(4) ...
武汉理工大学《C语言程序设计》实验报告册.pdf武汉理工大学《C语言程序设计》实验报告册.pdf武汉理工大学《C语言程序设计》实验报告册.pdf武汉理工大学《C语言程序设计》实验报告册.pdf武汉理工大学《C语言程序设计...
《单片机C语言程序设计实训100例——基于8051+Proteus仿真》下载.zip《单片机C语言程序设计实训100例——基于8051+Proteus仿真》下载.zip《单片机C语言程序设计实训100例——基于8051+Proteus仿真》下载.zip《单片机...
张玉生编写的《C语言程序设计》双色版是一本针对初学者的C语言理论教材,它包括了C语言的基础知识、语法结构、数据类型、控制结构、函数、指针、数组、字符串等核心技术内容。该教材不仅适合自学,同时也适合作为...
C语言程序设计与实例TXT电子书 1 C语言概述 1.1 C语言的发展过程 1.2 当代最优秀的程序设计语言 1.3 C语言版本 1.4 C语言的特点 1.5 面向对象的程序设计语言 1.6 C和C++ 1.7 简单的C程序介绍 ...
单片机C语言程序设计K1-K4 控制LED移位(基于8051+Proteus仿真)单片机C语言程序设计K1-K4 控制LED移位(基于8051+Proteus仿真)单片机C语言程序设计K1-K4 控制LED移位(基于8051+Proteus仿真)单片机C语言程序设计...
单片机C语言程序设计 10秒的秒表(有源码)单片机C语言程序设计 10秒的秒表(有源码)单片机C语言程序设计 10秒的秒表(有源码)单片机C语言程序设计 10秒的秒表(有源码)单片机C语言程序设计 10秒的秒表(有源码)...
《C语言程序设计教程》是一本专为初学者和进阶者设计的编程教材,它详细介绍了C语言的基础知识和编程技巧。C语言是计算机科学领域广泛应用的一种编程语言,因其高效、灵活和接近硬件的特点,被广泛应用于系统编程、...
"《C语言程序设计》课程思政教学改革教学设计" 本设计旨在探索《C语言程序设计》课程思政教学改革教学设计,旨在将哲学基本原理及方法论融入新工科课程思政实践中。该设计涵盖了《C语言程序设计》课程的教学大纲、...
《C语言程序设计》是李峰教授编著的一本经典的C语言教材,其第二版针对初学者和进阶者提供了全面且深入的C语言学习资源。该教材深受广大编程爱好者和计算机专业学生的喜爱,因其清晰的讲解和丰富的实例而广受好评。...
"C语言程序设计"这本书无疑是学习C语言的经典教材,对于初学者和进阶者都有很高的参考价值。 本书涵盖了C语言的基础概念和核心语法,包括变量、数据类型、运算符、控制结构(如if语句、switch语句、for循环、while...
单片机C语言程序设计17 数码管显示的频率计(基于8051+Proteus仿真)单片机C语言程序设计17 数码管显示的频率计(基于8051+Proteus仿真)单片机C语言程序设计17 数码管显示的频率计(基于8051+Proteus仿真)单片机...
C语言程序设计教案C语言程序设计教案C语言程序设计教案C语言程序设计教案C语言程序设计教案C语言程序设计教案C语言程序设计教案C语言程序设计教案C语言程序设计教案C语言程序设计教案C语言程序设计教案C语言程序设计...
《C语言程序设计(第四版)》是一本深入学习C语言的经典教材,书中涵盖了C语言的基础知识、程序设计方法以及算法等内容。以下是根据书中的章节和习题解析的知识点总结: 1. **C语言基础** - **计算机程序**:是按照...
《C语言程序设计(第4版)》是苏小红教授编著的一部经典教材,旨在教授初学者如何使用C语言进行程序设计。这本教材的第四版课件包括了一系列的PPT章节,涵盖了C语言的基础到进阶内容,帮助学习者系统地掌握编程思维...
"C语言程序设计完整PPT课件" C语言程序设计是计算机科学中的一门重要课程,本课件从C语言的历史背景、发展史、特点、基本程序结构、开发过程、基本词法、算法等方面进行了详细的介绍。 C语言的历史背景可以追溯到...
单片机C语言程序设计 单只数码管循环显示0-9(有源码)单片机C语言程序设计 单只数码管循环显示0-9(有源码)单片机C语言程序设计 单只数码管循环显示0-9(有源码)单片机C语言程序设计 单只数码管循环显示0-9(有源码)...
### C语言程序设计基础知识 C语言是一种广泛使用的高级编程语言,因其高效性和灵活性而备受青睐。对于初学者来说,理解C语言的基本概念和语法结构是非常重要的。本文将根据提供的部分内容来解析C语言的基础知识。 ...
C语言程序设计教程参考答案.pdf
《C语言程序设计现代方法第2版》是一本深入学习C语言的经典教材,其全面覆盖了C语言的基础概念、语法和高级特性。书中的499道课后习题是检验学习成果和提升编程能力的重要途径。这些习题涵盖了从基本的数据类型、...