当前位置:文档之家› Course Test-F2

Course Test-F2

Course Test-F2
Course Test-F2

ACF2CT09(D)

AC29 – F2(1)

ACCA Fundamentals Level Paper F2

Management Accounting Course Test 1

DO NOT OPEN THIS PAPER UNTIL YOU ARE READY TO START UNDER EXAMINATION CONDITIONS

Test

Test 1

3

ALL TWENTY FOUR questions are compulsory and MUST be attempted

Please write your answer on lined paper with one answer per line

1Which of the following are part of the prime cost for a manufacturing company?

A Maintenance cost of a machine used in production

B Salary cost of a supervisor overseeing direct employees

C Cost of a canteen used by production employees

D Hire of specialist equipment for a particular job (2 marks)

2 During July 9,000 labour hours were worked at a cost of $14/hour in the production facility of Jones

Limited. Of these hours 6,500 were classified as direct labour: How should these costs be recorded in the accounts

A Dr Wages Control $126,000; Cr WIP $91,000; Cr Production Overhead $35,000

B Dr WIP $35,000; Dr Production Overhead $91,000; Cr Wages Control $126,000

C Dr WIP $126,000; Cr Wages Control $126,000

D Dr WIP $91,000; Dr Production Overhead $35,000; Cr Wages Control $126,000

(1 mark) 3 JM Co has recorded the following distribution costs during the last three months.

Month Volume Total

cost

units $

1 32,000 100,000

2 40,000 120,000

3 50,000 145,000

(2 marks) 4 A company operates a premium bonus system by which employees receive a bonus of 75% of the

time saved compared with a standard time allowance (at the normal hourly rate).

Details relating to employee A are shown below:

Employee A

Actual hours worked 42 hours

Hourly rate of pay $10

Output achieved 400 units of product Y

Standard time allowed (per unit of Y) 7 minutes

(2 marks)

Test 1

5

A company has an annual demand for 10,000 boxes per annum. The cost of one order is $3.50, the holding costs are 5% of the purchase price. The normal cost per box is $7.50, however a discount of 2% has been offered on orders of 500 boxes and above.

Calculate the total annual holding and ordering costs assuming 500 units were ordered each time: A $162 B $164 C $242

D $254 (2 marks)

The following information is to be used for questions 6 and 7

A scatter diagram shows the weekly total costs of production ($) in a certain factory plotted against the weekly output (units). A broadly linear pattern is evident, with r = 0.9. The regression equation is: COSTS = 1,500 + (15 × OUTPUT)

Fifty data points have been included in the analysis, with output ranging from 100 units to 1,000 units. Output next week is planned to be 500 units.

6

Read the following statements about estimates produced from this analysis. (i) Weekly fixed costs are approximately $1,500.

(ii) Variable costs are approximately $15 per unit on average. (iii)

Next week's production costs are likely to be about $9,000.

Which of these statements are correct, all other things being equal? A (i) and (ii) only B (i) and (iii) only C (ii) and (iii) only D (i), (ii) and (iii)

(2 marks)

7

Read the following statements. (i) There is very little correlation between weekly costs of production and production level. (ii) 90% of the variation in weekly costs is attributable to the quantity of output produced. (iii)

Given the information, any forecast using the regression equation is likely to be very unreliable.

Which of these statements is/are justified? A (ii) only B (i) and (iii) only C (ii) and (iii) only D None of them.

(2 marks)

Test 1

5

8 The table shows the total of Cost Y at different production levels of Product X:

Units of Product X Total Cost Y ($000)

50 60

100 60

150 60

200 90

250 90 What could have been the cause of the increase in cost?

A Increased fuel and maintenance costs for delivery vehicles

B Increased storage requirements

C Loss of discounts on raw materials

D Pay increase for direct labour (2 marks)

9 The labour cost graph below depicts:

A A piece-rate scheme with a minimum guaranteed wage.

B A straight piece-rate scheme.

C A straight time-rate scheme.

D A differential piece-rate scheme. (2 marks)

10 For a new project the probability of a profit of $230,000 is three times the probability of a profit of

$100,000. These are the only two possible outcomes. What is the expected profit?

A $132,500

B $172,500

C $187,100

D $197,500 (2 marks)

Test 1

11

The Utopian Hotel is developing a cost accounting system. Initially it has been decided to create four cost centres: Residential and Catering deal directly with customers while Housekeeping and Maintenance are internal service cost centres.

The management accountant has completed the initial overhead allocation and apportionment exercise and has derived the following total cost centre overheads.

Residential Catering Housekeeping Maintenance Total $ $ $ $ $ Total 85,333

68,287

50,370

23,010227,000Housekeeping works 70% for Residential and 30% for Catering, and Maintenance works 20% for Housekeeping, 30% for Catering and 50% for Residential.

will be: $

(2 marks)

12

Scooby employs two types of labour: skilled workers paid $20 per hour (considered to be direct workers) and semi-skilled workers paid $12 per hour (considered to be indirect workers).

The skilled workers have worked 30 hours of overtime this week, of which 10 hours were on a specific order at the customer's request, and the rest for general purposes. Overtime is paid at a rate of time and a half.

The semi-skilled workers have worked 45 hours of overtime, 15 hours of which were on a specific order at a customer's request, and the rest for general purposes. Overtime is again paid at time and a half.

What would be the total overtime pay considered to be a direct cost for this week?

(2 marks)

13

The demand for Puddles Ale, which costs $3.50 a gallon, is 2,500 gallons per month. It costs $15 to place an order and the cost of holding a gallon of ale in inventory for one year is 15c plus an interest cost equal to 10% of the purchase price.

