473,386 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Hi, need Perl program ?

I have a Perl program that needs to have a start and stop as two variables and all the numbers between these two to be added. The start and stop must be whole numbers .The sum of all the numbers between the start and stop variables should be added to find the sum except all the numbers which are exactly divisable by 7 are not added to the sum.
I have this so far:
Expand|Select|Wrap|Line Numbers
  1.  print "Enter the start number";
  2.  $start=<STDIN>;
  3.  print "Enter the stop number";
  4.  $stop=<STDIN>;
  5.  $sum=0;
  6.  $count=0;
  7.  if ($sum % 7!=0) {
  8.    $sum=$sum+$start;
  9.    $start=$start+1;
  10.  else ($sum<=$stop)
  11.    $sum=$sum+$start;
  12.    $start=$start+1;
  13.  }
  14.  exit;
Feb 8 '10 #1
1 1196
numberwhun
3,509 Expert Mod 2GB
Ok, do you have a question associated with your task?

Unfortunately, since this sounds far too much like class work, we cannot just give you code, you have to do the work. You ask questions.... we help you.

Regards,

Jeff
Feb 9 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Roy Smith | last post by:
I'm working on a prototype of a new application in Python. At some point, if this ever turns into a product, the powers that be will almost certainly demand that it be done in Perl. My job will...
41
by: Xah Lee | last post by:
here's another interesting algorithmic exercise, again from part of a larger program in the previous series. Here's the original Perl documentation: =pod merge($pairings) takes a list of...
3
by: lonelyplanet999 | last post by:
Hi, I'm a newbie to perl and is now studying about perl programming, I read some perl programming tutorials online (enter 'Perl tutorial' at google.com) and also find some sample perl scripts...
1
by: Spamtrap | last post by:
I only do occasional Perl programming and most things I write are short processes. I have something I'm working on that is scanning a text file with about 15 million lines and trying to extract...
3
by: xrongor | last post by:
hi. i need a simple, hopefully free html editor that besides the standard features has the following properties: allows frames. and will allow me to create a "directory" based on data...
3
by: Daniel Moree | last post by:
I'm attempting to use a perl script to interface with my Visual Basic 6 program using Winsock. I've got my program setup to connect and works great if i connect to another winsock program, but it...
3
by: sir.linying | last post by:
My php script is to call perl scipt which makes use of Spreadsheet::ParseExcel module to parse Excel file. I am able to launch php script from command line so that perl script can run and properly...
4
by: shyamkumars | last post by:
Hi, I would like to know how can I make a daemon program in perl,say DP . The said program need to call a a program say A, which will to parse huge text file. The run time of A may vary say 5 to 6...
1
by: megaman1 | last post by:
I’m trying to connect with perl DBD::Oracle on Windows to Oracle DB (Linux). I compiled the Oracle.dll using the commands “perl Makefile.pl” “nmake” and “nmake install”, but when I try to connect...
24
by: Peter Michaux | last post by:
I have a Perl script that I want to run as a set-user-ID program. Many OSes don't allow scripts run as set-user-ID. To make this script portable, it seems I need to write a C wrapper program that...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.