- 1、本文档共7页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
C编程实验导书
《C++编程》实验指导书
程保中 谢锦
一、实验一:C++程序编制
实验目的
学生通过使用C++语言基本开发,
2) 熟练使用VC6.0 IDE 进行编程。
3) 需要上交源程序文件。
实验步骤
1) 启动VC6.0 IDE。
2)建立workspace和project。
3)编辑源程序。
4)编译、链接并执行源程序,看结果是否正确。
5)如果报错或告警,做必要修改,重复3)--5)步骤直到没有错误和告警。
附件:实验要求
Lab Project 1
This lab might take long time so do not wait until the last moment. Start as early as possible.
Goal:
? To familiarize yourself with coding in Object Oriented Programming.
? Getting started with Classes, Objects and their usage.
Problem Description
In this lab, you are going to develop a calendar system which prints out the dates (along with corresponding days) for the given a month and year. User inputs the following details to help you calculate the required month’s days:
1. Year – Year for which the calendar is required.
2. Month – Month for which you have to output the calendar.
3. New Year Day – Day on which Jan 1st falls. For example, for 2006, it would
be Sunday.
Year should be used to check whether it is a Leap year or not. YYYY is leap year if
following two conditions hold:
? should be perfectly divisible by 4.
? If it is divisible by 100 then it should not be divisible by 400.
New Year Day (NYD) is required so that you can calculate the starting day of the
required month i.e., unless you know that year 2006 starts with Sunday, you will not be able to know that May 2006 starts with Monday.
Format of Input
? Year – YYYY (Ex: 1999)
? Month – MM (Ex: 11, 04 or 4. Leading zero is optional i.e., user has a choice to enter either 04 or 4)
? New Year Day (NYD) – One of the following characters
M – Monday
T – Tuesday
W – Wednesday
R – Thursday
F – Friday
S – Saturday
U – Sunday
Appropriate error should be raised if any of the input is not in the correct format.
Examples of bad input are: 99 for year, 15 for month, ‘T’ for NYD.
Example Input Output
Year: 2006
Month: 06
NYD: R
Output:
Year: 2008
Month: 4
NYD: T
Output:
Requirements of the Program
Though this program can be done without using C++ features or classes,
您可能关注的文档
最近下载
- 必威体育精装版人教版小学六年级下册音乐全册教案.doc
- 汽车构造拆装实习报告.pdf VIP
- 《分香蕉》优质课课件(北师大版数学二年级上册).pptx VIP
- 天然气蒸汽锅炉安全操作规程.docx
- 防防呆法防错法IE七大手法演示文稿.ppt VIP
- 幼儿园大班数学活动《小动物住新房》.ppt VIP
- 党的二十届三中全会精神测试题300道(单选、多选、判断、填空).docx VIP
- 劳动项目七 洗碗筷(课件)二年级下册劳动人教版.ppt
- 医院综合病房楼空调系统施工组织设计方案范本.doc
- 平方根与立方根的运算专项训练(20题)-重要笔记七年级数学下学期重要考点练习(人教版)(含答案析).docx
文档评论(0)