The order quantity which minimises inventory cost is (to the nearest gallon):

gallons

(2 marks)

Test 1

7

14

Look at the following scatter diagram of the relationship between two variables X and Y.

A –1

B +1

C 0

D 10 (2 marks)

15

Which of the following situations could result in the graph above?

A Overtime

being

worked.

B A minimum wage rate being in force.

C Actual overheads being more than expected.

D The availability of quantity discounts for materials. (2 marks)

16 The management of a company is making a decision which could lead to just three possible outcomes

– ‘high’, ‘medium’ and ‘low’ levels of demand. Profit and expected value information are as follows:

Outcome Profit Profit x probability of outcome

$'000 '000

High 50 15

Medium 10 5

Low (30) (6)

What is the most likely profit outcome?

A $50,000

B $10,000

C ($30,000)

D $14,000 (2 marks)

$

Test 1

17 Which of the following are indirect expenses? I The cost of overtime worked specifically to complete a one-off project II The depreciation of a machine on an assembly line III Primary packing materials eg cartons and boxes

IV

The hire of maintenance tools or equipment for a factory

A I and IV

B II and IV

C I and III

D IV only (2 marks)

18

A company has to pay a $1 per unit royalty to the designer of a product which it manufactures and sells.

The royalty charge would be classified in the company's accounts as a: A Direct expense B Production overhead C Administrative overhead

(1 mark)

19 A company budgeted 8,500 hours at a rate of 3 hours per unit in May. At the end of May 9,000 units had been produced and 26,500 hours were worked and paid.

Calculate the labour efficiency and capacity ratios:

Efficiency

Capacity A 104%

98% B 106% 102% C 102% 104% D 98% 106%

(2 marks)

20

Depreciation on production equipment is: (i) Not a cash cost

(ii) Part of production overheads (iii) Part of prime cost

(iv)

Always calculated using a machine-hour rate

A (i) and (ii)

B (iii) and (iv)

C (i), (ii) and (iii)

D All of them (2 marks)

21

Which of the following item(s) might be a suitable cost unit within the credit control department of a company?

(i) Telephone expense

(ii) Cheque received and processed (iii) Customer account A (i) and (ii) B (ii) and (iii) C

All of them

(1 mark)

Test 1

9

22 Which one of the following would be classed as indirect labour?

A Machine operators in a company manufacturing washing machines

B A stores assistant in a factory store

C Plumbers in a construction company

D A committee in a firm of management consultants (2 marks)

23 A manufacturing firm has temporary production problems and overtime is being worked.

The amount of overtime premium contained in direct wages would normally be classed as which one of the following:

A Direct

expenses

B Production

overheads

C Direct

labour

costs

D Administrative

overheads (2 marks)

24 What type of cost is supervisor salary costs, where one supervisor is needed for every ten employees

added to the staff?

A A fixed cost

B A variable cost

C A step cost (1 mark)

End of Question Paper

Test

BPP House, Aldine Place, London W12 8AA Tel: 0845 0751 100 (for orders within the UK) Tel: +44 (0)20 8740 2211

Fax: +44 (0)20 8740 1184

https://www.doczj.com/doc/2012768156.html,/learningmedia

ACF2CT09(D)

AC29 – F2(1)

ACCA Fundamentals Level Paper F2

Management Accounting Course Test 1

Suggested solutions and guidance

Test

Test 1

3

Answers

1

D

Hire of specialist equipment for a particular job can be traced directly to cost units and is therefore a direct expense and a part of prime cost.

Options A, B and C are all indirect costs which cannot be traced directly to cost units. They would be classified as production overheads and are not a part of prime cost. (Chapter 2)

2

D

You need to learn the journals for cost allocation.

(Chapter 7)

3

Units

$ High 50,000 145,000 Low 32,000 100,000

18,000

45,000

Variable cost per unit =

000

,18000

,45$ = $2.50 per unit

Calculation of fixed costs (by substitution) $145,000 = Fixed costs + ($2.50 × 50,000) Fixed costs

= $145,000 – $125,000 = $20,000 Total costs for 42,500 units

= $20,000 + ($2.50 × 42,500)

= $126,250 (Chapter 3)

4

Standard time for actual output

= 7 minutes × 400 units = 2,800 minutes

=

60

800

,2hours = 46.67 hours

Time saved = (46.67 – 42) hours

= 4.67 hours × 75%

= 3.5 hours × $10 = $35 (Chapter 7)

5 A Total Ordering Costs = Number of orders x Cost per order = 10,000 / 500 x $3.50 = $70 Total Holding Costs = Average inventory x Annual holding cost of one unit

= 500 / 2 X )$7.50 x 98% x 5%) = $92

Total Ordering and Holding Costs = $70 + $92 = $162

(Chapter 6) 6 D All three statements are correct. Production costs = 1,500 + (500 × 15)

(Chapter 4)

7

D

None of the statements is justified. The r value of 0.9 is 'high' not 'low'. 81%, not 90%, of the

variation in weekly costs is due to output level. Forecasts are likely to be reliable, not unreliable. (Chapter 4) 8 B

Storage costs are fixed at $60,000 at production levels of 50,100 and 150 units of Product X. At a production level of 200 units of Product X, total cost increases in a 'step' to $90,000. The correct answer is therefore B. (Chapter 3)

Test 1

9 A

Note how the graph changes at the output level where piecework earnings exceed minimum

wage.

(Chapter 7) 10 D

