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

  Issues or problems related to database architecture

In a Microsoft Word document, write an 800- to 1,000-word research paper. Your research paper should contain the following sections.

  Design program that will read a message string

Write down a JavaScript program that will read a message string and a number from text boxes on a Web page. The program will then use those values to display some information to the user.

  Find out whether the list is empty

Write down the functions (in C++) to perform these basic operations on Linked List.

  How to create the clients by service rep report

How to create the clients by service rep report create mailing label for client table

  Access the customerm.java file

design the class file that is needed to be run with this code, that is, write the class file that is implied by the main method. Post this code to your MS Word solution document for this assignment.

  Problem on encryption using a one-round version of des

Problem on encryption using a one-round version of DES.

  What is the advantage when target is throughput and security

What is the advantage when target is throughput and securityty

  Write down a class grade with a method getnumericgrade

note down  a Java program that translates a letter grade into a number grade. Letter grades are A B C D F, possibly followed by + or -. Their numeric values are 4, 3, 2, 1, and 0. There is no F+ or F-. A + increases the numeric value by 0.3, a - d..

  What kind of algorithm is required

figuring out how to find the last element of the print statement. For array A(N) and input element ARG, what kind of algorithm is needed to determine which element of A(N) is closest to but not greater than ARG? I've gotten this far but can't find..

  Commercial ids systems

Utilizing the Internet, search for the commercial IDS systems. What are the classification systems and descriptions are used.

  Define the idea of a context as it relates to hci design

Interactive computer systems could be categorized both in terms of interaction styles and interaction paradigms. This helps us to understand the problems and potential value of any interactive system design. We must also pay attention to the conte..

  The advantages and disadvantages of standardization

find the advantages and disadvantages of standardization in computer hardware and system software.

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