Design a script that processes the data

Assignment Help Computer Engineering
Reference no: EM1332552

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: EM1332552

Questions Cloud

Illustrate which loan carries the lower effective rate : Illustrate which loan carries the lower effective rate. Consider fees to be the equivalent of other interest.
Discuss the importance of grades : Why are we so big on the concept of merit? To be sure, merit is often determined by opportunities - it easier to get better grades if you are rich and have tutors.
Zeta software-project operating cash flow : Zeta Software is considering a new project whose data are shown below. The required equipment has a 3-year tax life, after which it will be worthless
Drugs crossing the border : Describe the situation with the drugs crossing the border into the United States.
Design a script that processes the data : The script calculates the number of weeks, days, and hours worked during the month, then shows the form data and the results of the calculations.
Show the employer-employee relationship : The Legal Environment of Human Resource Management - Check and show the employer-employee relationship
Assume you plan to quit your job in weeks interest in rock : Assume you plan to quit your job in 6 weeks because you have saved enough money to move to California where you can indulge your interest in rock climbing.
Responsible for the blog-s content : Who is responsible for the blog's content, what is the nature of the content,and how frequently is the blog updated.
Acquisition decisions at kellogg : Kellogg Co. agreed to acquire Keebler Foods Co. for $3.86 billion, or $42 per share. What were Kellogg's objectives in the acquisition?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Suggest all sources using APA style

Suggest all sources using APA style

  What is time estimate

How does an estimator arrive at a time estimate for a particular task.

  Write down a recursive function "sumdigits"

modify a recursive function "sumDigits" in C++, that receives an integer as argument by reference and returns the sum of digits representing this integer. Also write a main function to test this function.

  Determining the i/o access speed

Determine the I/O access speed utilizing the CPU 3 and each of the hour disk drives as they evaluate the following track requests: 0, 31, 20, 15, 20, 31, 15.

  Explain a subclass of jpanel called mycolorchooser

Declare a subclass of JPanel known as MyColorChooser that provides three JSlider objects and three JTextField objects. Each JSlider represents values from 0 to 255 for the red, green and blue parts of a color.

  Why x3d is currently replacing vrml

X3D is currently replacing VRML as the nearest the internet gets to Virtual Reality currently. Is X3D suited specifically to certain applications over others? consider an application for the Internet where you believe Virtual Reality would be of b..

  Estimaitng the cost of ordering and management

If company utilizing the best inventory policy, what would be the total cost of ordering and management?

  Transmitting image through raster scan

If we were to transmit this image utilizing the raster scan order, after 15 seconds how many rows of image will the user have received? To what fraction of the image does this correspond?

  Generating class diagram and pseudocode

Develop a class named CustomerRecord which holds a customer number, name, and address. Incorporate different methods in order to set the values for each data field and output values for each data field.

  What role might the reticular activation formation play

What role may the "Reticular Activation Formation" play in the AROUSAL process.

  Linux advanced server vs windows 2003 server

Please give me 10 topic examples that I can select to write about in my class assignment. The example must be able to cover the directions that are listed below.

  Give the company''s decision support system

Large organizations often link extensive reporting suites to company's Decision Support Systems, in effect creating 'Business Intelligence' (BI) applications.

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