Pages

Tuesday, January 19, 2010

Assembly Language Solution

; Searching a substring from a Main string

[org 0x0100]

jmp start



mstr: db 'aaab', 0

sstr: db 'aab', 0

sub_len: dw ; Used to contain length of sub string

start: dw ; Place to resume search

stop: dw ; Last place to begin search



; subroutine to calculate the length of a string

; takes the segment and offset of a string as parameters

strlen: push bp

mov bp,sp

push es

push cx

push di

les di, [bp+4] ; point es:di to string

mov cx, 0xffff ; load maximum number in cx

xor al, al ; load a zero in al

repne scasb ; find zero in the string

mov ax, 0xffff ; load maximum number in ax

sub ax, cx ; find change in cx

dec ax ; exclude null from length

pop di

pop cx

pop es

pop bp

ret 4






; subroutine to compare two strings

; takes segment and offset pairs of two strings to compare

; returns 1 in ax if they match and 0 other wise

strcmp: push bp

mov bp,sp

push cx

push si

push di

push es

push ds



lds si, [bp+4] ; point ds:si to first sstr

les di, [bp+8] ; point es:di to second mstr



push es ; push segment of mstr

push di ; push offset of mstr

call strlen ; calculate string length

mov bx, ax ; save length in bx



push ds ; push segment of sstr

push si ; push offset of sstr

call strlen ; calculate string length

; Now length of sstr is in ax register

; See if mstr/sstr are null or sstr longer than mstr



or bx,bx ; mstr null?

JE exitfalse

cmp ax,0 ; sstr null?

JE exitfalse

cmp ax, bx ; sstr>mstr?

JE exitfalse



mov sub_len, ax ; Move length of sstr in sub_len



; see if the sstr is substring of mstr



LEA SI, sstr ; SI points to sstr

LEA DI, mstr ; DI points to mstr

Cld ; Left to right processing



; Compute STOP



mov stop, DI ; stop has mstr address

add stop, bx

mov cx,sub_len

sub stop,cx ; subtract substring length



; Initialize start



mov start, DI

REPEAT:

; compare characters

mov cx, sub_len

mov DI, start ; reset DI

LEA SI, sstr ; reset SI

Repe cmpsb ; compare characters



JE exitsimple



; substring not found yet



INC start

; see if the start<=stop



mov ax, start

cmp ax, stop

JNLE exitfalse

JMP REPEAT

mov ax,1

JMP exitsimple

exitfalse: mov ax, 0 ; store 0 to mark unequal



exitsimple: pop ds

pop es

pop di

pop si

pop cx

pop bp

ret 8



start: push ds ; push segment of first string

mov ax, mstr

push ax ; push offset of first string

push ds ; push segment of second string

mov ax, sstr

push ax ; push offset of second string

call strcmp ; call strcmp subroutine



mov ax, 0x4c00 ; terminate program

int 0x21

_________________

MTH202 - Solution

Question 1; Mark: 10

Use Mathematical Induction to prove that


Solution:


Induction given statement is true for all set of whole numbers.




Question 2; Mark: 5

If is odd then is even (prove by contradiction).



Sol: Suppose 3x + 1 is odd and x is not even

x is not even à x is odd (x is either even or odd but not both)

à x = 2k + 1 ( x is not divisible by 2)

à 3x + 1 = 3 ( 2k +1) + 1 (substitute 2k +1 from x)
3x +1 = 6k + 3 + 1

= 6k + 4

= 2 ( 3k + 2) (Divisible by 2)

à 3x + 1 is even which is contradiction

Therefore 3x + 1 is odd then x is even

Question 3; Marks: 5

Find the number of arrangements of balls having colors Red, Yellow, Blue Green and Pink such that Red and Green balls must place next to each other.

Sol:

Red, Yellow, Blue, Green, Pink
Total numbers of balls = 5
Considering two balls Red and Green as a single ball ( due to restriction), we have to make the arrangements of 4 balls taken all together
No. of Arrangements = 4!
= 4 × 3 × 2 × 1
= 24
But two balls (restricted) permuted among themselves in two ways
i.e. 2! = 2 × 1 = 2 ways
Therefore total numbers of arrangements = 4! × 2!
= 24 × 2
= 48

STA630 Reserach Method ONLINE Quiz

Question

Which of the following is NOT an unethical issue?



Select correct option:



Invoicing irregularities

Avoiding legal liability

Misrepresenting results

Seek approval for research





Question

Which of the following is NOT a type of Non-random sampling?



Select correct option:



Cluster sampling

Convenience sampling

Quota sampling

Purposive sampling







Question #

Which one of the following is not an assumption of science?



Select correct option:



There are reoccurring patterns in the world.

Events happen because of preceding causes.

We can discover solutions to problems of interest.

Theoretical explanations must agree with common sense.







