当前位置:文档之家› 电气工程与自动化专业控制电路设计大学毕业论文英文文献翻译及原文

电气工程与自动化专业控制电路设计大学毕业论文英文文献翻译及原文

电气工程与自动化专业控制电路设计大学毕业论文英文文献翻译及原文
电气工程与自动化专业控制电路设计大学毕业论文英文文献翻译及原文

毕业设计(论文)

外文文献翻译

文献、资料中文题目:控制电路设计

文献、资料英文题目:Designing Stable Control Loops

文献、资料来源:

文献、资料发表(出版)日期:

院(部):

专业:电气工程与自动化

班级:

姓名:

学号:

指导教师:

翻译日期: 2017.02.14

本科毕业设计

外文文献及译文

文献、资料题目:Designing Stable Control Loops 文献、资料来源:期刊

文献、资料发表(出版)日期:2010.3.25

院(部):信息与电气工程学院

专业:电气工程与自动化

班级:

姓名:

学号:

指导教师:

翻译日期:

外文文献:

Designing Stable Control Loops

The objective of this topic is to provide the designer with a practical review of loop compensation techniques applied to switching power supply feedback control. A top-down system approach is taken starting with basic feedback control concepts and leading to step-by-step design procedures, initially applied to a simple buck regulator and then expanded to other topologies and control algorithms. Sample designs are demonstrated with Math cad simulations to illustrate gain and phase margins and their impact on performance analysis.

I. I NTRODUCTION

Insuring stability of a proposed power supply solution is often one of the more challenging aspects of the design process. Nothing is more disconcerting than to have your lovingly crafted breadboard break into wild oscillations just as its being demonstrated to the boss or customer, but insuring against this unfortunate event takes some analysis which many designers view as formidable. Paths taken by design engineers often emphasize either cut-and-try empirical testing in the laboratory or computer simulations looking for numerical solutions based on complex mathematical models. While both of these approach a basic understanding of feedback theory will usually allow the definition of an acceptable compensation network with a minimum of computational effort.

II. S TABILITY D EFINED

Fig. 1. Definition of stability

Fig. 1 gives a quick illustration of at least one definition of stability. In its simplest terms, a system is stable if, when subjected to a perturbation from some source, its response to that

perturbation eventually dies out. Note that in any practical system, instability cannot result in a completely unbounded response as the system will either reach a saturation level –or fail. Oscillation in a switching regulator can, at most, vary the duty cycle between zero and 100% and while that may not prevent failure, it wills ultimate limit the response of an unstable system. Another way of visualizing stability is shown in Fig. 2. While this graphically illustrates the concept of system stability, it also points out that we must make a further distinction between large-signal and small-signal stability. While small-signal stability is an important and necessary criterion, a system could satisfy thisrt quirement and yet still become unstable with a large-signal perturbation. It is important that designers remember that all the gain and phase calculations we might perform are only to insure small-signal stability. These calculations are based upon – and only applicable to –linear systems, and a switching regulator is – by definition –a non-linear system. We solve this conundrum by performing our analysis using small-signal perturbations around a large-signal operating point, a distinction which will be further clarified in our design procedure discussion。

Fig. 2. Large-signal vs. small-signal stability

III. F EEDBACK C ONTROL P RINCIPLES

Where an uncontrolled source of voltage (or current, or power) is applied to the input of our system with the expectation that the voltage (or current, or power) at the output will be very well controlled. The basis of our control is some form of reference, and any deviation between the output and the reference becomes an error. In a feedback-controlled system, negative feedback is used to reduce this error to an acceptable value –as close to zero as we want to spend the effort to achieve. Typically, however, we also want to reduce the error quickly, but inherent with feedback control is the tradeoff between system response and system stability. The more responsive the feedback network is, the greater becomes the risk of instability. At this point we should also

mention that there is another method of control –feedforward.With feed forward control, a control signal is developed directly in response to an input variation or perturbation. Feed forward is less accurate than feedback since output sensing is not involved, however, there is no delay waiting for an output error signal to be developed, andfeedforward control cannot cause instability. It should be clear that feed forward control will typically not be adequate as the only control method for a voltage regulator, but it is often used together with feedback to improve a regulator’s response to dynamic input variations.

The basis for feedback control is illustrated with the flow diagram of Fig. 3 where the goal is for the output to follow the reference predictably and for the effects of external perturbations, such as input voltage variations, to be reduced to tolerable levels at the output Without feedback, the reference-to-output transfer function y/u is equal to G, and we can express the output asy Gu With the addition of feedback (actually the subtraction of the feedback signal)

