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

  Rectangle data class and an executable program to test

For this assignment you are to create a Rectangle data class and an executable program to test

  Program to generate a random number between a range

Write down a program to generate random number between 1 and 100 and asks user to guess what number is.

  Design program to calculate amount of money spend

Design a program that calculates the amount of money a person would earn over a period of time if his or her salary is one penny the first day, two pennies the second day.

  Develop a functional web-based application for a calculator

Develop a functional web-based application for a calculator. It does not need to be live; you can provide JavaScript, CSS, and HTML files. The calculator should successfully complete addition, subtraction, multiplication, and division operations.

  Write program to enter last names of five candidates

Write down the program which permits the user to enter last names of five candidates in local election and number of votes received by each candidate.

  Write a program using binary search approach

Write a program using binary search approach

  Advantages of the common language runtime

What are the advantages of the Common Language Runtime in .NET

  What is sequential flow of a program

What is sequential flow of a program? What is branching within a program? How is branching controlled? What is the role of an if statement in control structures

  Use the linked stack class to support

Use the Linked stack class to support an application that tracks the status of an online auction. Budding begins at 1(dollars, pounds, euros, or whatever) and proceeds in increments of at least 1

  Write a program that prompts for and reads an amount

Write a program that prompts for and reads an amount (integer) for Canadian dollars and convert the amount to Euros. The exchange rate is 1.

  Program to calculate area of two-dimensional shape

Implement the Shape hierarchy shown in following figure. Each TwoDimensionalShape should contain method getArea to calculate the area of the two-dimensional shape.

  Create application to read file containing same product id

Create the application which reads the file of inventory information comprising product ID and quantity. File can contain numerous entries for same Product ID.

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