Question

After a researcher has stated the specific problem to be studied in an experiment, he must then develop a(n):



Select correct option:



Theory

Conclusion

Hypothesis

Summary of the data





Question #



Which of the following is the best hypothesis statement to address the research question, "What impact will the new advertising campaign have on use of Brand B?"



Select correct option:



The new advertising campaign will impact Brand B usage.

The new advertising campaign will increase Brand B trial.

The new advertising campaign will cause increased Brand B usage at the expense of Brand C.

The new advertising campaign will increase Brand B's market penetration.







Question

A one tailed hypothesis predicts-----------



Select correct option:



The future

The lottery result

The frequency of the effect

The direction of the effect





Question

Setting quotas for hard-to-reach respondents is one way to minimize _______ bias.



Select correct option:



Interviewer

Respondent

Instrument

Sampling







Question

The organization of concepts in sequence from the most concrete and individual to the most general indicates is:



Select correct option:



One that bears no relation to the underlying concept.

An abstract, theoretical definition of a concept.

The degree of abstraction

An operational definition







Question



What is the purpose of a control group?



Select correct option:



Make the experiment easier to analyze

Show the value of the dependent variable when the independent variable is not being manipulated

To be able to better evaluate the effect of the independent variable

To control all variables





Question

A measure has high internal consistency reliability when:



Select correct option:





Multiple observers make the same ratings using the measure.

Participants score at the high end of the scale every time they complete the measure.

Multiple observers obtain the same score every time they use the measure.

Each of the items correlates with other items on the measure.







Question # 10 of 20 ( Start time: 01:24:22 AM ) Total Marks: 1



The purpose of a literature review is to:



Select correct option:







Help you find out what is already known about this area.



Identify any inconsistencies or gaps in the literature.



Demonstrate an awareness of the theoretical context in which the current study can be located.



Find what is already known, identify gaps demonstrate awareness.







Question # 9 of 20 ( Start time: 01:23:17 AM ) Total Marks: 1



The extent to which we can generalize the results of a study to other participants is called:



Select correct option:







Sampling validity



External validity



Construct validity



Internal validity







Question # 8 of 20 ( Start time: 01:21:56 AM ) Total Marks: 1



Why, as scientists, do we not want to rely on authority for explanations?



Select correct option:







Those in authority are often wrong.



Those in authority cannot be challenged.



Those in authority rely too much on objective information.



Those in authority often have no common sense.







A ________ scale only assigns numbers to objects to classify the objects according to the characteristic of interest.



Select correct option:







Ratio



Nominal



Interval



Dichotomous







Question # 6 of 20 ( Start time: 01:20:06 AM ) Total Marks: 1



You wish to make a precise estimate about the characteristics of a population of individuals. You should use:



Select correct option:







Quota sampling



Probability sampling



Accidental sampling



Snowball sampling







Question # 5 of 20 ( Start time: 01:19:35 AM ) Total Marks: 1



Conditions favoring the use of a sample over a census include a:



Select correct option:







Long time frame



Small budget



High cost of sampling errors



Low cost of non-sampling errors







Question # 4 of 20 ( Start time: 01:18:15 AM ) Total Marks: 1



A variable is:



Select correct option:







Any characteristic of interest that can take on more than one value



Defined as the groups manipulated in experimental research



The complete set of scores we use in statistical analysis



Completely specified only in observational research







Question # 3 of 20 ( Start time: 01:17:40 AM ) Total Marks: 1



In the statement 'an examination of the effects of discretionary behaviour on employee performance' employee performance is the:



Select correct option:







Independent variable



Dependent variable



Extraneous variable



Causal variable







Question # 2 of 20 ( Start time: 01:16:41 AM ) Total Marks: 1



Which of the following issues should NOT be mentioned in an introductory statement?



Select correct option:







The information will be kept confidential



What the findings of the research are?



Who is funding the research?



Why the respondent has been chosen?







Question # 1 of 20 ( Start time: 01:15:16 AM ) Total Marks: 1



Which measure of dispersion is easiest to calculate? Standard deviation?



Select correct option:







Mean



Range



Median



Mode

mgt503- ONLINE QUIZ

Question



Usman currently holds a management position within his company. His job responsibilities include maintaining a focus toward long-term issues that may impact the company as well as developing appropriate goals to guide the organization. Jim is most probably which type of manager?



Select correct option:



First line managers

Middle level manager

Operational manager

Top Level Manager







Question # 5 of 20 ( Start time: 09:30:52 AM ) Total Marks: 1



Functional departmentalization groups jobs by which of the following?



Select correct option:



Tasks they perform

Territories they serve

Products or services they manufacture or produce

Type of customer they serve





Question #



Which of the following is not among the three perspectives that should be considered in preparing a business plan?



Select correct option:





