exxamer
exxamer
Untitled
8 posts
Don't wanna be here? Send us removal request.
exxamer · 3 years ago
Text
Maxmin princ.
#include<iostream.h>
#include<conio.h>
#include <math.h>
#include<iomanip.h> void main()
signed int a (5)(5) = (1750, 1125, 315, - 1125) ,
(0, 1500, 3000, 2250, 1500),
(-750.750,2250, 4125),
(-1500, 0, 1500, 3000, 4500) 17
inti,j.1, 1, mi, r[3], k
clrscr();
cout<<"\n The summery of DALLY Net Profit:-\n";
for (i=0;i<4;i++)
for(j=0; j<5; j++)
cout<<setw
cout<<endl;
cout<<"\n Rowwise Maximum: \n"
for (i=0;i<4;14+)
1 = a[1][0]
for(j=0:15; j++)
if(1 < a(1)(j)) 1=a(i11j\ )
x(1)^ =1
for (i=0;i<4 (71++) cout<<r[i]<<endl;
cout<<"\n Minimax value:
m=r[0];
for (i=1;i<4;i++)
if (m>r[i])
m=r[i];
cout<<m;
getch();
0 notes
exxamer · 3 years ago
Text
program to find best alternative when the intrestrate is 09 //mean and variance of each alternative
//alternative j (Rs)
1
2
//expected annual revenue (x5) 500000 //variance of annual revenue 1000000
400000
10000
#include<iostream.h>
#include<conio.h> #include<math.h>
void main()
clrscr();
double x1-500000, i2=400000. double v1=100000,v2=1000. cv1.cv2;
int i;
cout<<"mean and vantriance of each alternative":
cout<<"\n
\n":
cout<<"\n alternative 5(rs) backslash n^ prime prime 7
cout<<"\n
cout<<"\n 12
cout<<"\n
cout <<^ m 1 n\nexpected annual revenue (x!)"<x1 <<" "<<x2: cout<<"\n\n variance of annual revenue ( j)"<<v l<<"<w2z
cout<<"\n\n
cvi-sqrt(v1)/x1; Cv2-sqrt (v2)/x2;
if (cvl>cv2)
cout<<"\n\n the coefficient of variation of alternative
cout<<"\n is lesser than that of alternative 1:"<<<cv2;
An":
else cout<<"\n the coefficient of variation of alternative1:"<<cv2:cout<<"\n is lesser than that of alternative 2:"<<cv1:
getch();
0 notes
exxamer · 3 years ago
Text
WAP FOR MINMAX
#include<iostream.h> #include<conio.h>
#include <math.h>
void main()
signed int a 15115]=1750,1125 , 375,-375,-1125), 10, 1500, 10, 225epsilon , 1500),
(-750,750,2250,412^ .
(-1500,0,1500,300,4^ 2 89\ 12
inti,s,j,1 ,m,ml,r151,k; clrscr();
cout<<"\n The summery of DALLY Net Profit:-\n";
for (1-0;1<4;1++)
for(j=0; j<5; j++)
cout <a[i]\ j]<<^ prime prime ; cout<<endl;
cout<<"\n Rowwise Maximum: \n":
for (1m0:1<4/+*)
swa[i][0];
for (3=0; j<5;3+*
if (g<a(111j)
s-a[1] (317
1
for (i=0;i<4;3+*
cout <<r[1] <<endl; cout<<" in Hammin valum:
101 2
for (11;i<;**if (m>r[i])
m=r[i];
}
}
cout<<m;
getch();
0 notes
exxamer · 3 years ago
Text
B1 PROGRAM FOR HURWICZ CRITERIA.
#include<iostream.h>
#include<conio.h>
#include<iomanip.h>
class hurviCE
private :
int A[100] [100] .1,1,m,n,r,r1, intsmall .1,L[100) , large, a[100], h[100];
public :
void getdata (void);
void disp(void);
void hurwicz :: getdata(void)
cout<<"\n\n\t Enter the size of Matrix. ";
cout<<"\n\n\t Number of row's: ";
cin>>m;
cout<<"\n\n\t Number of col's: "
|n>>0;
for i=0:i<m:i++)
for (j=0;j<n;j++)
cout<<"\n\n\t Enter the value for row "<<+<<" : "
cin>>A[1 1(31;
void hurwicz :: disp(void)
int min-0, max=0;
float alpha 0.5;
large = 0;
small 9999:
for (i=0;i<n;i++)
large 0:
small 9999;
for(j=0; j<n; j++)
if(large-A[1151
large large;
L[1] large;
else
large A[i](31:
L[i] = large;
if (small<-A[4] [])
small small;
s[i] = small;
else
small=A[i][j];
s[i] small;
for(i=0; i<m; i++)
h[i] (float(alpha) *L[1])+(float (1-alpha) s[1]);
min = h[01:
max=h[0];
for (i=0:1<m:1++)
Lf(min<=h(11)
min minz
else
min hlil;
if(max > - h * (1))
max max;
else
max - hlil;
for(i=0;i<m:1++)
if(h(1) = min)
r = i + 1
for (i=0;i<m;i++)
if(h[i] = max)
r1=l+1.
cout<<"\n\n\t Your entered matrix is :\tit Maximum Minimum": cout<<" hurwicz";
cout<<"\n\n\t\t\t";
for (i=0;i<m;i++)
cout<<" A"<<i+l<<" ->";
for(j=0; j<n; j++)
cout<<" "<<setw r(4)<<A1 perp1/j] :
cout<<" "<<setw(4)<<L[1]<<^ prime prime "<<setw(4) <<s[1]; cout<<" " <setw(4)<<h(1):
cout<<"\n\ n|t|t|t^ prime prime
cout<<"\n\n\t Maximum is coaxi
cout<<"\ |n|+30. for profit the answer is : A"<<rice"
A1xeraxive=.
cout<<"\n\n\n\n\t And Minimin is "<<mini cout<<"\n\n\t So, for cost the answer is: A"<< r<"Altarmativen."
void main()
cirser();
hurwicz h;
h.getdata(); clrscr();
h.disp();
getch();
0 notes
exxamer · 3 years ago
Text
10) Write a program to implement queue using linked list
#include<iostream.h>#include<conio.h#include<stdio.h> //using namespace std: struct node
int data:
node*next:
1*front NULL, "rear-NULL, "p-NULL, "np-HULL;
void push(int x)
np new node:
n_{0} = 2 data-x:
mp->next-NULL; if (front==NULL)
front rear =np; rear->next-NULL;
else{rear-> \{t = n\} :
rear np:
rear->next 9015L_{1}
int remove()
int x;
if(fron t==||0Lt)
cout <^ prime prime empty queue 1n^ prime prime ;
else {p=front: front-front->next;
X= p->data;
delete (p):return (x);}}
int main()
int n, c 0.x, true;
cout<<"enter the value to be pushed in to queuein";cin>>n;while (c<n)cout<<"enter the value to be entered in to queue\n";
push (x);cout<<"\n\nremoved value\n\n"; while(true)
if(front !=NULL)
cout<<remove () <<endl;
else
break;
getch()1
0 notes
exxamer · 3 years ago
Text
Write a program for simple Inventory.
#include<iostream.h>
#include<iomanip.h>
#include<conio.h>
define MAX PEC 10
class Inventory
{
char itemname (151;
int code:
double cost:
public:
void getdata();
void showdata();
};
void Inventory::getdata()
{
cout<<"\nenter item name:"; cin>>itemname;
cout<<"enter code:";
cin>>code;
cout<<"enter cost :":
cin>>cost;
}
void Inventory :: showdata() (
cout<<endl;
cout.width (15);
cout.setf(los::left, ios::adjustfield):
cout<<citemname;
cout.width (8) ;
cout<<code;
cout.width (15);
cout.setf(ios::right, los::adjustfieldi;
cout.setf(los::showpoint); cout.setf(los::fixed, ios::floatfield;
cout.precision (2);
cout<<cost;
}
Void main()
{
Inventory record [MAX_REC];
inti, n
clrscr();
cout<<"\n......inventory management....\n";
cout<<"\n how many record to be created:";
cin>>n;
cout<<"enter "<<n<<"recordin":
for(i=0; 1<n;1++
record[i].getdata();
cout<<"\n\n......stock information...... ln^ prime prime :
cout<<"\n"<<setw (8) <<"Itemname"
<<setw (10)<<"cost"
<<setw (19)<<"cost"<<end1;
cout <<^ 11 .........."
for (i= 0;i<n;i++)
record[1].showdata();
getch():
}
0 notes
exxamer · 3 years ago
Text
Write a program for minimal principal
#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
signed int a[5][5]={{750,1125,375,-375,-1125},
{0,1500,3000,2250,1500},
{-750,750,2250,4125},
{-1500,0,1500,3000,4500}};
int i,s,j,l,m,mi,r[5],k;
clrscr();
cout<<"the summary of daily net profit:=";
for(i=0;i<4;i++)
{
for(j=0;j<5;j++)
cout<<a[i][j];
cout<<endl;
}
cout<<"rowwise maximum:";
for(i=0;i<4;i++)
{
s=a[i][0];
for(j=0;j<5;j++)
{
if(s<a[i][j])
s=a[i][j];
r[i]=s;
}
}
for(i=0;i<4;i++)
cout<<r[i]<<endl;
cout<<"maxmin value:-";
m=r[0];
for(i=1;i<4;i++)
{
if(m>r[i])
{
m=r[i];
}
}
cout<<m;
getch();
}
0 notes
exxamer · 3 years ago
Text
Q.1) Wap to demonstrate the determination of mixed strategies (2*2 matrix).
#include<iostream.h>
#include<conio.h>
#include <math.h>
void main
{
lnt a[ 2][ 2]={ (6,9),(8,4) } ; float rl,cl, i, j, n,m, s,l, c[2], r[2],rp[2],cp[2], V;
clrscr():
cout <<" prime prime backslash r the element in a given array: \n";
for ( i=0:i<2:i++)
{
for(j=0; j<2;j++)
{
Cout<<a[i][j]<<" ";
cout<<endl;
}
n = 0;
for(i=1;i>=0;i--)
{
for(j=0; j<2;j++)
{
r[n]=abs(a [i][0]-a[i][j]);
n++;
cout<<"\n Rowwise Oddments: \n";
for (int p=0;p<=n-1;p++)
{
cout<<r [p]<<endl;
}
m = 0 ;
for(j=1;j>=0;j--)
{
for(i=0;1<2;1++)
{
c[m]=abs(a[0][j]-a[1][j]) ;
m++;
}
cout<<"\n columnwise oddments: \n";
for (int q=0;q<m;q++)
{
cout<<c [q]<<endl;
}
s = 0;
for(i=0;i<2; i++)
{
s=s+r[1];
}
for(i=0;i<2;i++)
{
rp[i] = r[i] / s ;
}
s = 0;
for (i=0;i<2; i++)
{
s = s + c[i] ;
}
for (i=0;i<2; i++)
{
cp[i] = c[i] / s;
}
cout<<"\n the strategies of player A is:";
for (i=0;i<2;i++) cout<<rp[i]<<" ";
cout <"\ n the strategies of player B is:";
for(i=0;i<2;i++)
cout<<cp[i]<<" ";
V=((a[0][0]*rp[0])+(a[1][0]*rp[1]))/(rp[1]+rp[0]);
cout<<"\n\n The value of the game; "<<V;
getch();
}
1 note · View note