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

  Prepare console application to examine contents of text file

Prepare the C++ console application which examines the contents of a text file. Your program must count the number of: * lines (hint: use getline).

  Discuss the feasibility and practicality

In Coffee's (2006) article, IT professionals discuss the role application developers take in software security. Pick one of these IT experts, summarize his or her perspective on building security into software, and then discuss the feasibility and..

  Calculator to do the suitable matrix exponentiation

Every company makes particular restrictions for passwords, but employees of ABC have particularly strange restrictions. Their passwords may only consist of the lowercase letters

  Write a report document for the hvac controller

write a report document for the HVAC Controller and To use integrated modular programming techniques in developing the project

  Determine recursive procedure and iterative procedure

Determine the example or recursive procedure and represent it as iterative procedure. Also, select the iterative procedure which you would re-write as recursive.

  Draw the class diagram for your modi ed system

Explain what is wrong. Modify the system so that it conforms to the pattern. Explain each of the changes you made to the system. Draw the class diagram for your modi ed system.

  Write program for real estate agent

Write a program for a real estate agent. The program should perform the following tasks: ask users for the average house price for the each of past 5 years for a single family residence of 1500 square feet.

  Write console application that displays the sizes

Create a file that contains your favorite movie quote.  Use a text editor such as Notepad and save the file as Quote.txt.  Copy the file contents and paste them into a word-processing program such as Word.

  Write a program that calculates a cars gas mileage

Write a program that calculates a car's gas mileage - The program should ask the user to enter the number of gallons of gas the car hold and the number of miles it can be driven on a full tank.

  Design and implement an automobile class along with subclass

Design and implement an automobile class along with four subclasses using the following guidelines: Create a class named Automobile and four subclasses. They can be any named anything you want that is considered an automobile. You can use brand nam..

  Explain about lexical analyzer

Explain about Lexical Analyzer

  Program to ask how many games are being purchased

Your program should ask the store clerk how many games are being purchased and calculate a total due (with 6% tax). The total number of games, the discount amount.

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