Questions
Write a C++ program that inputs (cin) a word from the keyboard and generates several different...

Write a C++ program that inputs (cin) a word from the keyboard and generates several different scrambles of the word without using vectors. The input word can be from 4 to 10 letters in length. The number of scrambles produced depends on the number of letters in the word. e.g. the 4 letter word “lose” would have 4 different scrambles produced and the seven letter word “edition” would have seven different scrambles.

Here is a candidate example:     

Input: FLOOR

                Scrambles: ROOLF, OOLFR, OLFRO, LOORF, OORFL

Your program must use the same block of code for each input word. There is also the rand() random number generator available.

Test you program with these words:

salt
asteroid
manipulate

In: Computer Science

a six month call on stock of abc ltd with an exercise proce of 100 rupees...

a six month call on stock of abc ltd with an exercise proce of 100 rupees sold for rs 8. the stock price is 80. the risk free interest rate is 6% per annum. how much would u pay for a put option on the stock of abc ltd. with same maturity and exercise price? what would u do if the actual price is dfifferent from what u are willing to pay

In: Finance

The current price of a non-dividend paying stock is $90. Use a two-step binomial tree to...

The current price of a non-dividend paying stock is $90. Use a two-step binomial tree to value a European call option on the stock with a strike price of $88 that expires in 6 months. Each step is 3 months, the risk free rate is 5% per annum with continuous compounding. What is the option price when u = 1.2 and d = 0.8? Assume that the option is written on 100 shares of stock.

In: Finance

Suppose you want to value a European put option under the following assumptions: stock price is...

Suppose you want to value a European put option under the following assumptions: stock price is $100, exercise price is $95, interest rate is 10% per year, dividend yield is 0, time to maturity is 3 months, standard deviation is .5 per year. What is the price of this put using Black-Scholes model?A. $4.88 B. $6.35 C. $10.32 D. None of the above

In: Finance

Keiser University has warrants in the market that allows people who own it to be authorized...

Keiser University has warrants in the market that allows people who own it to be authorized to buy 1 share of the university at the price of $ 25.

a) Calculate the execution value of the organization's warrants if the common shares are sold each at the following prices: (1) $ 20, (2) $ 25, (3) $ 30), (4) $ 100. (The warrant's execution value is the difference between the price of the shares and the purchase price specified by the warrant if the authorization is executed.)

In: Finance

Consider a stock with a price of $120 and a standard deviation of 30 percent. The...

Consider a stock with a price of $120 and a standard deviation of 30 percent. The stock will pay a dividend of $5 in 40 days and a second dividend of $5 and 140 days. The current risk-free rate is 6 percent per annum. An American call on this stock has an exercise price of $150 and expires in 100 days.
Price the American call option using the Black-Scholes Model. Show all calculations

In: Finance

The use of computers in education is referred to as computer-assisted instruction (CAI). More sophisticated CAI...

The use of computers in education is referred to as computer-assisted instruction (CAI). More sophisticated CAI systems monitor the student’s performance over a period of time. The decision to begin a new topic is often based on the student’s success with previous topics. Modify the c++ program which I included to count the number of correct and incorrect responses typed by the student. After the student types 5 answers, your program should calculate the percentage of correct responses. If the percentage is lower than 75 percent, your program should print “Please ask for extra help” and then terminate. If the percentage is 75 percent or higher, your program should print “Good work!” and then terminate.

#include<bits/stdc++.h> //headerfile
using namespace std;
int main(){
int cont=0;
while(cont<5){ //we will come out of loop when we get 5 correct answers
// This program will create different sequence of
// random numbers on every program run because of srand
   srand(time(0));
int x=rand()%10; //we took modulo 10 because all numbers should be between 0 to 9
int y=rand()%10;
cout<<"How much is "<<x<<"*"<<y<<"?"<<endl;
  
int out;
int res=x*y;//actual output
cin>>out; //we enter the result as output
if(res==out){ //if actual output matches our solution
   cout<<"Very good!"<<endl;
cont++;
}else{ //if actual output doesn't match our solution
while(res!=out){ //we will repeatedly ask the user same question till we get answer
   cout<<"No. Please try again."<<endl;
cout<<"How much is "<<x<<"*"<<y<<"?"<<endl;
cin>>out;
}
cont++;
}   
}
}

