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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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