Sponsored Content
Full Discussion: Compiler issue I think...
Homework and Emergencies Homework & Coursework Questions Compiler issue I think... Post 302369451 by Dalcron on Sunday 8th of November 2009 01:43:30 PM
Old 11-08-2009
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!
 

9 More Discussions You Might Find Interesting

1. Programming

cc compiler issue

Quick Question, may be very easy to answer. I've just got a Sparc 5 for my home with Solaris 2.6 pre installed onto it. When I go to use the Solaris Compiler 'cc' it comes back to me with the message '/usr/ucb/cc: language optional software package not installed'. Is this something that can be... (2 Replies)
Discussion started by: fishman2001
2 Replies

2. UNIX for Advanced & Expert Users

CC compiler

Hi, If you you have CC installed, then where does it defaultly lives. Thanks (3 Replies)
Discussion started by: vtran4270
3 Replies

3. UNIX for Dummies Questions & Answers

xl C/C++ compiler to GCC compiler

Hi, we are converting from IBM-AIX(xl c/c++ compiler) to Linux(GCC complier). As a part of this i need to change the CFLAGS. The xl c/c++ complier CFLAGS is CFLAGS := $(CDEBUG) $(PROJECT_INCLUDE_DIRS) $(COBJECT_MODE) -qcpluscmt -qmakedep -qcheck=all \ -qalign=bit_packed $(LINT_FLAGS)... (0 Replies)
Discussion started by: pbattu1
0 Replies

4. Solaris

CC 5.5 compiler flag to issue 64bit porting warnings on sparc-solaris

Hi, We are porting our application from 32bit to 64bit. We tried -xarch=v9, -xarc=v9a and -xport64=full options so that compiler to issue 64bit porting warnings. But we are not getting any porting warninings WE are using CC 5.5 compiler on sparc-solaris m/c. Please tell us some powerful... (0 Replies)
Discussion started by: shobhah
0 Replies

5. Linux

GCC compiler issue on redhat4.5

Hi all, I am using gcc4.1.1 on redhat4.5 and when i rethrow an exception and I am catching it .. The application aborts and throws the following error message to stdout - the error that's been thrown is been caught but never gets that far as it falls over on throw statement Has anyone ever... (0 Replies)
Discussion started by: nano2
0 Replies

6. Red Hat

g++ compiler issue

Hi i need to install g++ compiler in RHEL 5.1 and i downloaded the compiler from the below mentioned site g++ - Free Software Directory - Free Software Foundation its in format gcc-g++-4.0.2.tar.bz2 and i have unziped it...... can any one tell me the procedure to install it ..it dont... (1 Reply)
Discussion started by: vasanthan
1 Replies

7. Programming

How Can a Machine Reads a Compiler Since A Compiler is Written in Text! Not Binaries?

To make a programming language you need a compiler, so what was the first programming language and how was is created if you need the compiler first? The compiler itself is considered as a high language comparing to the machine! since the compiler is not created in 1's and 0's... Eventhough i... (12 Replies)
Discussion started by: f.ben.isaac
12 Replies

8. UNIX for Dummies Questions & Answers

cc compiler and gcc compiler

hi, can we install gcc compiler in unix based OS(sun solar,IBM AIX,HP,etc) and also can we install sun cc compiler in AIX environment and vice versa. and more ..is linux support cc compiler regards Ajay (3 Replies)
Discussion started by: ajaysahoo
3 Replies

9. Shell Programming and Scripting

shc compiler issue

I am using the shc shell compiler, it works fine, just that when i execute it, it displays the code at the terminal. Is there any way to hide this as well? otherwise it beats the purpose of hiding the code. Thanks ! (7 Replies)
Discussion started by: ysvsr1
7 Replies
DFG2TPTP(1)							       SPASS							       DFG2TPTP(1)

NAME
dfg2tptp - transforms DFG files into TPTP files SYNOPSIS
dfg2tptp <input-file> <output-file> DESCRIPTION
dfg2tptp is a program which converts a problem input file in DFG format into a problem input file in TPTP format. The TPTP problem format is used by the TPTP library of test problems for automated theorem proving, available at http://www.math.miami.edu/~tptp/. Various tools exist to convert problems in TPTP format into input files for other theorem provers. SEE ALSO
checkstat(1), filestat(1), pcs(1), pgen(1), rescmp(1), tpform(1), tpget(1), deprose(1), dfg2otter(1), SPASS(1) AUTHORS
Thomas Hillenbrand, Dalibor Topic and Christoph Weidenbach Contact : spass@mpi-inf.mpg.de perl v5.10.0 2010-02-23 DFG2TPTP(1)
All times are GMT -4. The time now is 04:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy