Free Essay

Assignment 1

In:

Submitted By Lubanzi14
Words 1986
Pages 8
Concurrency in C+
+

1

Assignment 1

These questions requires the use of C+ which means compiling the program with the u++ command, including
+,
uC++.h as the first include file in each translation unit, and replacing routine main with member uMain::main .
1. Write a semi-coroutine with the following public interface (you may only add a public destructor and private members): _Coroutine FloatConstant { public: enum status { MORE, GOOD, BAD }; // possible status private: status stat;
// current status of match char ch;
// character passed by cocaller void main();
// coroutine main public: status next( char c ) { ch = c;
// communication in resume(); // activate return stat;
// communication out
}
};

which verifies a string of characters corresponds to a C+ floating-point constant described by:
+
floating-constant : signÓÔØ fractional-constant exponent-part ÓÔØ floating-suffixÓÔØ signÓÔØ digit-sequence exponent-part floating-suffixÓÔØ fractional-constant : digit-sequenceÓÔØ “.” digit-sequence digit-sequence “.”
“e” “E” signÓÔØ digit-sequence exponent-part : sign : “+” “-” digit-sequence : digit digit-sequence digit floating-suffix : “f” “l” “F” “L” digit : “0” “1” “2” “3” “4” “5” “6” “7” “8” “9”
(Where XÓÔØ means X ¯ and ¯ means empty.) In addition, there is a maximum of 16 digits for the mantissa
(non-exponent digits) and 3 digits for the characteristic (exponent digits). For example, the following are valid
C/C+ floating-point constants:
+
123.456
-.099
+555.
2.7E+1
-3.555E-12

After creation, the coroutine is resumed with a series of characters from a string (one character at a time). The coroutine returns a status for each character:

¯ MORE means continue sending characters, may yet be a valid string of the language,
¯ GOOD means the characters form a valid floating-point constant but more characters can be sent (e.g., 1.,
.1)
¯ BAD means the last character resulted in a string that is not a floating-point constant.
Except as otherwise noted, the content of this presentation is licensed under the Creative Commons Attribution 2.5 License.

Concurrency in C+
+

2

After the coroutine returns a value of GOOD and the string is complete, the next character passed to the coroutine returns a value of BAD. After the coroutine returns a value of BAD, it must terminate; sending more characters to the coroutine after this point is undefined.
Write a program floatconstant that checks if a string is in a floating-point constant. The shell interface to the floatconstant program is as follows: floatconstant [ infile ]

(Square brackets indicate optional command line parameters, and do not appear on the actual command line.)
If no input file name is specified, input comes from standard input. Output is sent to standard output. For any specified command-line file, check it exists and can be opened. You may assume I/O reading and writing do not result in I/O errors.
The program should:

¯ read a line from the file,
¯ create a FloatConstant coroutine,
¯ pass characters from the input line to the coroutine one at time while the coroutine returns MORE or
GOOD,
¯ stop passing characters when there are no more or the coroutine returns BAD,
¯ terminate the coroutine,
¯ print out result information, and
¯ repeat these steps for each line in the file.
Assume a valid floating-point constant starts at the beginning of the input line, i.e., there is no leading whitespace.
If the end of line is reached while the coroutine is returning MORE, the text is not a floating-point constant.
If the end of line is reached while the coroutine is returning GOOD, the text is a floating-point constant. If the coroutine returns BAD, the text is not a floating-point constant. For every non-empty input line, print the line, how much of the line is parsed, and the string yes if it is a valid floating-point constant and the string no otherwise; print an appropriate warning for an empty input line (i.e., a line containing only ’\n’). The following is some example output:
"+1234567890123456." : "+1234567890123456." yes
"+12.E-2" : "+12.E-2" yes
"-12.5" : "-12.5" yes
"12." : "12." yes
"-.5" : "-.5" yes
".1E+123" : ".1E+123" yes
"-12.5F" : "-12.5F" yes
"" : Warning! Blank line.
"a" : "a" no
"+." : "+." no
" 12.0" : " " no -- extraneous characters "12.0"
"12.0 " : "12.0 " no -- extraneous characters " "
"1.2.0a" : "1.2." no -- extraneous characters "0a"
"0123456789.0123456E-0124" : "0123456789.0123456" no -- extraneous characters "E-0124"