y Gu yHG

and the reference-to-output transfer function becomes

y/u=G/1+GH

If we assume that GH __ 1, then the overall transfer function simplifies to

y/u=1/H

Fig. 3. Flow graph of feedback control

Not only is this result now independent of G,it is also independent of all the parameters of the system which might impact G (supply voltage, temperature, component tolerances, etc.) and is determined instead solely by the feedback network H (and, of course, by the reference).Note that the accuracy of H (usually resistor tolerances) and in the summing circuit (error amplifier offset voltage) will still contribute to an output error. In practice, the feedback control system, as modeled in Fig. 4, is designed so thatG __ H and GH __ 1 over as wide a frequency range as possible without incurring instability. We can make a further refinement to our generalized power

regulator with the block diagram shown in Fig. 5. Here we have separated the power system into two blocks –the power section and the control circuitry. The power section handles the load current and is typically large, heavy, and subject to wide temperature fluctuations. Its switching functions are by definition, large-signal phenomenon, normally simulated in most stability analyses as just a two states witch with a duty cycle. The output filter is also considered as a part of the power section but can be considered as a linear block.

Fig. 4. The general power regulator

IV. T HE B UCK C ONVERTER

The simplest form of the above general power regulator is the buck –or step down –topology whose power stage is shown in Fig. 6. In this configuration, a DC input voltage is switched at some repetitive rate as it is applied to an output filter. The filter averages the duty cycle modulation of the input voltage to establish an output DC voltage lower than the input value.The transfer function for this stage is defined by

tON=switch on -time

T = repetitive period (1/fs)

d = duty cycle

概率论毕业论文外文翻译

Statistical hypothesis testing Adriana Albu,Loredana Ungureanu Politehnica University Timisoara,adrianaa@aut.utt.ro Politehnica University Timisoara,loredanau@aut.utt.ro Abstract In this article,we present a Bayesian statistical hypothesis testing inspection, testing theory and the process Mentioned hypothesis testing in the real world and the importance of, and successful test of the Notes. Key words Bayesian hypothesis testing; Bayesian inference;Test of significance Introduction A statistical hypothesis test is a method of making decisions using data, whether from a controlled experiment or an observational study (not controlled). In statistics, a result is called statistically significant if it is unlikely to have occurred by chance alone, according to a pre-determined threshold probability, the significance level. The phrase "test of significance" was coined by Ronald Fisher: "Critical tests of this kind may be called tests of significance, and when such tests are available we may discover whether a second sample is or is not significantly different from the first."[1] Hypothesis testing is sometimes called confirmatory data analysis, in contrast to exploratory data analysis. In frequency probability,these decisions are almost always made using null-hypothesis tests. These are tests that answer the question Assuming that the null hypothesis is true, what is the probability of observing a value for the test statistic that is at [] least as extreme as the value that was actually observed?) 2 More formally, they represent answers to the question, posed before undertaking an experiment,of what outcomes of the experiment would lead to rejection of the null hypothesis for a pre-specified probability of an incorrect rejection. One use of hypothesis testing is deciding whether experimental results contain enough information to cast doubt on conventional wisdom. Statistical hypothesis testing is a key technique of frequentist statistical inference. The Bayesian approach to hypothesis testing is to base rejection of the hypothesis on the posterior probability.[3][4]Other approaches to reaching a decision based on data are available via decision theory and optimal decisions. The critical region of a hypothesis test is the set of all outcomes which cause the null hypothesis to be rejected in favor of the alternative hypothesis. The critical region is usually denoted by the letter C. One-sample tests are appropriate when a sample is being compared to the population from a hypothesis. The population characteristics are known from theory or are calculated from the population.

毕业设计外文翻译附原文

外文翻译 专业机械设计制造及其自动化学生姓名刘链柱 班级机制111 学号1110101102 指导教师葛友华

外文资料名称: Design and performance evaluation of vacuum cleaners using cyclone technology 外文资料出处:Korean J. Chem. Eng., 23(6), (用外文写) 925-930 (2006) 附件: 1.外文资料翻译译文 2.外文原文