If the probability of making a profit of $100,000 is ‘x’. Then the probability of making a profit of $230,000 is ‘ 3 x’ All probabilities must equal 1 – therefore x + 3x = 1

4x = 1 x = 0.25

Outcome x probability of outcome = Expected profit

$230,000 x 0.75 =

$172,500 $100,000 x 0.25 = $25,000 Expected profit

$197,500

(Chapter 4)

11

The total overhead for the Residential cost centre will be $135,318 Resi- House- Main- dential Catering keeping tenance Total

$

$ $ $

$ Initial allocation and apportionment

85,333 68,287 50,370 23,010

227,000

Reapportion maintenance (50:30:20) 11,505 6,903 4,602 (23,010) –

96,838 75,190 54,972 –

227,000 Reapportion housekeeping (70:30) 38,480 16,492 (54,972) – 135,318

91,682

227,000

(Chapter 8)

12

Direct cost

Indirect cost

Skilled workers

$ $ Specific overtime (10 × $20 × 1.5) 300 General overtime (20 × $20 × 1)

400 (20

× $20 × 0.5) 200

Semi-skilled workers Specific overtime (15 × $12 × 1.5) 270 General overtime (30 × $12 × 1.5)

540 740

(Chapter 7)

Test 1

5

13 EOQ

=

H 0

C D

C

Where

D = Annual demand = 12 × 2,500 = 30,000 gallons

Co = Cost of placing an order = $15

C H= Cost of holding 1 gallon for 1 year = $0.15 + ($3.50 × 10%) = $0.50

EOQ =

0.515

30,000

×

= 1,342 gallons (Chapter 6)

14 A The scattergraph shows perfect negative correlation which is represented by r = –1.

(Chapter 4) 15 D The availability of quantity discounts for materials. As more units are purchased the price per

unit falls. (Chapter 3) 16 B

Outcome Profit Profit

x

Probability of

Outcome

Probability

$,000 $,000

High 50

15 0.3

Medium 10 5 0.5

Low (30)

(6) 0.2

Probability = (Profit x Probability) / Profit

The most likely outcome is that with the highest probability – in this case the medium outcome

of $10,000 (Chapter 4) 17 B I is classed as direct labour.

III is classed as direct materials. (Chapter 2) 18 A Direct

expense

The royalty cost can be traced in full to the company's product, therefore it is a direct expense.

(Chapter 2) 19 C Efficiency Ratio = Standard Hours / Actual Hours = (9000 x 3hrs) / 26,500hrs x 100 = 102%

Capacity Ratio = Actual Hours / Budget Hours = 26,500hrs / (8500 x 3hrs) x 100 = 104%

(Chapter 7) 20 A Not a cash cost and part of production overheads

The depreciation on production equipment is an indirect expense incurred in the factory and is

therefore included in production overheads. (Chapter 2) 21 B Cheque received and processed and customer account

Telephone expense is a cost for the department, not a potential cost unit. (Chapter 2)

Test 1

22 B A stores assistant in a factory store

The stores assistant's wages cannot be charged directly to a product, therefore the stores assistant is part of the indirect labour force. (Chapter 2)

23 B Production overheads

Overtime premium is always classed as production overheads unless it is: worked at the

specific request of a customer to get his order completed; or worked regularly by a production department in the normal course of operations, in which case it is usually incorporated into the direct labour hourly rate. (Chapter 7)

24

C

A step cost

The cost described will increase in steps , remaining fixed at each step until another supervisor is required. Such a cost is known as a step cost. (Chapter 3)

BPP House, Aldine Place, London W12 8AA Tel: 0845 0751 100 (for orders within the UK) Tel: +44 (0)20 8740 2211

Fax: +44 (0)20 8740 1184

https://www.doczj.com/doc/2012768156.html,/learningmedia

科学计算器程序Java代码

科学计算器程序Java代码

MC:清除独立内存里的数字 MR:读出独立内存数字 MS:将显示数字保存到独立内存,并取代内存中原有数字 M+:将显示数字向独立内存累加 (独立内存是一个临时寄放数字的存储器,方便计算) CE:纠错键(CLEAR ERROR).输入数字有错,按它可以重新输入 C:表示清零,将计算器恢复到开机状态 功能举例: 源程序如下: import java.awt.BorderLayout;