See the C library function isdigit(c), which returns true if character c is a digit.
2. Write a semi-coroutine that filters a stream of text. The filter semantics are specified by command-line options.
This program is logically divided into 3 parts, a reader, a filter (optional), and a writer. The reader and writer are implemented as single coroutines. The filter is implemented as a sequence of coroutines. The coroutines are joined together in a pipeline such that the reader is at the input end of the pipeline, the filter comprises the middle of the pipeline, and the writer is at the output end of the pipeline. Control passes from the reader to the filter to the writer, eventually returning back to the reader. All these coroutines are semi-coroutines.
(In the following, you may not add, change or remove members from a public interface; you may add a destructor and/or private and protected members.)

Concurrency in C+
+

3

Each filter must inherit from the abstract class Filter:
_Coroutine Filter { protected: static const unsigned char end_filter = ’\377’; unsigned char ch; public: void put( unsigned char c ) { ch = c; resume(); }
};

which ensures each filter has a put routine that can be called to transfer a character along the pipeline.
The reader reads characters from the specified input file and passes these characters to the first coroutine in the filter: _Coroutine Reader : public Filter { public: Reader( istream &i, Filter &f );
};

(No coroutine calls the put routine of the reader; all other coroutines have their put routine called.) The reader constructor is given a stream object from which it reads characters, and a filter object that it passes one character at a time from the input. The filter object must therefore be created before the reader object.
The writer is passed characters from the last coroutine in the filter pipeline and writes these characters to the specified output file:
_Coroutine Writer : public Filter { public: Writer( ostream &o );
};

All other filters have the following interface:
_Coroutine filter-name : public Filter { public: filter-name( Filter &f, . . . );
};

where “. . .” is any additional information needed by the filter.
The pipeline is built by uMain from writer to reader, in reverse order to the data flow. Each newly created coroutine is passed to the constructor of its predecessor coroutine in the pipeline. Control then passes to the reader, beginning the flow of data and control from the reader through the filters to the writer. Specifically, when the reader is created at the head of the pipeline, it starts reading characters and passing them to the first filter coroutine in the pipeline (i.e., the first filter on the command line if there is one) by calling the filter’s inherited put members. Each coroutine of the filter is passed characters from the previous coroutine in the pipeline, possibly performing some transformations, and possibly passing characters to the next coroutine in the pipeline. All characters are passed through the pipeline, including control characters (e.g., \n, \t). When the reader reaches end-of-file, it passes the sentinel character ’\377’ through the pipeline and then terminates.
Similarly, each coroutine along the filter must pass the sentinel character through the pipeline and then terminate.
The writer does not print the sentinel character. The reader coroutine can read characters one at a time or in groups, it makes no difference. The writer coroutine can write characters one at a time or in groups, it makes no difference. Filter options are passed to the program via command line arguments. For each filter option, create a coroutine that becomes part of the pipeline. If no filter options are specified, then the output should simply be an echo of the input from the reader to the writer. Assume all filter options are correctly specified and from the list given below, i.e., no error checking is required on the filter options. Hint: scan the command line left-to-right to locate

Concurrency in C+
+

4

and remember the position of each option, and then scan the option-position information right-to-left (reverse order) to create the filters with their specified arguments.
The filter options that must be supported are:
-w The white space option removes all blanks from the beginning and end of lines, and collapses multiple blank

spaces within a line into a single blank space. This option does not affect other white-space characters, such as tab, ’\t’, and newline, ’\n’.
-s If the first non-whitespace character (space, tab, newline are whitespace) after a period, question mark, or exclamation point is a lower case letter, the sentence option changes the letter to upper case. In other words, this option attempts to capitalize the first letter of every sentence. You must deal with the special case of capitalizing the first letter in the pipeline. This case is special because there is no preceding punctuation character. -e key The encrypt option uses key to encrypt the stream. Each byte in the stream is exclusive-or’ed (xor) with successive characters in the key, and the resulting byte is passed along. When the end of key is reached, cycle back to the beginning of key and continue, e.g.:

input file

a

b

c

xor xor xor

3 char. key

S

G

output file

2

%

move key over and encrypt next 3 chars.

J

)

