The following functions have zero or more security issues given the way they are called in the main() function. Identity these security issues and propose a compliant fix. You don’t need to consider the issues in the main() function.
1. setValue set the element at index in arr to value.
void setValue ( int * arr , int len , int value , int index ) {
arr [ index ] = value ;
}
int main ( void ) {
int arr [10];
int value ;
int index ;
printf (" Enter the value :\ n ");
scanf ("% d " , & value );
printf (" Enter the position :\ n ");
scanf ("% d " , & index );
setValue ( arr , 10 , value , index );
return 0;
}
2. createArray creates an int array of size len. It, then, initializes each element in the array with value.
int * createArray ( int len , int value ) {
int * arr = ( int *) malloc ( sizeof ( int ) * len );
memset ( arr , value , sizeof ( int ) * len );
return arr ;
}
int main ( void ) {
int value ;
int len ;
printf (" Enter the value :\ n ");
scanf ("% d " , & value );
printf (" Enter the length :\ n ");
scanf ("% d " , & len );
int * arr = createArray ( len , value );
if ( arr != NULL ) {
if ( len > 0) {
printf (" The first element is % d \ n " , arr [0]);
}
free ( arr );
}
return 0;
}
3. writeToFile asks the user to input a string and then write the entered string to “out.txt”.
void writeToFile () {
char buffer [20];
printf (" Enter the content :\ n ");
scanf ("% s " , buffer );
FILE * f = fopen (" out . txt " , " w ");
fputs ( buffer );
fclose ( f );
}
int main ( void ) {
writeToFile ();
return 0;
}
4. sum returns the sum of two integers.
long long sum ( int a , int b ) {
return a + b ;
}
int main ( void ) {
int a = 0;
int b = 0;
printf (" Enter a :\ n ");
scanf ("% d " , & a );
printf (" Enter b :\ n ");
scanf ("% d " , & b );
printf (" sum of a and b is % ld \ n " , sum (a , b ));
return 0;
}
5. swap swaps the integer value stored in a and b.
void swap ( int * a , int * b ) {
* a += * b ;
* b = * a - * b ;
* a = * a - * b ;
}
int main ( void ) {
int a = 0;
int b = 0;
printf (" Enter a :\ n ");
scanf ("% d " , & a );
printf (" Enter b :\ n ");
scanf ("% d " , & b );
swap (& a , & b );
printf (" a is %d , b is % d \ n " , a , b );
return 0;
}
In: Computer Science
Wil, Dave and Corinne are in a partnership as window repairers. Their business is called “Windows R Us”. Consider the following:
a. The business is run from an industrial shed which Dave owns. Dave pays for the upkeep of his shed, and the shed has remained basically unaltered since the business starting using it. However, due to rezoning of the area, the premises have substantially increased in value.
Explain the nature of the property in relation to the partnership and, if the premises is sold, whether profits must be shared.
b. Corinne purchases some expensive tinted glass on credit from a glass wholesaler –“Glass House”. Although Corinne actually wants the expensive tinted glass for her own private use (for a home she is building with her boyfriend Rove), she gives the impression to the salesperson at the Glass House that the purchase is on behalf of Windows R Us. Corinne has entered into this transaction on behalf of the partnership even though there was no express authority in the partnership agreement for Corinne to do so. Who will be liable for the debt incurred by Corinne?
c. (i) Dave and Corinne want to continue the business, but Wil is feeling like he wants to do something else with his life now, and thinks he would like to retire from the partnership. Advise Wil in relation to what action he should take regarding his liability for debts incurred by the partnership after he ceases to be a partner.
(ii) Unfortunately, before Wil makes up his mind as to whether he wants to retire, he dies suddenly. The partnership agreement does not include any provisions relating to the death of a partner.
Discuss the impact of Wil’s death on the partnership, and what happens with his share of the partnership.
In: Accounting
Compare and explain the pros and cons of native, cross-platform and web mobile development ?
In: Computer Science
HC3152e Business Applications
Tutorial 4 (Week 5)
E-Environment
Read the following Case The implications of globalisation for consumer attitudes
The article starts by discussing anti-globalisation. It then explores the implications of variations in the characteristics of different cultures on businesses providing services to them. At the end of the article, research about attitudes to globalisation is summarised, along with its implications for businesses trading internationally.
Globalisation, or maybe more specifically, anti‐ globalisation issues, are never far from the headlines, whether it’s coverage of the latest anti‐WTO demonstration or news that McDonald’s has replaced Ronald McDonald in France with Asterix-in a move to ‘appease anti‐globalisation protesters’.
But what does globalisation actually mean? Stemming from the application of free market principles it has manifested the belief that the world is small and that consumers are becoming more and more alike, thus allowing companies to use the same advertising and marketing across regions and countries. Such a doctrine has enabled companies to act global and think global, much to the distaste of the anti‐globalisation lobbies. Indeed, in 1985 it was Friends of the Earth that coined the slogan ‘think global, act local’ in its desire to counter such global forces – particularly with regard to environmental issues.
However, such ‘glocalisation’ [global localisation] makes a lot of sense for multinational companies operating today and planning new market entry, for a number of reasons. Firstly, the term globalisation for many Europeans is virtually synonymous with that of ‘Americanisation’. For some this has negative con‐ notations of materialism, loss of native culture and the encroachment of the English language. At its extreme, it drives many of the anti‐globalisation activists. Thus there is real risk that companies will damage their brand and reputation if they don’t recognise the importance of localisation when considering market entry.
Secondly, consumers are as different as they are similar – local and regional cultures have a profound effect in shaping consumer demand. These difference are potentially more interesting than the similarities, in that they can allow product and service differentiation as well as new approaches to segmentation and marketing communications. To take advantage of such opportunities, businesses have to have a clear insight into how and why consumers in one market may differ from ones in another.
Feelings of anti‐Americanisation are a strong under‐ current in Europe. Businesses have to plan how to counter such a groundswell of feeling if planning on entering new markets – given that some 50% of Europeans believe that ‘our society is too Americanised’ and such an attitude has increased over the past 10 years. While the degree of agreement varies within Europe (e.g. 67% of Spaniards agreeing with the statement, as compared with 44% of Brits), it is a significant influence of customer behaviour. To compound matters, multinational companies are the least trusted of 27 entities when European consumers have been asked to state which they trust to be honest and fair.
As a result, not only have we seen an increase in consumer activism (such as anti‐WTO protests, growth of the slow food movement in Europe etc.), but also we have seen global brands coming under threat from emergent local brands which are gaining in currency. We would expect this to continue. This is not to say that there is no room for global brands! Many global brands have successfully tapped into local culture and tastes and recognised the need to either modify the product/ service completely or change different elements of the offer and how it is ultimately marketed. Thus companies expanding into new geographic markets have to ensure that their strategies are based on a real understanding of regional and local markets.
Globalisation is not making the world a smaller, homogeneous place. While this presents many opportunities for businesses, it also implies a need for a clear understanding of what shapes consumer needs and desires in the different nations. Not surprising perhaps that many businesses found the notion of a ‘globalised’ world compelling, given the significant implications for researching a multitude of different markets in terms of time and money budgets. Similarly, it is easy to under‐ stand the temptation of taking well‐established national stereotypes and assuming that they are representative of the truth.
Recent attitudinal studies in Europe and the US undertaken by the Henley Centre show the complexity of attempting to categorise consumers on a broad scale. Let’s take an example. At one level, results show that all consumers take pride in their family, so a global advertising campaign using the ‘family’ as a theme may feel like safe territory. To some extent it is. Dig down a bit deeper, however, and you find that different people define ‘family’ in very different ways, so what people take pride in will be subtly different. At a country level, many more differences expose themselves.
Businesses wanting to broaden their geographic reach have to consider at a strategic level what level of understanding of consumer needs they require. Generalisations are important and are a good place to start, but it is critical to then delve further – national stereotypes are too simplistic. Differences, rather than similarities, have to be considered, and interrogated in terms of how these will impact customer needs.
Source: The Henley Centre.
Tutorial Questions - Debate in classes
Based on this article and your experiences, debate the statement: ‘Site localisation is essential for each country for an e‐commerce offering to be successful in that country? please answer this question
In: Accounting
please answer all questions
1.) Which of the types of energies in the electromagnetic spectrum have the ability to ionize?
2.) What makes an x-ray photon higher energy than a microwave?
3.) State the wave equation
In: Physics
random sample of 33 33 professional baseball salaries from 1985 through 2015 was selected. The league of the player (American or National) was also recorded. Salary (in thousands of dollars) and league are shown in the accompanying table. Test the hypothesis that there is a difference in the mean salary of players in each league. Assume the distributions are Normal enough to use the t-test. Use a significance level of 0.05 0.05.
In: Math
A 1700kg car starts from rest and drives around a flat 68-m-diameter circular track. The forward force provided by the car's drive wheels is a constant1300N .
What is the magnitude of the car's acceleration at t=12s?
What is the direction of the car's acceleration at t=12s? Give the direction as an angle from the r-axis.
If the car has rubber tires and the track is concrete, at what time does the car begin to slide out of the circle?
In: Physics
What is use and purpose of financial analysis?
In: Accounting
Millions of Dollars) 2020 2019 Sales $ 13,000 $ 11,000 Operating costs excluding depreciation 11,564 9,722 Depreciation and amortization 420 370 Earnings before interest and taxes $ 1,016 $ 908 Less interest 260 200 Pre-tax income $ 756 $ 708 Taxes (25%) 189 177 Net income available to common stockholders $ 567 $ 531 Common dividends $ 201 $ 200 Rhodes Corporation: Balance Sheets as of December 31 (Millions of Dollars) 2020 2019 Assets Cash $ 650 $ 600 Short-term investments 110 100 Accounts receivable 2,750 2,500 Inventories 1,250 1,200 Total current assets $ 4,760 $ 4,400 Net plant and equipment 3,750 3,500 Total assets $ 8,510 $ 7,900 Liabilities and Equity Accounts payable $ 1,300 $ 1,200 Accruals 650 600 Notes payable 192 100 Total current liabilities $ 2,142 $ 1,900 Long-term debt 1,300 1,200 Total liabilities $ 3,442 3,100 Common stock 3,502 3,600 Retained earnings 1,566 1,200 Total common equity $ 5,068 $ 4,800 Total liabilities and equity $ 8,510 $ 7,900 Suppose the federal-plus-state tax corporate tax is 25%. Answer the following questions. What is the net operating profit after taxes (NOPAT) for 2020? Enter your answer in millions. For example, an answer of $1 million should be entered as 1, not 1,000,000. Round your answer to the nearest whole number. $ million What are the amounts of net operating working capital for both years? Enter your answers in millions. For example, an answer of $1 million should be entered as 1, not 1,000,000. Round your answers to the nearest whole number. 2020: $ million 2019: $ million What are the amounts of total net operating capital for both years? Enter your answers in millions. For example, an answer of $1 million should be entered as 1, not 1,000,000. Round your answers to the nearest whole number. 2020: $ million 2019: $ million What is the free cash flow for 2020? Enter your answer in millions. For example, an answer of $1 million should be entered as 1, not 1,000,000. Cash outflow, if any, should be indicated by a minus sign. Round your answer to the nearest whole number. $ million What is the ROIC for 2020? Round your answer to two decimal places. % How much of the FCF did Rhodes use
I have roc is 1.4% I'm told its wrong. im confued why my ROIC percentage is wrong
In: Finance
8. The reserve requirement, open market operations, and the moneysupply
Assume that banks do not hold excess reserves and that households do not hold currency, so the only form of money is demand deposits. To simplify the analysis, suppose the banking system has total reserves of $400. Determine the money multiplier and the money supply for each reserve requirement listed in the following table.
(CHART GOES RIGHT HERE INSTEAD OF THE Bottom)
A higher reserve requirement is associated with a (smaller/ larger) money supply.
Suppose the Federal Reserve wants to increase the money supply by $200. Again, you can assume that banks do not hold excess reserves and that households do not hold currency. If the reserve requirement is 10%, the Fed will use open-market operations to (buy/SEll). _______$ worth of U.S. government bonds.
Now, suppose that, rather than immediately lending out all excess reserves, banks begin holding some excess reserves due to uncertain economic conditions. Specifically, banks increase the percentage of deposits held as reserves from 10% to 25%. This increase in the reserve ratio causes the money multiplier to(FALL/RISE) to( 1, 2.5, 4,5,10) . Under these conditions, the Fed would need to (BUY/SELL) _________ $ worth of U.S. government bonds in order to increase the money supply by $200.
Which of the following statements help to explain why, in the real world, the Fed cannot precisely control the money supply? Check all that apply.
-The Fed cannot control whether and to what extent banks hold excess reserves.
-The Fed cannot control the amount of money that households choose to hold as currency.
-The Fed cannot prevent banks from lending out required reserves.
|
Reserve Requirement |
Simple Money Multiplier |
Money Supply |
|---|---|---|
|
(Percent) |
(Dollars) |
|
| 20 | ||
| 10 |
In: Economics
17) What is the difference between basalt and gabbro?
18) What is the difference between basalt and rhyolite?
19) Metamorphosed limestone is:
20) Identify the following rock type and subspecies within the rock types:
andesite
rock salt
granite
sandstone
gneiss
rhyolite
gabbro
schist
marble
quartzite
limestone
conglomerate
shale
slate
21) What is the rock cycle? A cycle that describes:
22) What aspects of sedimentary rocks could be used to reconstruct past environments?
23) What are found in sedimentary rocks that record the history of life on Earth?
In: Other
What is the pH of an aqueous solution with a hydrogen ion concentration of [H ] = 4.9 × 10–8 M?
In: Chemistry
what are some consequences of using community rating
In: Economics
| xx | 2020 | 2121 | 2222 | 2323 | 2424 |
| F(x)F(x) | 2121 | 44 | 55 | 88 | 22 |
Let xx be the ages of students in a class. Given the frequency
distribution F(x)F(x) above, determine the following
probabilities:
(a) P(x=22)=P(x=22)=
(b) P(x≥23 or x<21)=P(x≥23 or x<21)=
(c) P(20≤x<22)=P(20≤x<22)=
In: Math
In: Computer Science