import javax.swing.JRadioButtonMenuItem; import javax.swing.JTextField; public class Calucator extends JFrame { private JTextField tf; private JPanel panel1, panel2, panel3, panel4; private JMenuBar myBar; private JMenu menu1, menu2, menu3; private JMenuItem editItem1, editItem2, help1, help2, help3; private JRadioButtonMenuItem seeItem1, seeItem2;//单选框 private JCheckBoxMenuItem seeItem3;//复选框 private ButtonGroup bgb; private String back; private boolean IfResult = true, flag = false;

Java科学计算器程序代码

计算器布局显示: 功能举例: ①13+20=33 ②-7*14=-98:先输入7,再单击-/+将其变成负数,然后依次单击×号、14与= ③7!=5040 ④sin30°=0.5:先输入30,然后按下′″按钮转换成角度值,再按下sin即可显示结果 ⑤sqrt(4)=2:利用鼠标点击4后再点击sqrt按键即可显示结果 ⑥2*π=6.2832 …… 源程序如下: import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.text.DecimalFormat; import javax.swing.BorderFactory; import javax.swing.ButtonGroup; import javax.swing.JButton; import javax.swing.JCheckBoxMenuItem; import javax.swing.JFrame; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.JPanel; import javax.swing.JRadioButtonMenuItem; import javax.swing.JTextField;

科学计算器代码

Calculate.java /*这是一个计算类,用于普通运算中的各种运算,如2,8,10,16进制的符合运算,复合运算其原理用后缀表达式来实现*/ import java.util.*; import https://www.doczj.com/doc/2012768156.html,ng.Math; class Calculate {//两个内部类来实现数据的存储,如同数据结构中的栈 class operator { char data[]; int top; operator() { data = new char [50]; top = -1; } }; class operator1 { double data[]; int top; operator1() { data = new double [20]; top = -1; } }; public static double jiecheng(double number)//阶乘运算 { int number1 = (int)number; double j=1; for(int i=1;i<=number1;i++) j=j*i; return j; } String trans (char exp[],char postexp[])//后缀表达式的翻译函数 { int i=0,j=0;boolean m=true;//m用来监视表达式是不有非法的运算符连着输入 operator op = new operator(); while(exp[j]!='\0') { switch (exp[j]) { case '(': op.top++; op.data[op.top]=exp[j];

基于matlab的计算器编程附代码

1.需求分析 本次的实验要求是设计一个计算器,主要功能如下: (1)实现基本数学运算(加减乘除等),而且要能进行混合运算 (2)实现部分函数功能,如求平方根、求倒数等 (3)能实现小数运算 界面与标准计算器界面类似 根据要求以及以前的学习情况,决定使用matlab进行编程。Matlab强大的计算功能以及便捷的GUI设计,可以较为简便的实现所要求的功能。按照要求,数据输入和输出支持小数点,支持四则混合运算,决定使用如下几个数据进行分析:(1+3)*5 Sqrt(4) 1/2 Sin4 用以检验是否可以进行加减乘除四则运算、平方根、倒数、正弦的运算。 2.程序设计 M atlab的程序设计较为简便,用GUI设计出一个计算器的模型,然后系统会自动生成一个框架,在框架中,写入每一个按键对应的程序就可以实现功能。 3.调式分析 编程的过程中遇到的问题不是很多,基本就是找要实现各个功能的子程序,通过上网和去图书馆,加上自己的编写,终于实现了实验要求的功能。但是有一点很重要,matlab不支持中文,所以从路径到文件名必须是全英文的,不然就无法识别。此外,给每个按键命名也是很重要的,不然在生成的程序框架里面,就无法识别各个按键的作用,编写程序的时候也就无法做到一一对应。 4.使用说明 程序的使用比较简单,由于是可视化界面,直接打开matlab,然后建立一个GUI 工程,再打开生成的fig文件,就是一个计算器的界面,直接按照市面上卖的计算器的

方法,按键使用即可。 5.测试结果 计算结果为20 4sqrt=2 Sin4结果为 1/2=0.5 经过计算,这些结果均与实际结果相吻合,计算器的功能实现的较为完好。 6.心得体会 本次试验由于不限制语言,于是计算功能强大,操作简便的matlab变成了首选,matlab的GUI设计,操作是较为简单的,首先建立一个GUI工程,然后用可视化界面,

科学计算器源代码讲课教案

科学计算器源代码

package two; import java.awt.*; import javax.swing.*; import java.awt.event.*; import java.io.*; import java.util.*; public class calculator implements ActionListener { int count = 0; private static int a; JFrame frame = new JFrame("计算器"); JTextArea area = new JTextArea(); JTextField fieldshow = new JTextField("0"); JTextField fieldcalculator = new JTextField(); JPanel leftpanel = new JPanel(); JPanel rightpanel = new JPanel(); JPanel buttonpanel = new JPanel(); JPanel motionpanel = new JPanel(); JButton button1 = new JButton("1"); JButton button2 = new JButton("2"); JButton button3 = new JButton("3"); JButton button4 = new JButton("+"); JButton button5 = new JButton("c"); JButton button6 = new JButton("4"); JButton button7 = new JButton("5"); JButton button8 = new JButton("6"); JButton button9 = new JButton("-"); JButton button10 = new JButton("退格"); JButton button11 = new JButton("7"); JButton button12 = new JButton("8"); JButton button13 = new JButton("9"); JButton button14 = new JButton("*"); JButton button15 = new JButton("sin"); JButton button16 = new JButton("0"); JButton button17 = new JButton("+/-"); JButton button18 = new JButton("."); JButton button19 = new JButton("/"); JButton button20 = new JButton("="); JButton button21 = new JButton("保存");

科学计算器代码

using System; using System.Collections.Generic; using https://www.doczj.com/doc/2012768156.html,ponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace科学计算器 { public partial class Form1 : Form { protected double iNum1,into; protected char cOperator; protected bool bNumBegins; protected bool bDot; protected double iMem; public Form1() { InitializeComponent(); InitMembers(); } private void InitMembers() { iNum1 = 0.0; cOperator = '='; bNumBegins = true; bDot = false; } private void Numbers_Click(double i) { if (txtOutput.Text == "Error") { txtOutput.Text = "0"; } try { if (bNumBegins) { txtOutput.Text = i.ToString(); bNumBegins = false; } else { txtOutput.Text += i.ToString(); } double iCurrent = double.Parse(txtOutput.Text); } catch { txtOutput.Text = "Error"; InitMembers(); return; }

科学计算器程序Java代码

功能举例: 源程序如下: import import import import import import import import import import import import import import import import import import import public class Calucator extends JFrame { private JTextField tf; private JPanel panel1, panel2, panel3, panel4; private JMenuBar myBar; private JMenu menu1, menu2, menu3; private JMenuItem editItem1, editItem2, help1, help2, help3; private JRadioButtonMenuItem seeItem1, seeItem2;###");, new Dot(), ; addButton(panel2, "+", new Signs(), ; addButton(panel2, "tan", new Signs(), ; addButton(panel2, "%", new Signs(), ; addButton(panel2, "π", numActionListener, ; addButton(panel2, "e", numActionListener, ; addButton(panel2, "′″", new Signs(), ; addButton(panel2, "=", new Signs(), ; JButton btns = new JButton("计算器"); createLoweredBevelBorder()); false);rim()); (i)); }else if(str == "Backspace"){ if()) > 0){ if().length() > 1){ ().substring(0, ().length() - 1)); ength() > 2){ ().substring(0, ().length() - 1)); }else{

科学计算器源代码

package two; import java.awt.*; import javax.swing.*; import java.awt.event.*; import java.io.*; import java.util.*; public class calculator implements ActionListener { int count = 0; private static int a; JFrame frame = new JFrame("计算器"); JTextArea area = new JTextArea(); JTextField fieldshow = new JTextField("0"); JTextField fieldcalculator = new JTextField(); JPanel leftpanel = new JPanel(); JPanel rightpanel = new JPanel(); JPanel buttonpanel = new JPanel(); JPanel motionpanel = new JPanel(); JButton button1 = new JButton("1"); JButton button2 = new JButton("2"); JButton button3 = new JButton("3"); JButton button4 = new JButton("+"); JButton button5 = new JButton("c"); JButton button6 = new JButton("4"); JButton button7 = new JButton("5"); JButton button8 = new JButton("6"); JButton button9 = new JButton("-"); JButton button10 = new JButton("退格"); JButton button11 = new JButton("7"); JButton button12 = new JButton("8"); JButton button13 = new JButton("9"); JButton button14 = new JButton("*"); JButton button15 = new JButton("sin"); JButton button16 = new JButton("0"); JButton button17 = new JButton("+/-"); JButton button18 = new JButton("."); JButton button19 = new JButton("/"); JButton button20 = new JButton("="); JButton button21 = new JButton("保存"); JButton button22 = new JButton("复制"); JButton button23 = new JButton("清除"); StringBuffer S = new StringBuffer("");

通俗易懂版基于MFC科学计算器

2013/6/22 作者编写的科学强大的易懂的新手入门的科学计算器, 基于MFC编写的科学计算器 指导教师对课程设计的评定意见 搞要本课程设计是在基于对话框的应用程序中模拟一个计算器,本计算器可以进行十进制下的四则运算(加、减、乘、除)和四则混合运算,可以把十进制转化为二进制或十六进制,可以进行一些常用的函数运算(比如sin、cos、tan、cot、sqrt、ln等),还可以支持带“(”,“)”符号的表达式的计算。系统开发平台为Windows XP,程序设计设计语言采用Visual C++6.0,程序运行平台为Windows 98/2000/XP。程序通过调试运行,初步实现了设计目标。 关键词程序设计;计算器;C++; 1 引言 在现代社会中,计算器已经进入了每一个家庭,人们在生活和学习中经常需要使用到计算器,它的出现大大减少了人们在计算方面的工作量,可以说它在人们生活和学习中是不可缺少的。 1.1C++介绍 C++语言的主要特点表现在两个方面,一是全面兼容C语言,二是支持面向对象的程序设计方法[1]。 (1) C++是一个更好的C,它保持了C语言的优点,大多数的C程序代码略作修改或不作修改就可在C++的集成环境下调试和运行。这对于继承和开发当前

已在广泛的软件是非常重要的,可以节省大量的人力和物力。 (2) C++是一种面向对象的程序设计语言它使得程序的各个模块的独立性更强,程序的可读性和可移植性更强,程序代码的结构更加合理,程序的扩充性更强。这对于设计、编制和调试一些大型的软件尤为重要。 (3) C++集成环境不仅支持C++程序的编译和调试,而且也支持C程序的编译和调试。通常,C++程序环境约定:当源程序文件的扩展名为c.时,则为C 程序;而当源程序文件的扩展名为cpp.时,则为C++程序。 (4) C++语句非常简练,对语法限制比较宽松,因此C++语法非常灵活。其优点是给用户编程带来书写上的方便。其缺点是由于编译时对语法限制比较宽松,许多逻辑上的错误不容易发现,给用户编程增加了难度。 3以下是详尽的代码

C语言编写的计算器源代码

C语言计算器源代码 #include /*DOS接口函数*/ #include /*数学函数的定义*/ #include /*屏幕操作函数*/ #include /*I/O函数*/ #include /*库函数*/ #include /*变量长度参数表*/ #include /*图形函数*/ #include /*字符串函数*/ #include /*字符操作函数*/ #define UP 0x48 /*光标上移键*/ #define DOWN 0x50 /*光标下移键*/ #define LEFT 0x4b /*光标左移键*/ #define RIGHT 0x4d /*光标右移键*/ #define ENTER 0x0d /*回车键*/ void *rar; /*全局变量,保存光标图象*/ struct palettetype palette; /*使用调色板信息*/ int GraphDriver; /* 图形设备驱动*/ int GraphMode; /* 图形模式值*/ int ErrorCode; /* 错误代码*/ int MaxColors; /* 可用颜色的最大数值*/ int MaxX, MaxY; /* 屏幕的最大分辨率*/ double AspectRatio; /* 屏幕的像素比*/ void drawboder(void); /*画边框函数*/ void initialize(void); /*初始化函数*/ void computer(void); /*计算器计算函数*/ void changetextstyle(int font, int direction, int charsize); /*改变文本样式函数*/ void mwindow(char *header); /*窗口函数*/ int specialkey(void) ; /*获取特殊键函数*/ int arrow(); /*设置箭头光标函数*/ /*主函数*/ int main() { initialize();/* 设置系统进入图形模式*/ computer(); /*运行计算器*/ closegraph();/*系统关闭图形模式返回文本模式*/ return(0); /*结束程序*/ } /* 设置系统进入图形模式*/ void initialize(void) { int xasp, yasp; /* 用于读x和y方向纵横比*/

java课程设计-模拟科学计算器

JAVA课程设计说明书 题目:模拟科学计算器 姓名: 学号: 班级:网络工程11-2 山东科技大学 2013年11月7日

目录 1 课设任务及要求 (3) 1.1课设任务 (3) 1.2设计要求 (3) 2 需求分析 (2) 2.1 设计背景 (2) 2.2 需求获取 (3) 2.3 程序功能图 (4) 3 设计思路 (4) 3.1 界面布局 (4) 3.2 类的定义 (5) 3.3变量的定义 (5) 4 详细设计 (6) 4.1整体概述 (6) 4.2 误操作处理 (7) 4.3流程图和结构图 (8) 5 系统调试 (11) 5.1 程序界面 (11) 5.2 运行界面 (11) 6 心得与体会 (15) 7 参考文献 (16) 8 附录 (16)

1 课设任务及要求 1.1课设任务: 要求:界面模拟Windows中的计算器程序。 实现基本数学运算、函数等功能:加、减、乘、除、阶乘、正弦、余弦和指数运算。 实现要点:添加相关组件并进行按钮事件处理。 要求提交Application和Applet两个版本的程序。 1.2设计要求 ①设计的java计算器应用程序可以完成加法、减法、乘法、除法和取余运算,和cos,sin,tan等三角函数功能以及阶乘和指数等运算,且有小数点、正负号、求倒数、退格和清零功能。具体可参考windows附件下的计算器 ②课程设计使用Eclipse4.2等作为程序编译和运行测试的开发平台,采用JDK-7u25作为java开发环境,使用Microsoft Office Visio 2007作为绘图工具。

③认真按时完成课程设计报告,制作演讲PPT,积极报名上讲台向大家演示和讲解自己的程序。提交打印版的报告以及电子版的原稿和Application和Applet两个版本的程序代码。 2 需求分析 2.1 设计背景 本程序是老师提供的几个课程设计题目中比较中等的题目。要求实现模拟的科学计算器功能,主要包括加减乘除四则运算和阶乘,三角函数以及指数的运算。具体的功能我参考了Windows7下的计算机小程序,并根据其界面设计了java小程序界面,根据其功能对自己设计的计算器小程序进行了功能的适当增加与修改。在实现了课程设计题目要求的基础上,自己又增添了对数函数,幂函数,三角函数,取余等我们常用到的功能比较简单的函数。由于本函数涉及的函数以及按键数目较多,故没有采用面向对象的设计方法,没有对每个功能封装成函数调用,而是针对每个按键的动作事件直接采用了算法的编写。最终实现了全部的功能,但是由于时间有限,许多功能没有坐到很到位的优化,或许还存在着许多了漏洞,欢迎老师和同学的批评指正,我一定会

科学计算器课程设计报告C课程设计

计算机科学与技术学部 C++课程设计 题目科学计算器 学部计算机科学与技术 班级计科1103 指导教师李军 姓名刘明 学号 11430421817667

2012年6月27日

摘要 计算器的产生和发展是建立在电子计算机基础之上的。硬件方面,自1946年第一台电子计算机诞生以来,计算机技术的发展可谓日新月异,从庞大的只能在实验室里供研究使用的计算机到如今能适应不同环境满足不同需求的各种各样的计算机;运算速度从每秒几千次到每秒几百亿次;处理器从焊有上百万个电子管的大的惊人的电子板到只有指甲大小的集成电路;现在计算机在硬件方面的发展已达到了每三个月更新换代一次的惊人速度。软件方面,也已从机器语言、汇编语言、高级语言发展到现如今的第四代语言——非结构化、面向对象、可视化的语言。 在这个计算器里面,我们实现了简单的四则运算以及更高功能的科学计算,它的外观简洁美观,使人们能快捷简单的操作。能准确的得到计算结果,大大减少了数字计算所需要的时间,为人们的生活带来便利。此系统在Windows 7环境下,使用VC++ 6.0进行编写。 简单计算器包括双目运算和单目运算功能,双目运算符包含基本的四则运算及乘幂功能,单目运算符包含正余弦,对数,开方,阶乘,倒数,进制转换等运算。可对其输入任意操作数,包括小数和整数及正数和负数进行以上的所有运算并能连续运算。并且包含清除,退格功能等。我们所做的计算器其功能较Windows 7下的计算器还是很不够多,没有其菜单的实现功能项,没有其小巧的标准计算器。 关键词:计算器;运算;VC++等

课程设计任务分配表: 表1 分配信息表 课程设计成绩表: 表2 成绩表

VB简单计算器编程代码(附图)

Public sum As Double Public k As String "定义全局变量 Private Sub Command1_Click(Index As Integer) Select Case Index Case 1 Text1.Text = Text1.Text & 1 Case 2 Text1.Text = Text1.Text & 2 Case 3 Text1.Text = Text1.Text & 3 Case 4 Text1.Text = Text1.Text & 4 Case 5 Text1.Text = Text1.Text & 5 Case 6 Text1.Text = Text1.Text & 6 Case 7 Text1.Text = Text1.Text & 7 Case 8 Text1.Text = Text1.Text & 8 Case 9 Text1.Text = Text1.Text & 9 Case 0 Text1.Text = Text1.Text & 0 Case 10 Text1.Text = Text1.Text & "."

End Select End Sub Private Sub Command2_Click() sum = Text1.Text Text1.Text = "" k = "+" End Sub Private Sub Command3_Click() sum = Text1.Text Text1.Text = "" k = "-" End Sub Private Sub Command4_Click() sum = Text1.Text Text1.Text = "" k = "*" End Sub Private Sub Command5_Click() sum = Text1.Text Text1.Text = "" k = "/" End Sub Private Sub Command6_Click() Dim a As Double a = Text1.Text If k = "+" Then sum = sum + a Text1.Text = sum ElseIf k = "-" Then sum = sum - a Text1.Text = sum ElseIf k = "*" Then sum = sum * a Text1.Text = sum ElseIf k = "/" Then sum = sum / a Text1.Text = sum End If End Sub

C++_MFC计算器编程课程设计--MFC编程科学计算器

C++_MFC计算器编程课程设计--MFC编程科学计算器

中南大学 本科生课程设计(实践)设计报告(程序设计基础) 题目MFC编程科学计算器学生学号1104120502 学生姓名郭斌繁 指导教师蔡旭晖 学院交通运输工程学院 专业班级交通运输类1205班 计算机基础教学实验中心 2013 年 7 月 1 日

程序设计(C++)实践报告 1.引言 C++语言的主要特点表现在两个方面,一是全面兼容C 语言,二是支持面向 对象的程序: (1) C++是一个更好的C,它保持了C 语言的优点,大多数的C 程序代码略作修改或不作修改就可在C++的集成环境下调试和运行。这对于继承和开发当前已在广泛的软件是非常重要的,可以节省大量的人力和物力。 (2) C++是一种面向对象的程序设计语言它使得程序的各个模块的独立性更强,程序的可读性和可移植性更强,程序代码的结构更加合理,程序的扩充性更强。这对于设计、编制和调试一些大型的软件尤为重要。 (3) C++集成环境不仅支持C++程序的编译和调试,而且也支持C 程序的编译和调试。通常,C++程序环境约定:当源程序文件的扩展名为c.时,则为C 程序;而当源程序文件的扩展名为cpp.时,则为C++程序。 (4) C++语句非常简练,对语法限制比较宽松,因此C++语法非常灵活。其优点是给用户编程带来书写上的方便。其缺点是由于编译时对语法限制比较宽松,许多逻辑上的错误。 次课程设计主要在运算过程中,如果通过计算器来完成,就会减少计算量,该程序即可以在简单计算器键面下进行简单运算,也可以在科学计算器键面下进行高级的科学计算。并且可以分别计算弧度、角度的三角函数的计算等较为复杂的运算。 (1).设计目标 利用MFC程序开发工具设计一款可以进行简单计算及部分科学计算的计算器。在设计当中将综合“面向对象程序设计与结构化程序设计”的思想方法和知识点,编制一个小型的应用程序系统。通过此设计进一步提高自己的动手能力,并能使自己清楚的知道开发一个应用程序的思想、方法和流程。 (2).选题分析 此次实践所选题目中除了简单的加减乘除运算程序之外还包括了余弦函数、

科学计算器程序Java代码

MC:清除独立内存里的数字 MR:读出独立内存数字 MS:将显示数字保存到独立内存,并取代内存中原有数字M+:将显示数字向独立内存累加 (独立内存是一个临时寄放数字的存储器,方便计算) CE:纠错键(CLEAR ERROR).输入数字有错,按它可以重新输入C:表示清零,将计算器恢复到开机状态 功能举例: 源程序如下: import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.text.DecimalFormat; import javax.swing.BorderFactory; import javax.swing.ButtonGroup; import javax.swing.JButton; import javax.swing.JCheckBoxMenuItem; import javax.swing.JFrame; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem;

import javax.swing.JPanel; import javax.swing.JRadioButtonMenuItem; import javax.swing.JTextField; public class Calucator extends JFrame { private JTextField tf; private JPanel panel1, panel2, panel3, panel4; private JMenuBar myBar; private JMenu menu1, menu2, menu3; private JMenuItem editItem1, editItem2, help1, help2, help3; private JRadioButtonMenuItem seeItem1, seeItem2;//单选框 private JCheckBoxMenuItem seeItem3;//复选框 private ButtonGroup bgb; private String back; private boolean IfResult = true, flag = false; private String oper = "="; private double result = 0; private Num numActionListener; private DecimalFormat df; public Calucator(){ super("科学计算器");//设置标题栏 df = new DecimalFormat("#.####");//保留四位小数 this.setLayout(new BorderLayout(10, 5)); panel1 = new JPanel(new GridLayout(1, 3, 10, 10)); panel2 = new JPanel(new GridLayout(5, 6, 5, 5));//5行6列 panel3 = new JPanel(new GridLayout(5, 1, 5, 5)); panel4 = new JPanel(new BorderLayout(5, 5)); /** *菜单栏 */ myBar = new JMenuBar(); menu1 = new JMenu("编辑(E)"); menu2 = new JMenu("查看(V)"); menu3 = new JMenu("帮助(H)"); menu1.setFont(new Font("宋体", Font.PLAIN, 12)); menu2.setFont(new Font("宋体", Font.PLAIN, 12)); menu3.setFont(new Font("宋体", Font.PLAIN, 12)); /**

科学计算器程序Java代码

源程序如下: import import import import import import import import import import import ja import import import import import import import import javax.swing.JTextField; public class Calucator extends JFrame { private JTextField tf; private JPanel panel1, panel2, panel3, panel4; private JMenuBar myBar; private JMenu menu1, menu2, menu3; private JMenuItem editItem1, editItem2, help1, help2, help3; private JRadioButtonMenuItem seeItem1, seeItem2;//单选框 private JCheckBoxMenuItem seeItem3;//复选框 private ButtonGroup bgb; private String back; private boolean IfResult = true, flag = false; private String oper = "="; private double result = 0; private Num numActionListener; private DecimalFormat df; public Calucator(){ super("科学计算器");//设置标题栏 df = new DecimalFormat("#.####");//保留四位小数 this.setLayout(new BorderLayout(10, 5)); panel1 = new JPanel(new GridLayout(1, 3, 10, 10)); panel2 = new JPanel(new GridLayout(5, 6, 5, 5));//5行6列 panel3 = new JPanel(new GridLayout(5, 1, 5, 5)); panel4 = new JPanel(new BorderLayout(5, 5));

Java科学计算器程序代码

计算器布局显示: 功能举例: ①13+20=33 ②-7*14=-98:先输入7,再单击-/+将其变成负数,然后依次单击×号、14与= ③7!=5040 ④sin30°=0.5:先输入30,然后按下′″按钮转换成角度值,再按下sin即可显示结果 ⑤sqrt(4)=2:利用鼠标点击4后再点击sqrt按键即可显示结果 ⑥2*π=6.2832 …… 源程序如下: importjava.awt.BorderLayout; importjava.awt.Color; import java.awt.Dimension; import java.awt.Font; importjava.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.text.DecimalFormat; importjavax.swing.BorderFactory; import javax.swing.ButtonGroup; import javax.swing.JButton; import javax.swing.JCheckBoxMenuItem; import javax.swing.JFrame; import javax.swing.JMenu; import javax.swing.JMenuBar; importjavax.swing.JMenuItem; importjavax.swing.JPanel; importjavax.swing.JRadioButtonMenuItem; importjavax.swing.JTextField;

北邮JAVA第三次作业科学计算器(附源代码)

JA V A第三次作业 选题:科学计算器 一、设计思路 (1)布局 1.数字键盘有0~9和小数点 2.符号键盘有+?×÷,幂,开方,lg,ln 3.功能按键有清屏(AC)和删除(Del) (2)计算器流程状态转移图 设定的标志位和变量有: boolean numflag = false; //标志:是否输入数字 boolean opflag = false; //标志:是否输入运算操作符 String txt = null; //显示到文本框里的字符串 String num_txt = ""; //当前操作数的字符串形式 String op = " "; //存放输入的运算操作符 num1 = 0; //第一个操作数 num2 = 0; //第二个操作数 private BigDecimal big_num1 = new BigDecimal(Double.toString(0));//解决浮点数的精度丢失问题 private BigDecimal big_num2 = new BigDecimal(Double.toString(0)); 1.关于操作数

操作数为输入数字时会改变的数,有num1和num2。按下运算符和控制字符,会设定当前下在键入的操作数,由opflag控制,false表示正在操作num1,true表示正在操作num2。 初始状态下的操作数为num1。按下AC会恢复操作数为初始状态num1。 按Delete、开方、lg、ln不会改变当前的操作数。其中后三者只对num1有效。 其他的运算符和控制符都会使操作数为num2。 2.计算器的状态框图 其 中 按 下 结 果 存 入 num1的结果上处理。 在上述图中没有画出的还有: -任何时候按下AC,都会回到初始状态 -任何时候按下Del,都会把当前的操作数回删一位 二、程序截图 按下9+3.3,再按下+0.25

风铃科学计算器程序代码(vb)

风铃计算器程序代码 青春风铃 西南交通大学

Dim sum As Double, Expr, A, B, D, Cha As String Dim Time As Integer Dim leftbracket, rbracket As Integer Dim Bo1, Bo2, Sto As Boolean

Public Function Fact(n As Long) As Double If n > 0 Then If n = 1 Then Fact = 1 Else Fact = n * Fact(n - 1) End If ElseIf n = 0 Then Fact = 1 Else If n = -1 Then Fact = -1 Else Fact = n * Fact(n + 1) End If End If End Function Private Function leftfind(ByV al Expr As String, Where As Long) As String Dim i, leftbracket, rbracket As Integer Dim numl As String If Mid(Expr, Where - 1, 1) = ")" Then '-------------左有括号 For i = Where To 1 Step -1 If Mid(Expr, i, 1) = ")" Then rbracket = rbracket + 1 ElseIf Mid(Expr, i, 1) = "(" Then lbracket = lbracket + 1 End If If lbracket = rbracket And lbracket <> 0 Then numl = Mid(Expr, i, Where - i) Exit For End If Next i Else '-------------无括号 For i = Where - 1 To 1 Step -1 numl = Mid(Expr, i, 1) If numl = "+" Or numl = "-" Or numl = "*" Or numl = "/" Or numl = "(" Then numl = Mid(Expr, i + 1, Where - i - 1) Exit For End If If i = 1 Then numl = Mid(Expr, 1, Where - 1) Exit For

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