This encryption scheme is reversible, so that encrypting an encrypted file produces the original data. Assume -e and key are separated by spaces, and spaces cannot occur in key. There should be no limit on the length of key.
-h The hex dump option replaces each character in the stream with a string displaying the character’s hex value.
For example, the character ’a’ would be replaced with the string 61, and the character ’0’ (zero) would be replaced with the string 30. The hex values must be generated with the necessary spacing and newlines to look like the following:
7257
2065
4d50
6d50

7469
6874
4920
7473

2065
7461
760a
6964

2061
6220
696f
5c6e

6f63 6f72
6765 6e69
2064 7267
282a

7475 6e69
3a73 2e0a
6d61 616d

Spacing among groups of hex digits is one space, then three spaces, etc. Note, it is possible to convert a character to its hexadecimal value using a simple, short expression.
In addition, design, implement and document one other filter operation that might be useful.
The order in which filter options appear on the command line is significant, i.e., the left-to-right order of the filter options on the command line is the first-to-last order of the filter coroutines. As well, a filter option may appear more than once in a command. Each filter option should be constructed without regard to what any other filters do, i.e., there is no communication among filters using global variables; all information is passed using member put.
The executable program is to be named filter and has the following shell interface: filter [ -filter-options ... ] [ infile [outfile] ]

(Square brackets indicate optional command line parameters, and do not appear on the actual command line.) If no input file name is specified, input from standard input and output to standard output. If no output file name is specified, output to standard output. For any specified command-line file, check it exists and can be opened.
You may assume I/O reading and writing do not result in I/O errors.
NOTE: the routine names read and write are used by the UNIX operating system and cannot be used as routine names in your program.

Similar Documents

Free Essay

Mat222 Week 1 Assignment.

...Solving Proportions MAT222 Week 1 Assignment September 22, 2014 Solving Proportions Solving for a proportion can be used within numerous real-world problems, such as finding the population of an area. Conservationists are able to predict the population of bear’s in their area by comparing information collected from two experiments. In this problem, 50 bears in Keweenaw Peninsula were tagged and released so conservationists could estimate the bear population. One year later, the conservationist took random samples of 100 bears from the same area, proportions are able to be used in order to determine Keweenaw Peninsula’s bear population. “To estimate the size of the bear population on the Keweenaw Peninsula, conservationists captured, tagged, and released 50 bears. One year later, a random sample of 100 bears included only 2 tagged bears. What is the conservationist’s estimate of the size of the bear population (Dugolpolski, 2012)?” In order to figure the estimated population, some variables need to first be defined and explain the rules for solving proportions. The ratio of originally tagged bears to the entire population is (50/x). The ratio of recaptured tagged bears to the sample size is (2/100). 50x=2100 is how the proportion is set up and is now ready to be solved. Cross multiplication is necessary for this problem. The extremes are (100) and (50). The means are (x) and (2). 100(50)=2x New equation, and now solve for (x). 50002=2x2 Divide both...

Words: 608 - Pages: 3

Free Essay

Mat222 Week 1 Assignment

...originally tagged bears to the whole population is equal to the ratio of recaptured tagged bears to the size of the sample. The ratio of originally tagged bears to the whole population is 50X The ration of recaptured tagged bears to the sample size is 2100 50X=2100 This is the proportion set up and ready to solve. I will cross multiply setting the extremes equal to the means. 10050=2x 100and 50 are the extremes, while X and 2 are the means. 50002=2x2 Divide both sides by 2 X = 2500 The bear population on the Keweenaw Peninsula is around 2500 bears. The second problem for assignment one week one I am asked to solve the below equation for y. The first thing I notice is that a single fraction (ratio) on both sides of the equal sign so basically it is a proportion which can be solved by cross multiplying the extremes and the means. y-1x+3=-34 Is the equation I am asked to solve. 3y-1=-3x-4 The result of the cross multiplying. 3y-3=-3x+12 Distribute 3 on the left side and -3 on the right. 3y-3+3=-3x+12+3 Subtract 3 from both sides. 3y=-3x+15 3y3=-3x3+153 Divide both sides by 3 y=-x+5 This is a linear equation in the form of y=mx+b. This equation is in its simplest form. I like how we can take just a couple of numbers from a word equation and put it in an order that will help us solve many estimates we may come...