应用旋风技术真空吸尘器的设计和性能介绍 吉尔泰金,洪城铱昌,宰瑾李, 刘链柱译 摘要:旋风型分离器技术用于真空吸尘器 - 轴向进流旋风和切向进气道流旋风有效地收集粉尘和降低压力降已被实验研究。优化设计等因素作为集尘效率,压降,并切成尺寸被粒度对应于分级收集的50%的效率进行了研究。颗粒切成大小降低入口面积,体直径,减小涡取景器直径的旋风。切向入口的双流量气旋具有良好的性能考虑的350毫米汞柱的低压降和为1.5μm的质量中位直径在1米3的流量的截止尺寸。一使用切向入口的双流量旋风吸尘器示出了势是一种有效的方法,用于收集在家庭中产生的粉尘。 摘要及关键词:吸尘器; 粉尘; 旋风分离器 引言 我们这个时代的很大一部分都花在了房子,工作场所,或其他建筑,因此,室内空间应该是既舒适情绪和卫生。但室内空气中含有超过室外空气因气密性的二次污染物,毒物,食品气味。这是通过使用产生在建筑中的新材料和设备。真空吸尘器为代表的家电去除有害物质从地板到地毯所用的商用真空吸尘器房子由纸过滤,预过滤器和排气过滤器通过洁净的空气排放到大气中。虽然真空吸尘器是方便在使用中,吸入压力下降说唱空转成比例地清洗的时间,以及纸过滤器也应定期更换,由于压力下降,气味和细菌通过纸过滤器内的残留粉尘。 图1示出了大气气溶胶的粒度分布通常是双峰形,在粗颗粒(>2.0微米)模式为主要的外部来源,如风吹尘,海盐喷雾,火山,从工厂直接排放和车辆废气排放,以及那些在细颗粒模式包括燃烧或光化学反应。表1显示模式,典型的大气航空的直径和质量浓度溶胶被许多研究者测量。精细模式在0.18?0.36 在5.7到25微米尺寸范围微米尺寸范围。质量浓度为2?205微克,可直接在大气气溶胶和 3.85至36.3μg/m3柴油气溶胶。

毕业论文英文参考文献与译文

Inventory management Inventory Control On the so-called "inventory control", many people will interpret it as a "storage management", which is actually a big distortion. The traditional narrow view, mainly for warehouse inventory control of materials for inventory, data processing, storage, distribution, etc., through the implementation of anti-corrosion, temperature and humidity control means, to make the custody of the physical inventory to maintain optimum purposes. This is just a form of inventory control, or can be defined as the physical inventory control. How, then, from a broad perspective to understand inventory control? Inventory control should be related to the company's financial and operational objectives, in particular operating cash flow by optimizing the entire demand and supply chain management processes (DSCM), a reasonable set of ERP control strategy, and supported by appropriate information processing tools, tools to achieved in ensuring the timely delivery of the premise, as far as possible to reduce inventory levels, reducing inventory and obsolescence, the risk of devaluation. In this sense, the physical inventory control to achieve financial goals is just a means to control the entire inventory or just a necessary part; from the perspective of organizational functions, physical inventory control, warehouse management is mainly the responsibility of The broad inventory control is the demand and supply chain management, and the whole company's responsibility. Why until now many people's understanding of inventory control, limited physical inventory control? The following two reasons can not be ignored: First, our enterprises do not attach importance to inventory control. Especially those who benefit relatively good business, as long as there is money on the few people to consider the problem of inventory turnover. Inventory control is simply interpreted as warehouse management, unless the time to spend money, it may have been to see the inventory problem, and see the results are often very simple procurement to buy more, or did not do warehouse departments . Second, ERP misleading. Invoicing software is simple audacity to call it ERP, companies on their so-called ERP can reduce the number of inventory, inventory control, seems to rely on their small software can get. Even as SAP, BAAN ERP world, the field of

自动化外文翻译

景德镇陶瓷学院 毕业设计(论文)有关外文翻 译 院系:机械电子工程学院 专业:自动化 姓名:肖骞 学号: 201010320116 指导教师:万军 完成时间: 2014.5.8 说明

1、将与课题有关的专业外文翻译成中文是毕业设计(论文)中的一个不可缺少的环节。此环节是培养学生阅读专业外文和检验学生专业外文阅读能力的一个重要环节。通过此环节进一步提高学生阅读专业外文的能力以及使用外文资料为毕业设计服务,并为今后科研工作打下扎实的基础。 2、要求学生查阅与课题相关的外文文献3篇以上作为课题参考文献,并将其中1篇(不少于3000字)的外文翻译成中文。中文的排版按后面格式进行填写。外文内容是否与课题有关由指导教师把关,外文原文附在后面。 3、指导教师应将此外文翻译格式文件电子版拷给所指导的学生,统一按照此排版格式进行填写,完成后打印出来。 4、请将封面、译文与外文原文装订成册。 5、此环节在开题后毕业设计完成前完成。 6、指导教师应从查阅的外文文献与课题紧密相关性、翻译的准确性、是否通顺以及格式是否规范等方面去进行评价。 指导教师评语: 签名: 年月日

