> IntDay is suppose to be .000211, OptPoint 126101.72 and UpperLimit 178305.16

And what are we supposed to type in for these variables

- CashDemand

- TransactionCost

- Interest

- AmountCash

- DailyCashFlow

This is the original code.

Code:

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
float CashDemand, TransactionCost, Interest, CashReplenishB, AmountCash, DailyCashFlow, IntDay, OptPoint, UpperLimit;
printf("Enter annual cash demand in dollars:\n"); scanf("%f", &CashDemand);
printf("Enter transaction cost for marketable securities sales:\n"); scanf("%f", &TransactionCost);
printf("Enter the interest that securities can earn as a decimal:\n"); scanf("%f", &Interest);
CashReplenishB=sqrt((2*TransactionCost*CashDemand)/Interest);
printf("The optimal cash replenishment level from the Baumol Model is $ %.2f.\n\n\n", CashReplenishB);
printf("What amount of cash do you want kept on hand:\n"); scanf("%f", &AmountCash);
printf("What is the standard deviation of expected daily cash flows:\n"); scanf("%f", &DailyCashFlow);
IntDay=pow(1+Interest,365);
OptPoint=pow((3*TransactionCost*pow(DailyCashFlow,2))/(4*IntDay),3)+AmountCash;
UpperLimit=(3*OptPoint)-(2*AmountCash);
printf("The daily securities interest rate is $ %.2f.", IntDay);
printf("The optimal cash return point using the Miller-Orr Model is $ %.2f.\n", OptPoint);
printf("The upper limit for the cash balance using the Miller-Orr Model is $ %.2f.\n", UpperLimit);
}

This is the code with some sane formatting applied.

Code:

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
float CashDemand, TransactionCost, Interest, CashReplenishB, AmountCash,
DailyCashFlow, IntDay, OptPoint, UpperLimit;
printf("Enter annual cash demand in dollars:\n");
scanf("%f", &CashDemand);
printf("Enter transaction cost for marketable securities sales:\n");
scanf("%f", &TransactionCost);
printf("Enter the interest that securities can earn as a decimal:\n");
scanf("%f", &Interest);
CashReplenishB = sqrt((2 * TransactionCost * CashDemand) / Interest);
printf("The optimal cash replenishment level from the Baumol Model is $ %.2f.\n\n\n",
CashReplenishB);
printf("What amount of cash do you want kept on hand:\n");
scanf("%f", &AmountCash);
printf("What is the standard deviation of expected daily cash flows:\n");
scanf("%f", &DailyCashFlow);
IntDay = pow(1 + Interest, 365);
OptPoint = pow( (3 * TransactionCost * pow(DailyCashFlow, 2)) /
(4 * IntDay),3 )
+ AmountCash;
UpperLimit = (3 * OptPoint) - (2 * AmountCash);
printf("The daily securities interest rate is $ %.2f.", IntDay);
printf("The optimal cash return point using the Miller-Orr Model is $ %.2f.\n",
OptPoint);
printf("The upper limit for the cash balance using the Miller-Orr Model is $ %.2f.\n",
UpperLimit);
}