Words: 340 - Pages: 2

Premium Essay

Student

...COMP101 – Problem Solving with Computing Homework - WEEK 2 [30 points] This is a review of some of the material from Chapter 2 and lectures from class. No credit for answers that are copies or near verbatim transcripts – please use your own words1 and document sources where appropriate. 1 This will apply to all assignments in this class. Answer the following questions: Chapter 2 1. Short Answers [1 point each, 2 points total] 1. What does a professional programmer usually do first to gain an understanding of a problem? The first thing that a professional programmer usually do first to gain an understanding of a program is to closely relate customer (Interview ) to inquire or gather information about the problem. 2. What two things must you normally specify in a variable declaration? The two things normally specified in a variable declaration are the variable type and identifier. 2. Algorithms / Pseudocode [1 point each, 5 points total] 1. Design an algorithm that prompts the user to enter his or her height and stores the user’s input in a variable named height. Declare height Display “Enter Your Height” Input Height Display “Height” 2. Write assignment statements that perform the following operations with the variables a and b. - Adds 2 to a and stores the result in b. - Subtracts 8 from b and stores the result in a Set b=2+a Set a=b-8 3. Write a pseudocode statement that declares the variable cost so it can hold real numbers. Floating...

Words: 1823 - Pages: 8

Free Essay

Mobile Service Provider

...RE3R02B32 PART- A 1. Ans :- (a) unary and ternary operator Unary operator:- It pecedes an operand . The operand (the value on which the operator operates ) of the unary operator must have arithmetic or pointer type and the result is the value of the argument. Example:- If a=5 then +a means 5 If a=0 then +a means 0. If a=-4 then +a means -4. Ternary operator:- It precedes an operand. The operand of the unary operator must have arithmetic type and the result is the negation of the operand’s value. Example:- If a=5 then –a means -5 If a=0 then –a means 0 If a=-4 then –a means 4. (b) Assignment and equalto operator Assignment operator:- Equal to operator: An assignment operator assigns value In this we put the To a variable. value as it is. Example – Example- a*=5 means a=5*5. Int a; a=5 means a is initialized with 5 if(a==5) { return true; } return false; (c) Expression and statement Expression:- An expression is any valid combination of operators , constants , and variables. Example:- for(i=0;i=10&&qual==1) sal=15000; else if((g==’m’&&yos>=10&&qual==0)||(g==’m’&&yos=10&&qual=0) ...

Words: 399 - Pages: 2

Premium Essay

Week 2 Assigment

...Week 2 Assignment: Understanding Effective Money Management Assessment A, Part 1: Creating a Personal Financial Statement - Assets | 1 point | Car: Bluebook value $1250.00Cash: $378.00Savings Accounts: $826.00 | Assessment A, Part 2: Creating a Personal Financial Statement - Debts | 1 point | Rent: $750.00Electric/ Gas bill: $131.75Cable/ internet/ Phone bill: $80.42Credit Card: $31.00Cell phone bill: $72.37 | Assessment A, Part 3: Identify Money Management Tool | 1 point | Explain to Monica how the money management tools were identified. | Students should explain how they evaluated various cash management products and services. | Assessment A, Part 4: Creating a Personal Financial Statement – Steps | 1 point | Drag the steps listed on the right into their correct sequences on the left. When done click the Send button | Step 1: I got all my financial stuff together – bills, loans, bank statements, etc. | Step 2: I balance my checkbook. | Step 3: I decided what were my assets and what were my debts. | Step 4: I enter my assets in the program. | Step 5: I enter my debts in the program. | Step 6: The program gave me a Net worth figure at the end. | Assessment B: Creating a Monthly Cash Flow Statement ...

Words: 255 - Pages: 2

Free Essay

Prg/211 Calorie Count Tool

...Team B Calorie Count Tool PRG/211 May 5, 2014 Team B Calorie Count Tool PROBLEM STATEMENT Team B was asked to develop a program which would calculate the user’s daily intake of calories and measure those calories against the overall calories expended. The core purpose of this program will do two primary functions. First, it will record the user intake of calories as acquired through meals throughout the day. Second, the user will record caloric output associated with physical activity. This information will be calculated together to determine the caloric surplus or deficit for the user. In order for the program to execute accurately, and provide customized results, the user will be required to input personal data to include gender, age, weight, and height. This additional information is essential to determine the user’s default caloric burn rate, otherwise known as the basal metabolic rate (BMR). The BMR and the calories burned as a result of physical activity will be calculated against the intake of calories to determine the overall success for the user. As the program is executed it must: * Record user name, age, height, weight to enable more accurate calculations * Record the users specific caloric values entered for each meal * Record the user activity and caloric burn values for that activity * Calculate the basal metabolic rate (BMR) for the individual * Subtotal the total caloric values for the day * Combine the physical activity and...

Words: 1524 - Pages: 7

Free Essay

Nt1210 Unit 7 Assignment 1

...Unit 7 Assignment 1 Multiple Choice 1.) A 11.) C 2.) A, B 12.) A 3.) B, D 13.) A, D 4.) A 14.) C 5.) A 15.) B, C 6.) B, D 16.) B, D 7.) A 17.) C 8.) C 18.) B, D 9.) C 19.) A, C 10.) D 20.) B, C Key Terms Switched circuit - A circuit established through one or more intermediate switching devices, such as circuit switches or packet switches. Dedicated circuit - it is used in reference to a phone or data line, or to an electrical circuit. Circuit switching - a methodology of implementing a telecommunications link in which two network nodes establish a dedicated communications channel (circuit) through the network before the nodes may communicate. Packet switching - a digital networking communications method that groups all transmitted data into suitably sized blocks that are transmitted through a medium that may be shared by multiple simultaneous communication sessions. Leased line - connects two locations for private voice and/or data telecommunication service. Time-division multiplexing -a method of transmitting and receiving independent signals over a common signal path by means of synchronized switches at each end of the transmission line so that each signal appears on the line only a fraction of time in an alternating pattern. T-carrier system – one of several digital transmission systems developed by Bell Labs, sometimes called T-CXR. DS0 – a standard digital transmission rate for digital telecommunications, stands for Digital Signal Zero. DS1 –...

