758 WordsJul 29, 20134 Pages

COMP122
Week 1 Homework
Part 1: Complete the following problems.
1. What is machine code? Why is it preferable to write programs in a high level language such as C++?
Machine code it the language that the computer understands. High level languages are better because they are easier to understand and work with.
2. What does a compiler do? What kinds of errors are reported by a compiler?
A compiler translates one computer language into another. It also pics up errors in the program being put together.
3. What does the linker do?
A linker takes multiple object files, and turns them into an executable program
4. What is an algorithm?
The list of instructions to complete a task on a program
5. Bob enters a pizza shop and notices*…show more content…*

21 % 5 answer: 1 d. 3 - 5 % 7 answer: 3 e. 17.0 / 4 answer: 4 f. 8 - 5 * 2.0 answer: -2 g. 14 + 5 % 2 – 3 answer: 12 h. 15.0 + 3.0 / 2.0 answer: 16.0
2. Given the following variable declarations:
int num1 = 10, num2 = 20, newNum = 30; double x = 5.0, y = 8.0;
Determine which of the following assignment statements are valid. For each invalid statement, explain why it is invalid. Assume that each statement immediately follows the above variable declarations.
a. num1 = 15; b. num2 = num1 - 18; c. num1 = 5; num2 = 2 + 6; num1 = num2 / 3; d. num1 + num2 = newNum; e. x = 12 * num1 - 15.3; f. num1 * 2 = newNum; g. x / y = x * y; h. num2 = num1 % 2.0; i. newNum = static_cast (x) % 5; j. x = x + 5; k. newNum = num1 + static_cast (4.6 / 2);
3. For each of the following lines of variable declarations, identify it as valid or describe what makes the line invalid.
Line 1: n = 12; valid Line 2: char letter = ; invalid, don't put “letter” Line 3: int one = 5, two; invalid, “One” and “two” not valid inputs Line 4: double x, y, z; valid
4. Write C++ statements that accomplish each of the following:
a. Declare and initialize int variables x to 25 and y to 18. b. Declare and initialize an int variable temp to 10 and a char variable ch to 'A'. c. Add 5 to the int variable x which already exists. d. Declare and initialize a double variable payRate to 12.50. e. Copy the value from an

Related

## Week 2 Fin515 Homework

1102 Words | 5 Pagesdaily sales are $20,000. What is the level of its accounts receivable? Assume there are 365 days in a year. Formula for DSO = Receivables/ Ave sales per day = Receivables/( Annual sales/365) = 20 days x $20,000= $400,000 Solution: AR = $400,000 3-2 Debt Ratio Vigo Vacations has an equity multiplier of 2.5. The company’s assets are financed with some combination of long-term debt and common equity. What is the company’s debt ratio? Formula for Debt ratio = Debt Ratio + Equity Ratio = 1 Equity

## Module 2 Homework