Marketing perspective

Perspective of the entrepreneur

Investor perspective

Technical perspective





Question



Which famous management thinker developed "Theory Y"?



Select correct option:



Douglas McGregor

Abraham Maslow

Frederick Herzberg

Chester Barnard



Question #



Which of the following is a basic definition of ethics?



Select correct option:



Moral guidelines for behavior

Rules for acknowledging the spirit of the law

Principles that define right and wrong conduct

Principles for legal and moral development



Question



Managers are responsible for improving ________involvement in decision making and action taking.



Select correct option:



Stakeholder's

Liaison's

Leader's

Figurehead's





Question



The principle of “Division of Labor” was given by:



Select correct option:



Frederick Taylor

Joseph Juran

Adam Smith

W. Edwards Deming





Question



Most managers believe that if an MBO (management by objective) program is to be successful, it must start at:



Select correct option:



Top Level

Middle level

Lower level

Non-managerial level



Question



A plan developed to carry out a course of action that is not likely to be repeated in the future is called:



Select correct option:



Single-use plan

Specific plan

Reaction plan

Directional plan



Question #



A state legislative plan that calls for a 2.45 percent increase in tobacco sales tax for the next 2 years would be considered which of the following type of plan?



Select correct option:



Tactical

Operational

Specific

Directional









Question #



Concern for employee motivation is most closely associated with which of the following management approach?





Select correct option:



Bureaucracy

Organizational behavior

Scientific management

Systems





Question



The set of strengths, characteristics and qualities including skills, technologies, or resources that distinguish a firm from its competitors is called:



Select correct option:



Scope

Distinctive Competency

Resource deployment

Effective strategy





Question



Which of the following is one of the most important objectives for small business owners?



Select correct option:



Market presence

Growth

Profitability

Innovation





Question:



Which of the following is the most ancient management monument?



Select correct option:



Wall of China

Egyptian Pyramid

Taj Mahal

Sydney Opera House





Question



All of the following are reasons to look at theoretical perspectives of management EXCEPT:



Select correct option:



Understanding the present

Source of new ideas

History repeats itself

Guide to action

Mgt402 - Solution

Solution:



Bell Computers, LTD.,

Cost of Production Report

For the Month of Jan

1. Quantity Schedule

Units of open work in process 10,000

Units put into the process 58,000

68,000

Units of closing work in process 8,000

Units completed and transferred 60,000

68,000



2. Cost Accumulated in the process

Material Cost (18,000+114,000) 132,000

Conversion Cost (8,800+61,600) 70,400

Total Cost 202,400

3. Equivalent unit Produced

Material Cost (60,000+8000*75%) 66,000

Conversion Cost (60,000+8000*50%) 64,000

4. Per Unit Cost

Material Cost (132,000/66,000) = 2

Conversion Cost (70,400/64,000) = 1.1

Total per Unit Cost 3.1

5. Cost Apportionment

Units completed and transferred

(60,000*3.1) 186,000

Closing work in process

Material Cost (6,000*2) 12,000

Conversion Cost (4000*1.1) 4,400 16,400

202,400



Required:

1. How many units were started and completed during January?

Answer:

Unit Started in Jan. = 68,000

Unit Completed in Jan. = 60,000

2. What were the equivalent units for January for material and conversion costs?

Answer:

Equivalent units for January for material costs = 66,000

Equivalent units for January for conversion costs = 64,000



3. What were the costs per equivalent unit for January?

Answer:

Material Cost (132,000/66,000) = 2

Conversion Cost (70,400/64,000) = 1.1

Total per Unit Cost 3.1



4. Verify the accountant’s ending work in process inventory figure (£16,400) given in the report.

Answer:

Closing work in process

Material Cost (6,000*2) 12,000

Conversion Cost (4000*1.1) 4,400 16,400

5. What criticism can be made of the unit costs that have been computed weighted –Average Method by the company and which method is superior computing unit cost under process costing based on your criticism?

Answer:

Comparison of Both methods is under as equivalent production and per unit costs.

Weighed Average Method FIFO Method

Equivalent production per unit costs Equivalent production per unit costs

Material Cost (60,000+8000*50%)

66,000 (132,000/66,000)

2 (1000+50,000+6000)

57,000 (114,000/57,000)

2

Conversion Cost (60,000+8000*75%)

64,000 (70,400/64,000)

1.1 (2000+50,000+4000)

56,000 (61,600/56,000)

1.1

Total 130,000 3.1 113,000 3.1

In comparison we see that the equivalent unit in both methods is different but per unit cost has same. FIFO method is complex than Weighted Average method, so Average method is superior because of less complexity and due to:

1. There are fewer chances to complete the unit which produced first it means first in first, because Authorities prefer to complete the open units and there may be delay in new units to put into the process.

