#!/usr/bin/perl -w
use CGI qw(param);
print "Content-type: text/html\n\n";
print "
8 points\n";
my $cnfg = param("config");
my $mult1 = param("m1");
my $mult2 = param("m2");
my $mult3 = param("m3");
my $mult4 = param("m4");
my $mult5 = param("m5");
my $mult6 = param("m6");
my $mult7 = param("m7");
my $mult8 = param("m8");
$cnfg=int($cnfg);
$mult1=int($mult1);
$mult2=int($mult2);
$mult3=int($mult3);
$mult4=int($mult4);
$mult5=int($mult5);
$mult6=int($mult6);
$mult7=int($mult7);
$mult8=int($mult8);
print "Here is the configuration you entered:
\n";
print "$cnfg
\n";
if($cnfg > 146 || $cnfg < 1) {
print "You did not enter a valid value for the configuration.
\n";
print "Thus configuration 37 will be used by default.
\n";
$cnfg=37;
}
print "Here are the multiplicities you entered:
\n";
print "$mult1, $mult2, $mult3, $mult4, $mult5, $mult6, $mult7, $mult8
\n";
if($mult1 > 30) {
print "Your value for m1
is too large. Thus m1 = 3 will be used by default.
\n";
$mult1=3;
}
if($mult2 > 30) {
print "Your value for m2
is too large. Thus m2 = 3 will be used by default.
\n";
$mult2=3;
}
if($mult3 > 30) {
print "Your value for m3
is too large. Thus m3 = 3 will be used by default.
\n";
$mult3=3;
}
if($mult4 > 30) {
print "Your value for m4
is too large. Thus m4 = 3 will be used by default.
\n";
$mult4=3;
}
if($mult5 > 30) {
print "Your value for m5
is too large. Thus m5 = 3 will be used by default.
\n";
$mult5=3;
}
if($mult6 > 30) {
print "Your value for m6
is too large. Thus m6 = 3 will be used by default.
\n";
$mult6=3;
}
if($mult7 > 30) {
print "Your value for m7
is too large. Thus m7 = 3 will be used by default.
\n";
$mult7=3;
}
if($mult8 > 30) {
print "Your value for m8
is too large. Thus m8 = 3 will be used by default.
\n";
$mult8=3;
}
print "";
system("echo $cnfg $mult1 $mult2 $mult3 $mult4 $mult5 $mult6 $mult7 $mult8 | awk -f NEWRes8pointRevised");
print "
";
print "\n";