In: Computer Science

C Program: (Knapsack Exhaustive): How do I add the 5 random generated values into the val...

C Program: (Knapsack Exhaustive): How do I add the 5 random generated values into the val [] arrays and how to add the total maximum weights ?

   // returns maximum of two integers
   int max(int a, int b) { return (a > b)? a : b; }
  
   // Returns the maximum value that can be put in a knapsack of capacity W
   int knapSackExhaustive(int W, int wt[], int val[], int n){
  

if (n == 0 || W == 0)
return 0;
  
// If weight of the nth item is more than Knapsack capacity W, then
// this item cannot be included
if (wt[n-1] > W)
return knapSackExhaustive(W, wt, val, n-1);

else return max( val[n-1] + knapSackExhaustive(W-wt[n-1], wt, val, n-1),
knapSackExhaustive(W, wt, val, n-1)
);

}
  

int main() {
  
  
int i;
time_t t;


//Intializes random number generator
srand((unsigned) time(&t));

// Print 5 random values from 3 to 15
int q;
printf("Five Random Values:\n");
for( i = 0 ; i < 5 ; i++ ) {
int q=printf(" %d\n",rand() % 15+2);
}
int val[]= {i};

   int j;
   //Print 5 random weights from 1 and 10000
   printf("Five Random Weights:\n");
for( j = 0 ; j < 5 ; j++ ) {
printf(" %d\n", rand() % 10000);
}

int wt[]={j};

  
int W = 10000;
int n = sizeof(val)/sizeof(val[0]);
n = sizeof(wt)/sizeof(wt[0]);
  
printf("Total Value: %d\t\n", knapSackExhaustive(W, wt, val, n));

printf("Total Weight:\t");

return 0;
}

In: Computer Science

Farmer Uris is currently a grain farmer producing maize. The farmer wants to use 100 hectares...

Farmer Uris is currently a grain farmer producing maize. The farmer wants to use 100 hectares of the total land available for maize production to plant pastures. These 100 hectares of pastures will then be used keep 20 dairy cattle to be bought at N$ 7 000 each. Each dairy cow is expected to produce 10 litres of milk per day. The price of milk is N$ 8/litre. Opportunity cost of this investment is estimated at 18% of the cost of the dairy animals.
The average yield of maize in the area is 2.5t/ha and the maize price is N$ 950 per ton. The costs involved in keeping dairy animals on the 100 ha of pasture are the following:

• Labour. N$ 4, 500.00
• Vet and medicine. N$ 1, 800.00
• Pasture seed and fertilizer. N$ 5, 100.00

The costs involved to produce maize on the 100 hectares of land are the following:
• Grain seed and fertilizer. N$ 60, 000
• Labour. N$ 22, 000
• Machinery. N$ 62, 000
• Pesticides. N$ 38, 000

Required: Use the information provided above to compile a partial budget for farmer Uris to test the feasibility of switching from grain production to dairy production on the 100 hectares of pasture. What will be your recommendations to Mr Uris?

In: Accounting

8. Given Qd = 100 PiQs = 20 + 3P, draw the diagram and answer the...

8. Given Qd = 100 PiQs = 20 + 3P, draw the diagram and answer the following questions!

What is the autarky price and quantity produced?

What is the Welfare of the country as a whole before trade?

If the world Price is $60, is this country a net importer or exporter? _________

And by how much? _________

What is the welfare of the country after trade? ____________

What is the net gain from trade?__________

9.The following relations describe monthly demand and supply for a computer support service catering to small businesses.

Qd= 3000 – 10P

Qs= -1000 + 10P

What is the autarky price and quantity produced?

What is the Welfare of the country as a whole before trade? ________________

If the world Price is $250, is this country a net importer or exporter? _________

And by how much? _________

What is the welfare of the country after trade? ____________

What is the net gain from trade?

10. The following relations describes the demand and supply for good x..

Qd= 100 – 20P

Qs= 20 + 20P

What is the autarky price and quantity produced?

What is the Welfare of the country as a whole before trade?

If the world Price is $1, is this country a net importer or exporter?

And by how much?

What is the welfare of the country after trade?

What is the net gain from trade? __________

In: Economics