C++编程实验导书.doc

  1. 1、本文档共7页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 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,

文档评论(0)

aining + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档