Reference no: EM1373160
Write an ARM subroutine which will extract a substring from a string. You will need to use the library routine malloc to allocate memory for the new string.
The subroutine signature is:
char * mysubstring( char string[], int start, int end ) ;
where char string[] is the string to extract the substring from; it is passed into the ARM routine as a pointer in a1 to the first element of the character (byte) array,
int start is the first character to extract from the string to the substring; it is passed into the ARM routine as a value in a2,
int end is the last character to extract from the string to the substring; it is passed into the ARM routine as a value in a3.
The return is a pointer to the new string.
#include <stdio.h>
#include <stdlib.h>
extern char * mysubstring( char string[], intstart, int end ) ;
int main( intargc, char * argv[] )
{
chartosub[] = "this is the string to substring" ;
char * result ; /* pointer to new string */
result = mysubstring( tosub, 12, 17 ) ;
printf( "String: %s\nSubstring: %s\n", tosub, result ) ;
exit( 0 ) ;
}
To use the library routine malloc you need to calculate the number of bytes of memory you are requesting, put that number in a1 and blmalloc. Upon return from the library routine a1 will have a pointer to the allocated memory.
You may assume that the start and end values are within the string and malloc returns a proper pointer value.
Capital budgeting decisions and utility rate decisions
: If the expected returns for risk free asset and a risky asset are 4 percent and 17 percent respectively, what percentages of your money must be invested in risky asset and risk free asset, respectivel.
|
Design of the software
: Report of the software design and implement the software as per the design, and demonstrate it
|
Multiple choice question on wacc
: Brandon Corporation consists of two divisions of same size, and Brandon is 100% equity financed. Division A cost of equity capital is 9.8%, while Division B cost of equity capital is 14%.
|
Determine the risk premium and average risk premium
: Here are stock market and Treasury bill returns between 1997 and 2001, Determine the risk premium on common stock in each year?
|
Write an arm subroutine which allocate memory for new string
: Prepare an ARM subroutine which will extract a substring from a string and you will need to use the library routine malloc to allocate memory for the new string - CS252 Programming Assignment
|
Estimating cost of capital
: Canyon Corporation has two divisions: Division A makes up 50% of the company, while Division B makes up the other 50%. Canyon's beta is 1.2.
|
Determine the project irr and cost of capital
: Determine the project IRR and the cost of capital for the project? Does the accept reject decision using IRR agree with the decision using NPV?
|
Finding the arithmetic mean of returns
: Assume you know that someone invested $1,500 in the Ec140 mutual fund 10-years ago, Now you learn that their balance in the fund has increase to $9,245.
|
Question based on expected profit
: Suppose you know that there is a 40 percent probability that Microsoft will be selling for $22.50 three months from now and a 60 percent probability that it will be selling for $42.50.
|