TMS320LF2407, TMS320LF2406, TMS320LF2402 TMS320LC2406, TMS320LC2404, MS320LC2402 DSP CONTROLLERS The TMS320LF240x and TMS320LC240x devices, new members of the ‘24x family of digital signal processor (DSP) controllers, are part of the C2000 platform of fixed-point DSPs. The ‘240x devices offer the enhanced TMS320 architectural design of the ‘C2xx core CPU for low-cost, low-power, high-performance processing capabilities. Several advanced peripherals, optimized for digital motor and motion control applications, have been integrated to provide a true single chip DSP controller. While code-compatible with the existing ‘24x DSP controller devices, the ‘240x offers increased processing performance (30 MIPS) and a higher level of peripheral integration. See the TMS320x240x device summary section for device-specific features. The ‘240x family offers an array of memory sizes and different peripherals tailored to meet the specific price/performance points required by various applications. Flash-based devices of up to 32K words offer a reprogrammable solution useful for: ◆Applications requiring field programmability upgrades. ◆Development and initial prototyping of applications that migrate to ROM-based devices. Flash devices and corresponding ROM devices are fully pin-to-pin compatible. Note that flash-based devices contain a 256-word boot ROM to facilitate in-circuit programming. All ‘240x devices offer at least one event manager module which has been optimized for digital motor control and power conversion applications. Capabilities of this module include centered- and/or edge-aligned PWM generation, programmable deadband to prevent shoot-through faults, and synchronized analog-to-digital conversion. Devices with dual event managers enable multiple motor and/or converter

毕业论文外文翻译模版

吉林化工学院理学院 毕业论文外文翻译English Title(Times New Roman ,三号) 学生学号:08810219 学生姓名:袁庚文 专业班级:信息与计算科学0802 指导教师:赵瑛 职称副教授 起止日期:2012.2.27~2012.3.14 吉林化工学院 Jilin Institute of Chemical Technology

1 外文翻译的基本内容 应选择与本课题密切相关的外文文献(学术期刊网上的),译成中文,与原文装订在一起并独立成册。在毕业答辩前,同论文一起上交。译文字数不应少于3000个汉字。 2 书写规范 2.1 外文翻译的正文格式 正文版心设置为:上边距:3.5厘米,下边距:2.5厘米,左边距:3.5厘米,右边距:2厘米,页眉:2.5厘米,页脚:2厘米。 中文部分正文选用模板中的样式所定义的“正文”,每段落首行缩进2字;或者手动设置成每段落首行缩进2字,字体:宋体,字号:小四,行距:多倍行距1.3,间距:前段、后段均为0行。 这部分工作模板中已经自动设置为缺省值。 2.2标题格式 特别注意:各级标题的具体形式可参照外文原文确定。 1.第一级标题(如:第1章绪论)选用模板中的样式所定义的“标题1”,居左;或者手动设置成字体:黑体,居左,字号:三号,1.5倍行距,段后11磅,段前为11磅。 2.第二级标题(如:1.2 摘要与关键词)选用模板中的样式所定义的“标题2”,居左;或者手动设置成字体:黑体,居左,字号:四号,1.5倍行距,段后为0,段前0.5行。 3.第三级标题(如:1.2.1 摘要)选用模板中的样式所定义的“标题3”,居左;或者手动设置成字体:黑体,居左,字号:小四,1.5倍行距,段后为0,段前0.5行。 标题和后面文字之间空一格(半角)。 3 图表及公式等的格式说明 图表、公式、参考文献等的格式详见《吉林化工学院本科学生毕业设计说明书(论文)撰写规范及标准模版》中相关的说明。

java毕业论文外文文献翻译

