#!/usr/bin/perl -w
use CGI qw(param);

print "Content-type: text/html\n\n";
print "<html><head><title>7 points</title></head><body bgcolor=white>\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");

$cnfg=int($cnfg);
$mult1=int($mult1);
$mult2=int($mult2);
$mult3=int($mult3);
$mult4=int($mult4);
$mult5=int($mult5);
$mult6=int($mult6);
$mult7=int($mult7);

print "Here is the configuration you entered: <br>\n";
print "$cnfg<br>\n";

if($cnfg > 29 || $cnfg < 1) {
print "You did not enter a valid value for the configuration.<br>\n";
print "Thus configuration 17 will be used by default.<br>\n";
$cnfg=17;
}

print "Here are the multiplicities you entered: <br>\n";
print "$mult1, $mult2, $mult3, $mult4, $mult5, $mult6, $mult7<br>\n";

if($mult1 > 30) {
print "Your value for m<sub>1</sub><br> is too large. Thus m<sub>1</sub> = 3 will be used by default.<br>\n";
$mult1=3;
}

if($mult2 > 30) {
print "Your value for m<sub>2</sub><br> is too large. Thus m<sub>2</sub> = 3 will be used by default.<br>\n";
$mult2=3;
}

if($mult3 > 30) {
print "Your value for m<sub>3</sub><br> is too large. Thus m<sub>3</sub> = 3 will be used by default.<br>\n";
$mult3=3;
}

if($mult4 > 30) {
print "Your value for m<sub>4</sub><br> is too large. Thus m<sub>4</sub> = 3 will be used by default.<br>\n";
$mult4=3;
}

if($mult5 > 30) {
print "Your value for m<sub>5</sub><br> is too large. Thus m<sub>5</sub> = 3 will be used by default.<br>\n";
$mult5=3;
}

if($mult6 > 30) {
print "Your value for m<sub>6</sub><br> is too large. Thus m<sub>6</sub> = 3 will be used by default.<br>\n";
$mult6=3;
}

if($mult7 > 30) {
print "Your value for m<sub>7</sub><br> is too large. Thus m<sub>7</sub> = 3 will be used by default.<br>\n";
$mult7=3;
}

print "<pre>";
system("echo $cnfg $mult1 $mult2 $mult3 $mult4 $mult5 $mult6 $mult7 | awk -f NEWawk7pointRevised");
print "</pre>";

print "</body></html>\n";


