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

  Program to read list up to hundred addresses

efine a class called address_t with members for the four integers. Your program should read a list up to 100 addresses and nicknames terminated by a sentinel address of all zeros and nickname.

  Design and implement class instance data for title of book

Design and implement a class called Book that contains instance data for the title, author, publisher, and copyright date. Define the Book constructor to accept and initialize this data.

  Write a script that inputs a numeric check amount

Write a script that inputs a dollar amount to be printed on a check, then prints the amount in check protected format with leading asterisks if necessary. Assume that nine spaces are available for printing the amount.

  Make the class employee to initializes three data members

Make the class called Employee which comprises three pieces of information as data membersa first name (type string), last name (type string) and monthly salary (type int).

  Data set containing an unknown number of integers

The program should use I/O redirection to accept a file defined by the user which is a data set containing an unknown number of integers. The integers should be stored in an array, and printed to an output file - also defined by the user through r..

  Explain modular concepts incorporated in program logic

The title of the report is Kyles Transportation Company and could you also please do the code for the report so that the program will run in Qbasic or Microsoft QuickBASIC

  Explaining the situation in program

Which of the following best explains the situation after Line 1 has been executed?

  Ethics and social responsibility

Ethics and social responsibility at McDonalds

  Fortran-77 to sort an array of numbers entered

Write a program in Fortran-77 to sort an array of numbers entered from the keyboard and then using binary search, search for a number in the array.

  Write class to represent temperatures in degree and celsius

Write a Temperature class that represents temperatures in degrees in Celsius, Fahrenheit and Kelvin. Use a floating-point number for the temperature and a character (type char) for the scale.

  Write a program that prompts the user to enter the mass

Write a program that prompts the user to enter the mass of a person in kilograms and outputs the equivalent weight in pounds. Output both the mass and the weight rounded to two decimal places

  Describe logic why it is not enough to show reduction

If we can only show: if x belongs to A, then y does not belongs to B;explain the logic why it is not enough to show A reduction B.IN other words why the theory needs to prove"if and only if"?

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