The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
parent not waiting until child complete executing another program through execl() vvaidyan High Level Programming 4 05-16-2008 06:00 AM
writing math testing program ccp Shell Programming and Scripting 5 05-01-2008 01:17 AM
Having trouble writing a basic shell program SeanWuzHere Shell Programming and Scripting 3 11-30-2006 01:41 PM
something about <math.h> blf0 High Level Programming 4 03-10-2006 12:44 AM
math.h not working? o.0 primal High Level Programming 2 03-24-2002 09:23 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-19-2002
perleo perleo is offline
Registered User
  
 

Join Date: Aug 2002
Location: Ireland
Posts: 139
basic math program 4 child

Iam writing a script for my sisters friends little brother

i want the program to say hello lets say his name is Joe and ask him how he is and he can write a reply back saying fine and then it replys "Iam happy you are (his response) today
and then it goes into a basic math where he can put in a number hit enter put in another number and then it tells him the awnser.

Its to work on a win 98 machine and in C or Perl if it has to be
  #2 (permalink)  
Old 10-19-2002
WIntellect's Avatar
WIntellect WIntellect is offline
Registered User
  
 

Join Date: Sep 2002
Location: United Kingdom
Posts: 170
Is there an exact question in there?

Are you asking for the entire answer?

What have you done so far?
  #3 (permalink)  
Old 10-19-2002
perleo perleo is offline
Registered User
  
 

Join Date: Aug 2002
Location: Ireland
Posts: 139
iam looking for the whole script.i havnt done anything yet
  #4 (permalink)  
Old 10-20-2002
WIntellect's Avatar
WIntellect WIntellect is offline
Registered User
  
 

Join Date: Sep 2002
Location: United Kingdom
Posts: 170
Ok - I don't know C, but i know the groundwork to Perl - so here's one Perl solution:

Code:
#!/usr/bin/perl

print "\nHello Joe, how are you today? ";
chomp( $feelToday = <STDIN> );

print "\nI am happy you are $feelToday today.";
print "\nLet's do some math. What's your first number? ";
chomp( $firstNumber = <STDIN> );

print "\nWhat's your second number? ";
chomp( $secondNumber = <STDIN> );

$mathResult = $firstNumber + $secondNumber;
print "\nThe math result is $mathResult!\n\n";
Just put it in a script, make it executable and run it. Just make sure the first line points to the location of your Perl executable on your system!

  #5 (permalink)  
Old 10-20-2002
perleo perleo is offline
Registered User
  
 

Join Date: Aug 2002
Location: Ireland
Posts: 139
it works perfect. Thanks man. Cheers

so now how do i make it a .exe ????? i have perl2exe and how do i use that to make it a exe ?
  #6 (permalink)  
Old 10-20-2002
WIntellect's Avatar
WIntellect WIntellect is offline
Registered User
  
 

Join Date: Sep 2002
Location: United Kingdom
Posts: 170
Sorry, I don't have perl2exe You'll have to check the docummentation or website
  #7 (permalink)  
Old 10-20-2002
WIntellect's Avatar
WIntellect WIntellect is offline
Registered User
  
 

Join Date: Sep 2002
Location: United Kingdom
Posts: 170
OK - I was in a good mood; The website is:

http://www.indigostar.com/perl2exe.htm


And under the "Documentation" section, it clearly says:

Usage:
perl2exe myscript.pl


So there you go! Now, having done your child's homework; my fee ... <change register sound>
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:06 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0