Create a script processes the data submitted using form

Assignment Help Programming Languages
Reference no: EM13935404

New to PERL so I'm suppose to create a script that processes the data (name and number of hours worked during the month) submitted using an online form.The script calculates the number of weeks, days, and hours worked during the month, then displays the form data and the results of the calculations.

I keep getting this compilation error -

"Can't modify division (/) in scalar assignment near $weeks"

Here's my code:
use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser);
$query = new CGI;

# Variables
my $name; #Employee's name
my $hours; #Hours Worked per month
my $weeks;
my $days;
my $hour;
my $remainder;

#Read the user's form input
$name = $query->param('name');
$hours = $query->param('hrs');

#Calculations
$hours /40 = $weeks;
$remainder = ($hours % 40);
($remainder / 8) = $days;
($remainder / 5) = $hour;

#HTML response to user
print "Content-type:text/htmlrnrn";
print "<HTML><BODY>n";
print "Hello, $name.n";
print "You have entered a total of $hours work hours.n";
print "For this month, you have worked $weeks week/s, $days days, and $hour hours.n";
print "</BODY></HTML>n";

 

Reference no: EM13935404

Questions Cloud

Program in perl that have two subroutines add() and multiply : Write a program in PERL that have two subroutines add() and multiply() that will add or multiply its arguments and print the result to screen.
What are acute and convalescent sera : What are acute and convalescent sera? Why must both be tested to make a serological diagnosis of infectious disease? What is the difference between an agglutination test and a precipitation test?
Strategic integration of hr in an organisation : You are asked to prepare a report on the strategic integration of HR in an organisation that you can obtain access to.Choose a current company in Australia or Overseas.
Describing how oxygen moves into cells : Write a 250- to 300-word summary describing how oxygen moves into cells and how carbon dioxide moves out of cells. Explain how water can be balanced between cells and how large molecules can be transported across membranes
Create a script processes the data submitted using form : New to PERL so I'm suppose to create a script that processes the data (name and number of hours worked during the month) submitted using an online form.The script calculates the number of weeks, days, and hours worked during the month, then displa..
Reconcile the sum of the two costs in part b : Reconcile the sum of the two costs in part b to the sum of beginning Work in Process and costs added in May.
What percentage of population was affected by hiv/aids : Have there been instances of any historical outbreaks of HIV/AIDS? How was the HIV/AIDS handled and controlled in your community? What were the objectives and goals of your public education plan to control of HIV/AIDS?
Discuss the ajax model in relation to good software design : Discuss the AJAX model in relation to good software design, and the essence of the quoted question. Will AJAX further promote the development of Web based software, or is it just another fad?
Write a brief explanation of why the people are healthy : Write a brief explanation of why the people are healthy or ill. Write two lists of words (terms, phrases/features) used for explaining why a person is healthy or ill

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd