/* Engine Driven Module Program
* By Billy Stiltner
*/
//[[[[[[[[[[[[[[[[[[[[[[[[[[<Setup Module>]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
#include <iostream.h>
#include <conio.h>
int state;
int _state;
int count;
int wait;
long double a1,b1,c1,a2,b2,c2,a3,b3,c3,z1,z2,z3,k1,k2,k3;
long double x,y,z,detn;
int input_mod(void);
int trip_simul(void);
int exit_mod(void);
//[[[[[[[[[[[[[[[[[[[[[[[[[[<<<<<<<>>>>>>>]]]]]]]]]]]]]]]]]]]]]]]]]]]]]*/
//[[[[[[[[[[[[[[[[[[[[[[[[[[<Engine Module>]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
main()
{
count=0;
while (count<100)
{//++++++++++++++++++++++<Engine Loop>+++++++++++++++++++++++++
switch (_state)
{
case 0:{
input_mod();
break;
};
case 1:{
trip_simul();
break;
};
case 2:{
exit_mod();
break;
};
};
};//++++++++++++++++++++++<<<<<<<>>>>>>+++++++++++++++++++++++++
return(0);
};
//[[[[[[[[[[[[[[[[[[[[[[[[[[<<<<<<<>>>>>>>]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
// <<<<input_mod>>>>
int input_mod(void)
{
clrscr();
cout<<"1 for a triple simultaneous equation 2 for exit ";
cin>>_state;
return(_state);
};
// <<<<<<<>>>>>>>
// <<<<trip_sim>>>>
int trip_simul(void)
{
clrscr();
cout<<"a1*x+b1*y+c1*z=k1\n";
cout<<"a2*x+b2*y+c2*z=k2\n";
cout<<"a3*x+b3*y+c3*z=k3\n";
cout<<"\nwhat is a1 = ";
cin>>a1;
cout<<"what is b1 = ";
cin>>b1;
cout<<"what is c1 = ";
cin>>c1;
cout<<"what is k1 = ";
cin>>k1;
cout<<"\nwhat is a2 = ";
cin>>a2;
cout<<"what is b2 = ";
cin>>b2;
cout<<"what is c2 = ";
cin>>c2;
cout<<"what is k2 = ";
cin>>k2;
cout<<"\nwhat is a3 = ";
cin>>a3;
cout<<"what is b3 = ";
cin>>b3;
cout<<"what is c3 = ";
cin>>c3;
cout<<"what is k3 = ";
cin>>k3;
detn=(((a1*b2*c3)+(b1*c2*a3)+(c1*a2*b3))-((a3*b2*c1)+(b3*c2*a1)+(c3*a2*b1)));
x=((((k1*b2*c3)+(b1*c2*k3)+(c1*k2*b3))-((k3*b2*c1)+(b3*c2*k1)+(c3*k2*b1)))/detn);
y=((((a1*k2*c3)+(k1*c2*a3)+(c1*a2*k3))-((a3*k2*c1)+(k3*c2*a1)+(c3*a2*k1)))/detn);
z=((((a1*b2*k3)+(b1*k2*a3)+(k1*a2*b3))-((a3*b2*k1)+(b3*k2*a1)+(k3*a2*b1)))/detn);
cout<<"\nx = "<<x<<"\n";
cout<<"y = "<<y<<"\n";
cout<<"z = "<<z<<"\n";
getch();
_state=0;
return(_state);
};
// <<<<<<<>>>>>>>
int exit_mod(void)
{
cout<<"see ya";
count = 101;
return (count);
};
//cgidir copyright 1996 Billy Stiltner
#include <stdio.h>
#include "g:\bc45\cgic\cgic105\cgic.h"
#include <dir.h>
#include <dos.h>
FILE *in, *out;
struct ffblk f;
char drive[3],dir[66],name[9],ext[5];
int done;
char pathname[81];
char ConfigUrl[255];
char ConfigDir[255];
int cgiMain() {
#if DEBUG
/* Load a saved CGI scenario if we're debugging */
cgiReadEnvironment("/home/boutell/public_html/capcgi.dat");
#endif
cgiHeaderContentType("text/html");
/*cgiHeaderLocation("
http://206.151.77.100/output.htm");*/
fprintf(cgiOut, "<HTML><HEAD>\n");
fprintf(cgiOut, "<TITLE>Stiltner's Web Directory</TITLE></HEAD>\n");
fprintf(cgiOut, "<BODY>Stiltner's Web Directory Copyright 1996 Billy Stiltner<BR>\n");
if((in = fopen("\\cgidir\\cgidir.cfg", "r+")) == NULL)
{
fprintf(cgiOut, "Cannot open configuration file.\n");
return 1;
}else{
fgets(ConfigUrl,255,in);
fgets(ConfigDir,255,in);
fprintf(cgiOut,ConfigUrl);
fprintf(cgiOut,ConfigDir);
// fprintf(cgiOut, "<form method=\"POST\" action=\"
http://206.151.77.100/scripts/cgidir.exe\">");
fprintf(cgiOut, "<form method=\"POST\" action=");
fprintf(cgiOut, ConfigUrl);
fprintf(cgiOut, ">");
};
fprintf(cgiOut, "<HR><BR>\n");
cgiFormStringNoNewlines("pathname", pathname, 81);
fprintf(cgiOut, "Directory of %s<BR>\n", pathname);
fprintf(cgiOut, "<HR>");
done = findfirst(pathname,&f,63);
while (!done)
{
fnsplit(f.ff_name,drive,dir,name,ext);
if(f.ff_attrib==FA_DIREC){
fprintf(cgiOut,"<IMG SRC=\"/dir.gif\" HEIGHT=13 WIDTH=15>");
}else{
fprintf(cgiOut,"<IMG SRC=\"/file.gif\" HEIGHT=16 WIDTH=13>");};
fprintf(cgiOut, f.ff_name);
fprintf(cgiOut, "<BR>\n");
done = findnext(&f);
}
fprintf(cgiOut, "<HR>");
fprintf(cgiOut, "Path:<input type=\"text\" name=\"pathname\"><BR>\n<BR>\n");
fprintf(cgiOut, "<input type=\"submit\" name=\"submit1\" value=\"Get Directory\">");
fprintf(cgiOut, "</form>");
fprintf(cgiOut, "</BODY></HTML>\n");
return 0;
}