Words: 336 - Pages: 2

Premium Essay

Andy Owes Bill a Debt.

...Law Written Assignment 3 Case Study 1 Parks, a 7-foot, 265-pound center for the San Diego Slick, objected when his contract was assigned from the ABC Corporation to the XYZ Corporation, the team’s new owner. The change of owners did not cause a change in the composition of the team although a new coach was hired. Parks’s compensation and his responsibilities remained the same. Was this contract assignable? Facts of the Case: 1) Parks contract was assigned from the ABC Corporation to XYZ Corporation. 2) Parks compensation and his responsibilities remained the same. Issues: 1) The reason why we are in court today is to identify if Park’s contract was assignable. Rules of the Law: 1) Personal Service Contract – The parties agree that a personal service contract may be assigned. This allows the trade of an athlete from one team to another team. 2) Notice of Assignment – Assignee is under a duty to notify the obligor that the assignment has been made and performance must be rendered to the assignee. 3) Anti-Assignment Clause – Prohibits the assignment of rights under the contract. 4) Approval Clause – requires that the obligor approves any assignment of contract. Analysis & Conclusion: Since we do not have all the facts we can assume the following: 1) Parks contract did include the Personal service contract. 2) Notice of assignment was made by XYZ Corporation. 3) Parks contract did NOT include Anti-Assignment Clause. ...

Words: 495 - Pages: 2

Free Essay

Engeenering

...SCHOOL OF ENGINEERING YEAR 3 MECHATRONICS ASSIGNMENT LAB REPORT Reading an Analogue Voltage from a Potentiometer to turn a Motor on and off with reading of 40 Assignment 2 Owais Jahanzeb BENG Mechanical Engineering with buissness Lecturer: Dr. Tom Shenton Aim & Objectives The aim of this lab is to develop a functioning program for the PICDEM board to read an analogue signal from a potentiometer and turning a motor on or off if the signal exceeds a certain limit. The program should depict the function that it should turn the motor ON and OFF if the potentiometer reading is less than or equal to 40. The practical uses of such program can be seen in automotive , injection moulding machines, wood processing machines, modern temperature controlled plants, speed control torque operations. Developing Program 1 Figure 1. The schematic circuit & PICDEM board configuration for Program Figure 1. The schematic circuit & PICDEM board configuration for Program The objective of program is to read the correspondent voltage analogous to the potentiometer position and switch the motor on if the reading is over 40 and switch it off if the reading is less than or equal to 40, the value can be adjusted by twisting the screw clockwise and anticlockwise. The program works by implementing the following code. PIC program for Test of potentiometer with value less equal to 40 with comments: include <p16f917.inc> extern DisplayDigit1, DisplayDigit2...