2. Accountants will refer to Average method due to less time consuming and complexity.

Mgt301 - Solution

SOURCE:-
MGT 301 Handouts and web search.

EXCLUSIVE DISTRIBUTION:-
Exclusive distribution means giving a limited number of dealers the exclusive
right to distribute the company’s products in their territories.

FMCG s:-
FMCGs (Fast Moving Consumer Goods) are inexpensive products that people
usually buy on a regular basis, such as supermarket foods or toiletries.

RECOMMENDATION AS EXCLUSIVE DISTRIBUTION FOR FMCGs OR NOT:-
I will not recommend exclusive distribution for FMCGs because they are
required on regular basis and should be available in every market on most number of
shops and people should have an easy approach towards these products.

EXCLUSIVELY DISTRIBUTED PRODUCTS:-

1. HONDA MOTORCYCLE
REASON: - It is exclusively distributed because its distribution requires financially
strong dealers and dealers whose reputation is well in the market as well as in the society.
And dealers must be able to hold the complex and unexpected environment of the market.
Dealers are required to have a knowledge that why HONDA MOTORCYCLE is better
than others.

2. PEL REFRIGERATOR
REASON: - It is exclusively distributed because there are only a few no of dealers which
are present in the market to sale and service the electric appliances and the distributors
are required to be financially strong and distributors should have knowledge about
electric equipments and inner composition of equipments. They must have well
reputation in the market as appliance dealers.

Mgt101 - Solution

[[NOTE:- We always try our best to upload 100% correct solution BUT it is requested that you kindly review it before submission, please.]]



Hyper Star Traders
Income Statement
As of Dec 31, 2009




Amount in Rs.







Sales
924,000


Return Inwards
8,000


Net Sales

916,000







Cost of Sales




Opening Stock
120,000








Purchases 680,000



Return Outwards 4,800



Net Purchases 675,200 675,200


Total Stock available for sale
795,200








Closing Stock
200,000


Net Cost of Sales

595,200







Gross Profit

320,800







Operating Expenses










Salaries

48,000

Wages

45,200

Carriage out

3,600

Commission

2,000

Insurance Paid

2,800

House Rent

5,000

Bank Charges

150

Interest on Loan

500

Bad Debts on Sundary Debtors

5,000

Written off Plant Value - wear& Tear

40,000







Total Operating Expenses

152,250







Operating Income




Interest Received

(800)

Dividend Income

(2,000)







Total Operating Income

(2,800)







Net of Total Operating Income/Expense
149,450







Net Profit Transferred to Balance Sheet
171,350






....................................................

Hyper Star Traders
Balance Sheet
As of Dec 31, 2009







Liabilities & Owner's Equity
Assets







Current Liabilities
Amount in Rs.
Current Assets
Amount in Rs.







Bills Payable
20,000
Cash in Hand
4,000
Sundary Creditors
160,000
Bank Balance
36,000
Bank Charges/Interest Due
650
Sundary Debtors 100,000




Bad Debts 5,000




Net Sundary Debtors 95,000 95,000




Bills Receivables
44,000




Dividend Receivable recorded (2,000)




Closing Stock
200,000







Total current Liabilities 180,650
Total current Assets 377,000







Owners Equity


Fixed & Long Term Assets











Long Term Investment
60,000







Capital 280,000

Furniture
40,000
Drawing (Credited) 5,000

Plant 200,000
Net Capital 285,000 285,000
Wear & Tear of plant 40,000




Net Plant Value 160,000 160,000
Net Retained Earning from P&L
171,350










Total Capital & Retained Earning
456,350
Total Fixed & Long Term Assets 260,000







Total Liabilities & Owners Equity 637,000
Total Assets 637,000








.....................................

Hyper Star Traders
Adjustment Entries
As of Dec 31, 2009




Amount in Rs.






Adjustment Entry # 1

Account Dr Cr



Bad Debts on Sundary Debtors 5,000



Sundary Debtors
5,000



Recording the bad debts on sundary debtors (100,000 x 5 % = 5,000)






Adjustment Entry # 2

Account Dr Cr



House Rent Expense 5,000



Capital
5,000



Adjustment Entry for recording the House rent paid from Owners personal Account






Adjustment Entry # 3

Account Dr Cr



Writen Off Value - Plant 40,000



Plant
40,000



Adjustment Entry for the Written off the plant value






Adjustment Entry # 4

Account Dr Cr



Bank Charges 150
Interest on Loan 500



Due Bank Charges
150
Due Interest on loan
500




650 650



Adjustment Entry to record the due payment not yet recorded in the bank books






Adjustment Entry # 5

Account Dr Cr



Accrued dividend Receivable 2,000



Dividend Income
2,000



Adjustment Entry for the dividened accured receivable on Dec 31,09



Is this blog is useful for you?

Powered by Blogger.