![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Homework & Coursework Questions Students must use and complete the template provided. If you don't, your post may be deleted! Special homework rules apply here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How Can a Machine Reads a Compiler Since A Compiler is Written in Text! Not Binaries? | f.ben.isaac | High Level Programming | 12 | 11-14-2008 11:25 AM |
| g++ compiler issue | vasanthan | Red Hat | 1 | 05-09-2008 03:08 AM |
| GCC compiler issue on redhat4.5 | nano2 | Linux | 0 | 01-16-2008 06:00 AM |
| CC 5.5 compiler flag to issue 64bit porting warnings on sparc-solaris | shobhah | SUN Solaris | 0 | 03-02-2007 02:47 AM |
| cc compiler issue | fishman2001 | High Level Programming | 2 | 04-29-2002 02:46 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Compiler issue I think...
Use and complete the template provided. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data: One problem says do the following problem using perl: A stamp dealer maintains a price list that displays the country, the Scott catalog number, year of issue, description, and price: Sample entry: Kenya 288-92 1984 Heron Plover Thrush gonolek Apalis $6.60 2. Relevant commands, code, scripts, algorithms: This is what I have so far... Code:
#!usr/bin/perl
#reads the lines from a file and formats the output and calculates a total price.
Open (FILEIN, "data.txt") || die ("Cannot open file");
ttlprc= 0;
while($in = <FILEIN>)
{
($con, $catnum, $yr, $str) =split (/\s/,$in, 4);
$rts=reverse($str);
($prc, $desc) =split (/\s/, $rts, 2);
print "Country: $con\n";
print "Catagory Number: $catnum";
print "Year: $yr";
print "Description: $desc";
print "Price: $prc";
$ttlprc= $ttlprc + $prc ;
}
print "The total price is \$$ttlprc";
3. The attempts at a solution (include all code and scripts): see above. 4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course): University Maryland University College, Adelphi Maryland, CMIS 325A Note: Without school/professor/course information, you will be banned if you post here! I don't really want someone to "solve" this, I just can't get my complier to work.... if you could try to compile this and maybe suggest one... that would be great. If you notice any obvious reason why I can't get this to run (it's grayed out when I attempt to run it) that would be great :P Thanks! |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|