Advantages of Managed Code Microsoft intermediate language shares with Java byte code the idea that it is a low-level language witha simple syntax , which can be very quickly translated intonative machine code. Having this well-defined universal syntax for code has significant advantages. Platform independence First, it means that the same file containing byte code instructions can be placed on any platform; atruntime the final stage of compilation can then be easily accomplished so that the code will run on thatparticular platform. In other words, by compiling to IL we obtain platform independence for .NET, inmuch the same way as compiling to Java byte code gives Java platform independence. Performance improvement IL is actually a bit more ambitious than Java bytecode. IL is always Just-In-Time compiled (known as JIT), whereas Java byte code was ofteninterpreted. One of the disadvantages of Java was that, on execution, the process of translating from Javabyte code to native executable resulted in a loss of performance. Instead of compiling the entire application in one go (which could lead to a slow start-up time), the JITcompiler simply compiles each portion of code as it is called (just-in-time). When code has been compiled.once, the resultant native executable is stored until the application exits, so that it does not need to berecompiled the next time that portion of code is run. Microsoft argues that this process is more efficientthan compiling the entire application code at the start, because of the likelihood that large portions of anyapplication code will not actually be executed in any given run. Using the JIT compiler, such code willnever be compiled.

毕业设计英文翻译

使用高级分析法的钢框架创新设计 1.导言 在美国,钢结构设计方法包括允许应力设计法(ASD),塑性设计法(PD)和荷载阻力系数设计法(LRFD)。在允许应力设计中,应力计算基于一阶弹性分析,而几何非线性影响则隐含在细部设计方程中。在塑性设计中,结构分析中使用的是一阶塑性铰分析。塑性设计使整个结构体系的弹性力重新分配。尽管几何非线性和逐步高产效应并不在塑性设计之中,但它们近似细部设计方程。在荷载和阻力系数设计中,含放大系数的一阶弹性分析或单纯的二阶弹性分析被用于几何非线性分析,而梁柱的极限强度隐藏在互动设计方程。所有三个设计方法需要独立进行检查,包括系数K计算。在下面,对荷载抗力系数设计法的特点进行了简要介绍。 结构系统内的内力及稳定性和它的构件是相关的,但目前美国钢结构协会(AISC)的荷载抗力系数规范把这种分开来处理的。在目前的实际应用中,结构体系和它构件的相互影响反映在有效长度这一因素上。这一点在社会科学研究技术备忘录第五录摘录中有描述。 尽管结构最大内力和构件最大内力是相互依存的(但不一定共存),应当承认,严格考虑这种相互依存关系,很多结构是不实际的。与此同时,众所周知当遇到复杂框架设计中试图在柱设计时自动弥补整个结构的不稳定(例如通过调整柱的有效长度)是很困难的。因此,社会科学研究委员会建议在实际设计中,这两方面应单独考虑单独构件的稳定性和结构的基础及结构整体稳定性。图28.1就是这种方法的间接分析和设计方法。

在目前的美国钢结构协会荷载抗力系数规范中,分析结构体系的方法是一阶弹性分析或二阶弹性分析。在使用一阶弹性分析时,考虑到二阶效果,一阶力矩都是由B1,B2系数放大。在规范中,所有细部都是从结构体系中独立出来,他们通过细部内力曲线和规范给出的那些隐含二阶效应,非弹性,残余应力和挠度的相互作用设计的。理论解答和实验性数据的拟合曲线得到了柱曲线和梁曲线,同时Kanchanalai发现的所谓“精确”塑性区解决方案的拟合曲线确定了梁柱相互作用方程。 为了证明单个细部内力对整个结构体系的影响,使用了有效长度系数,如图28.2所示。有效长度方法为框架结构提供了一个良好的设计。然而,有效长度方法的

大学毕业论文---软件专业外文文献中英文翻译

软件专业毕业论文外文文献中英文翻译 Object landscapes and lifetimes Tech nically, OOP is just about abstract data typing, in herita nee, and polymorphism, but other issues can be at least as importa nt. The rema in der of this sect ion will cover these issues. One of the most importa nt factors is the way objects are created and destroyed. Where is the data for an object and how is the lifetime of the object con trolled? There are differe nt philosophies at work here. C++ takes the approach that con trol of efficie ncy is the most importa nt issue, so it gives the programmer a choice. For maximum run-time speed, the storage and lifetime can be determined while the program is being written, by placing the objects on the stack (these are sometimes called automatic or scoped variables) or in the static storage area. This places a priority on the speed of storage allocatio n and release, and con trol of these can be very valuable in some situati ons. However, you sacrifice flexibility because you must know the exact qua ntity, lifetime, and type of objects while you're writing the program. If you are trying to solve a more general problem such as computer-aided desig n, warehouse man ageme nt, or air-traffic con trol, this is too restrictive. The sec ond approach is to create objects dyn amically in a pool of memory called the heap. In this approach, you don't know un til run-time how many objects you n eed, what their lifetime is, or what their exact type is. Those are determined at the spur of the moment while the program is runnin g. If you n eed a new object, you simply make it on the heap at the point that you n eed it. Because the storage is man aged dyn amically, at run-time, the amount of time required to allocate storage on the heap is sig ni fica ntly Ion ger tha n the time to create storage on the stack. (Creat ing storage on the stack is ofte n a si ngle assembly in structio n to move the stack poin ter dow n, and ano ther to move it back up.) The dyn amic approach makes the gen erally logical assumpti on that objects tend to be complicated, so the extra overhead of finding storage and releas ing that storage will not have an importa nt impact on the creati on of an object .In additi on, the greater flexibility is esse ntial to solve the gen eral program ming problem. Java uses the sec ond approach, exclusive". Every time you want to create an object, you use the new keyword to build a dyn amic in sta nee of that object. There's ano ther issue, however, and that's the lifetime of an object. With Ian guages that allow objects to be created on the stack, the compiler determines how long the object lasts and can automatically destroy it. However, if you create it on the heap the compiler has no kno wledge of its lifetime. In a Ianguage like C++, you must determine programmatically when to destroy the

