Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

$server

ID: 3621779 • Letter: #

Question

The first part of this program should allow the user to enter a student’s last name and five test scores. The program should accept student data until the word “done” is entered for the student name. This data should be printed to the screen in tabular format. The data also should be stored in a file. One student data be stored per line.

Second part of this program should read the data from the file. The program should calculate each student’s average and the class average. The program should print the results to the screen. Please help solve this program with JES-python.

Explanation / Answer

#!/usr/bin/perl -w use strict; use CGI qw(:standard); use CGI::Carp; # Use the DBI module use DBI; CGI::use_named_parameters(1); my ($server, $sock, $host); my $output = new CGI; $server = param('server') or $server = ''; # Prepare the MySQL DBD driver my $driver = DBI->install_driver('mysql'); my @databases = $driver->func($server, '_ListDBs'); # If @databases is undefined we assume # that means that the host does not have # a running MySQL server. However, there could be other reasons # for the failure. You can find a complete error message by # checking $DBI::errmsg. if (not @databases) { print header, start_html('title'=>"Information on $server", 'BGCOLOR'=>'white'); print 'white'); print