1867 Words | 8 PagesModule 2 Homework Risk Management and Health Care Regulations Angie Martinez Grand Canyon University Module 2 Homework 1) There are several processes involved in a wrongful discharge. This is a fairly new and quickly expanding area that involves litigation, and this is an area that employers would rather avoid. About 65%-70% of worker’s are thought to be employees at will which means that an employer may fire an employee at any time for any reason, as long as the reason is lawful (Kavaler

## Fi515 Homework 2

813 Words | 4 PagesAssume there are 365 days in a year. The Days Sales Outstanding: Receivable / Average sales per day DSO= 20 days, Average daily sales = $20,000 Receivable 20 days= 20,000 Receivable = 20 x 20,000 = $400,000 Problem 3-2: Vigo Vacations has an equity multiplier of 2.5. The company’s assets are financed with some combination of long-term debt and common equity. What is the company’s debt ratio? Debt Ratio: Total liabilities / Total assets Problem 3-3: Winston Washers’s

## Week 7 Homework

930 Words | 4 PagesWeek 7 Homework Mohamed E. Abdelrahman Prof: James Glenn International Finance FIN: 535 Strayer University Spring 2013 15. DFI Strategy: A. What comparative advantage does JCPenney have when establishing a store in a foreign country, relative to an independent variety store? B. Why might the overall risk of JCPenney decrease or increase as a result of its recent global expansion? C. JCPenney has been more cautious about entering China. Explain the potential obstacles associated with

## Week 1 Homework

760 Words | 4 PagesFIN-516 WEEK 1 – HOMEWORK ASSIGNMENT Problem Based on Chapter 14, Residual Dividends Middlesex Plastics Manufacturing had 2011 Net Income of $15.0 Million. Its 2012 Net Income is forecast to increase by 8%. The company’s capital structure has been 35% Debt and 65% Equity since 2010, and the company plans to maintain this capital structure in 2012. The company paid $3.0 Million cash dividends in 2011. The company is planning to invest in a major capital project in 2012. The capital budget

## fin 516 homework week 2 Essay

2011 Words | 9 Pagesoption on Ford stock with a strike price of $10. The option will expire in exactly 6 months’ time. a. If the stock is trading at $8 in 6 months, what will be the payoff of the put? • Payoff-max=(10-s)=max (10-8) the owner of put option will gains $2 b. If the stock is trading at $23 in 6 months, what will be the payoff of the put? • Payoff-max=(10-s)=max (10-23)=-13 the owner of put option will loses $13 c. Draw a payoff diagram showing the value of the put at expiration as a function of the

## Fin 550 Week 8 Homework Fin550 Week 8 Homework

3754 Words | 16 PagesFIN 550 FIN550 week 1 to week 11 Complete Course Click below link for Answer visit www.workbank247.com http://workbank247.com/q/fin-550-week-1-to-week-11-complete-course-fin550-w/9896 http://workbank247.com/q/fin-550-week-1-to-week-11-complete-course-fin550-w/9896 FIN 550 Week 1 Discussion "Investment Performance and Decisions" Please respond to the following: * From the e-Activity, predict the performance of the DOW for the next two years. Provide support for your prediction. * Analyze the

## Mat 540 Week 2 Homework - Latest 2015

809 Words | 4 PagesMAT 540 Week 2 Homework - latest 2015 IF You Want To Purchase A+ Work Then Click The Link Below , Instant Download http://www.hwspeed.com/MAT-540-Week-2-Homework-latest-2015-539000032.htm?categoryId=-1 If You Face Any Problem E- Mail Us At JOHNMATE1122@Gmail.Com Chapter 12 1. A local real estate investor in Orlando is considering three alternative investments: a motel, a restaurant, or a theater. Profits from the motel or restaurant will be affected by the

## Week 1 Homework

604 Words | 3 PagesDeborah Michelle Messenger Week 1 Homework 5/8/2016 1. Calculating OCF. Hammett, Inc., has sales of $34,630, costs of $10,340, depreciation expense of $2,520, and interest expense of $1,750. If the tax rate is 35 percent, what is the operating cash flow, or OCF? a. Operating cash flow $ 17283 Sales - Cost - Dep = EBIT 34630 - 10340 - 2520 = 21770 EBIT - Interest = Taxable Income 21770 - 1750 = 20020 Taxes (35%) = 20020 x .35 = 7007 Net income: 20020 - 7007 = 13013 EBIT

## Week Three Homework

2237 Words | 9 PagesCarlyle Brown Network Protocols and Standards Week 3 Homework 1. When was the first major standard describing a structured cabling system released? c. 1995 2. Why is balance an issue in UTP cables, and what is TCL? i. The balance or symmetry of the signal over the wire pairs helps minimize unwanted leakage of the signal. ii. TCL - Transverse Conversion Loss - The TCL measurement is obtained by applying a common-mode signal to the input and measuring the differential signal level on the output

### Week 2 Fin515 Homework

1102 Words | 5 Pages### Module 2 Homework

1867 Words | 8 Pages### Fi515 Homework 2

813 Words | 4 Pages### Week 7 Homework

930 Words | 4 Pages### Week 1 Homework

760 Words | 4 Pages### fin 516 homework week 2 Essay

2011 Words | 9 Pages### Fin 550 Week 8 Homework Fin550 Week 8 Homework

3754 Words | 16 Pages### Mat 540 Week 2 Homework - Latest 2015

809 Words | 4 Pages### Week 1 Homework

604 Words | 3 Pages### Week Three Homework

2237 Words | 9 Pages