Words: 427 - Pages: 2

Free Essay

Study Habits

...STUDY HABITS OF SECOND YEAR BS-AVTECH STUDENTS OF PATTS COLLEGE OF AERONAUTICS S.Y 2013-2014 An Undergraduate Research Presented to The Languages Department of PATTS College of Aeronautics In Partial Fulfillment of the Requirements for the course ENGL 211 – Technical Report Writing By Guevarra, Giorgio Martin C Guevarra, Lorenzo Miguel Jang, Jose, Yosalina, Leo Xander March 2014 ACKNOWLEDGEMENT The researcher would like to express our thanks to the lord. Our God for his guidance towards everything we do In life, including this study that we had made, and for being an inspiration for us all to do our best in life. We give our thanks to Ms. Karen M. Millano, our adviser for ENGL 211, for carefully and patiently guiding us so that we may finish the thesis research, and for supporting us and believing in us, that we can accomplish our task finishing the thesis. To the respondents of this study, we express our gratitude because without them, this thesis research would not have been completed, we thank them for allowing us to conduct a survey during their spare time, and their patience and integrity in answering the survey. To our parents, for their support and everlasting patience and understanding for us. And lastly to our classmates, since they have been with us since the beginning of the semester and they had been our companions in everything we do for the subject ENGL 211. ABSTRACT STUDY HABITS OF...

Words: 413 - Pages: 2

Premium Essay

Sfds

...ASSIGNMENT - 3 Answers 1 Answer 2 Answer 3 4. For what types of workloads does SJF deliver the same turnaround times as FIFO? ANSWER: - In the above case if the jobs are same in size or the jobs periodically applied (i.e. first shortest job then later second shortest job and continues) then the turnaround time of SJF is same as FIFO. 5. For what types of workloads and quantum lengths does SJF deliver the same response times as RR? ANSWER: - The response time delivered by SJF is equal to the response time of RR but this happens only when all the jobs arrived are at the point when the planning quantum of RR is bigger than the bigger occupation to be administrations in order of increasing size. 6. What happens to response time with SJF as job lengths increase? Can you use the simulator to demonstrate the trend? ANSWER: - If you suppose the length of the job increases then average response time varies (increases).If every job is sorted in increasing job order than the last job response time will be equal to the sum of current job and previous (n-1) jobs. In this way if the size of the job increases the response time will also increases for all larger jobs. 7. What happens to response time with RR as quantum lengths increase? Can you write an equation that gives the worst-case response time, given N jobs? ANSWER: - In the case of RR, the response time increases as the quantum lengths increases. This happens because the waiting time of a process for its turn to...

Words: 286 - Pages: 2

Free Essay

Management Accounting

...Management Accounting Individual Assignment 1. Variable manufacturing cost per unit = (323,000,000-160,000,000-24,000,000-100,000,000) 850,000 = $45.88 per unit Fixed manufacturing cost per unit = $100,000,000 850,000units = $117.65 per unit Total manufacturing cost per unit= 45.88+117.65 = $163.53per unit 2. Fixed overhead rate= $100,000,000 800,000units =$125 per unit Production volume variance= (850,000 X 125)-(800,000 X 125) =$106,250,000-$100,000,000 = $6,250,000 Favourable 3. Absorption costing. | $ | $ | SalesLess: Cost of goods soldOpening inventoryProduction(850,000 X (255+125))(-)Ending inventory(30,000 X 405)Gross MarginAdjustments for production variance(850,000-800,000)x125Operating Income | 0323,000,000(11,400,000) | 450,000,000(311,600,000) | | | | | | 138,400,0006,250,000F | | | 144,650,000 | Income Statement for the year ended 31December 2012 4. Variable Costing Income Statement for the year ended 31 December 2012 | $ | $ | SalesOpening inventoryProduction(850,000 X 255)(-)Ending inventoryContribution MarginFixed factory overheadOperating income | 0216,750,000(7650,000) | 450,000,000(209,100,000) | | | 240,900,000(100,000,000) | | | 140,900, 000 | 5. Based on the calculations of absorption costing and variable costing for the year 2012,it would be better to calculate and measure using the absorption costing...