电气工程及其自动化专业_外文文献_英文文献_外文翻译_plc方面

1、 外文原文 A: Fundamentals of Single-chip Microcomputer Th e si ng le -c hi p m ic ro co mp ut er i s t he c ul mi na ti on of both t h e de ve lo pm en t o f t he d ig it al co m pu te r an d th e i n te gr at ed c i rc ui t a rg ua bl y t h e to w m os t s ig ni f ic an t i nv en ti on s o f t he 20th c e nt ur y [1]. Th es e t ow ty pe s of ar ch it ec tu re a re fo un d i n s in g le -ch i p m i cr oc om pu te r. So m e em pl oy t he spl i t pr og ra m/da ta m e mo ry o f th e H a rv ar d ar ch it ect u re , sh ow n in Fi g.3-5A -1, o th ers fo ll ow t he p h il os op hy , wi del y a da pt ed f or ge n er al -p ur po se co m pu te rs a nd m i cr op ro ce ss o r s, o f ma ki ng n o log i ca l di st in ct ion be tw ee n p r og ra m an d d at a m e mo ry a s i n t he P r in ce to n ar ch ite c tu re , sh ow n i n F ig.3-5A-2. In g en er al te r ms a s in gl e -chi p m ic ro co mp ut er i s c h ar ac te ri ze d b y t h e i nc or po ra ti on o f a ll t he un it s of a co mp uter i n to a s in gl e d ev i ce , as s ho wn in Fi g3-5A -3. Fig.3-5A-1 A Harvard type Program memory Data memory CPU Input& Output unit memory CPU Input& Output unit

毕业论文5000字英文文献翻译

英文翻译 英语原文: . Introducing Classes The only remaining feature we need to understand before solving our bookstore problem is how to write a data structure to represent our transaction data. In C++ we define our own data structure by defining a class. The class mechanism is one of the most important features in C++. In fact, a primary focus of the design of C++ is to make it possible to define class types that behave as naturally as the built-in types themselves. The library types that we've seen already, such as istream and ostream, are all defined as classesthat is,they are not strictly speaking part of the language. Complete understanding of the class mechanism requires mastering a lot of information. Fortunately, it is possible to use a class that someone else has written without knowing how to define a class ourselves. In this section, we'll describe a simple class that we canuse in solving our bookstore problem. We'll implement this class in the subsequent chapters as we learn more about types,expressions, statements, and functionsall of which are used in defining classes. To use a class we need to know three things: What is its name? Where is it defined? What operations does it support? For our bookstore problem, we'll assume that the class is named Sales_item and that it is defined in a header named Sales_item.h. The Sales_item Class The purpose of the Sales_item class is to store an ISBN and keep track of the number of copies sold, the revenue, and average sales price for that book. How these data are stored or computed is not our concern. To use a class, we need not know anything about how it is implemented. Instead, what we need to know is what operations the class provides. As we've seen, when we use library facilities such as IO, we must include the associated headers. Similarly, for our own classes, we must make the definitions associated with the class available to the compiler. We do so in much the same way. Typically, we put the class definition into a file. Any program that wants to use our class must include that file. Conventionally, class types are stored in a file with a name that, like the name of a program source file, has two parts: a file name and a file suffix. Usually the file name is the same as the class defined in the header. The suffix usually is .h, but some programmers use .H, .hpp, or .hxx. Compilers usually aren't picky about header file names, but IDEs sometimes are. We'll assume that our class is defined in a file named Sales_item.h. Operations on Sales_item Objects

相关主题
文本预览
相关文档 最新文档