Words: 288 - Pages: 2

Free Essay

Misconceptions of Algebra

...Diagnostic Algebra Assessment Definitions Categories Equality Symbol Misconception Graphing Misconception Definition Concept of a Variable Misconception Equality Symbol Misconception As algebra teachers, we all know how frustrating it can be to teach a particular concept and to have a percentage of our students not get it. We try different approaches and activities but to no avail. These students just do not seem to grasp the concept. Often, we blame the students for not trying hard enough. Worse yet, others blame us for not teaching students well enough. Students often learn the equality symbol misconception when they begin learning mathematics. Rather than understanding that the equal sign indicates equivalence between the expressions on the left side and the right side of an equation, students interpret the equal sign as meaning “do something” or the sign before the answer. This problem is exacerbated by many adults solving problems in the following way: 5 × 4 + 3 = ? 5 × 4 = 20 + 3 = 23 Students may also have difficulty understanding statements like 7 = 3 + 4 or 5 = 5, since these do not involve a problem on the left and an answer on the right. Falkner presented the following problem to 6th grade classes: 8 + 4 = [] + 5 All 145 students gave the answer of 12 or 17. It can be assumed that students got 12 since 8 + 4 = 12. The 17 may be from those who continued the problem: 12 + 5 = 17. Students with this misconception may also have difficulty with the idea that adding...

Words: 797 - Pages: 4

Free Essay

Book Report

...Selection statements Selection is used to select which statements are to be performed next based on a condition being true or false. Relational expressions In the solution of many problems, different actions must be taken depending on the value of the data. The if statement in C I used to implement such s decision structure in its simplest form – that of selecting a statement to be executed only if a condition is satisfied. Syntax: if(condtion) statement executed if condition is true When an executing program encounters the if statement, the condition is evaluated to determine its numerical value, which is then interpreted as either true or false. If the condition evaluates to any non-0 value (positive or negative), the condition is considered as a “true” condition and the statement following the if is executed; otherwise this statement is not executed. Relational Operators In C Relational operator | Meaning | Example | < | Less than | age < 30 | > | Greater than | height > 6.2 | <= | Less than or equal to | taxable <= 200000 | >= | Greater than or equal to | temp >= 98.6 | == | Equal to | grade == 100 | != | Not equal to | number !=250 | In creating relational expressions, the relational operators must be typed exactly as given in the above table. Thus, although the following relational expressions are all valid: age > 40 length <= 50 temp >= 98.6 3 < 4 flag == done day != 5 The following are invalid: length =< 50 ...

Words: 1617 - Pages: 7

Free Essay

Assignment of Income Doctrine

...ACC 616 Prof. Robert Simpson Student name: On the back Assignment 1: Explain Assignment of Income Doctrine The "assignment of income" doctrine states that income is taxed to the one who actually earns it. That means a taxpayer cannot avoid tax liability by assigning his income to another party or entity. Therefore, to be able to shift income to someone else, that one must actually earn the income. This doctrine aims to against the tax evasion when the taxpayer tries to deflect income to another party. First, starting from the term “earning”, earnings can occur either through the direct efforts of the taxpayer or the taxpayer’s ownership of an asset that generates income. Based on that understanding about earning, there are 2 ways to shifting income from one to another: the transferee must really work to earn that income or share the ownership of an asset that creates income. For example, if you are an owner of a business and you want to shift one part of your income to your family member such as your son, you need to hire your son to work for your company and give him the pay rate that is appropriate with his job. And the other way is to share your investment income with him, same meaning with sharing your ownership with him. The assignment of income applies the “tree and fruit” metaphor, in which the fruits cannot be attributed to a different tree from that on which they grew. If you want to avoid the tax liability on the fruit from the tree, you must prove that the...

Words: 421 - Pages: 2