# basic math program 4 child

**URL:** <https://community.unix.com/t/basic-math-program-4-child/144523>\
**Category:** Programming\
**Created:** [October 19, 2002, 11:08am UTC](https://community.unix.com/t/basic-math-program-4-child/144523 "2002-10-19T11:08:21Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![perleo](https://community.unix.com/letter_avatar/perleo/32/5_5575768a8748004e209b776fc1b2916d.png) [@perleo](https://community.unix.com/u/perleo)\
**Post date:** [October 19, 2002, 11:08am UTC](https://community.unix.com/t/basic-math-program-4-child/144523/1 "2002-10-19T11:08:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![WIntellect](https://community.unix.com/user_avatar/community.unix.com/wintellect/32/74_2.png) [@WIntellect](https://community.unix.com/u/WIntellect)\
**Post date:** [October 19, 2002, 12:08pm UTC](https://community.unix.com/t/basic-math-program-4-child/144523/2 "2002-10-19T12:08:12Z")

</div>

Is there an exact question in there?

Are you asking for the entire answer?

What have you done so far?

---

<div class="post-metadata">

**Author:** ![perleo](https://community.unix.com/letter_avatar/perleo/32/5_5575768a8748004e209b776fc1b2916d.png) [@perleo](https://community.unix.com/u/perleo)\
**Post date:** [October 19, 2002, 12:49pm UTC](https://community.unix.com/t/basic-math-program-4-child/144523/3 "2002-10-19T12:49:02Z")

</div>

iam looking for the whole script.i havnt done anything yet

---

<div class="post-metadata">

**Author:** ![WIntellect](https://community.unix.com/user_avatar/community.unix.com/wintellect/32/74_2.png) [@WIntellect](https://community.unix.com/u/WIntellect)\
**Post date:** [October 20, 2002, 9:07am UTC](https://community.unix.com/t/basic-math-program-4-child/144523/4 "2002-10-20T09:07:21Z")

</div>

Ok - I don't know C, but i know the groundwork to Perl - so here's one Perl solution:

```nohighlight
#!/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!

😃

---

<div class="post-metadata">

**Author:** ![perleo](https://community.unix.com/letter_avatar/perleo/32/5_5575768a8748004e209b776fc1b2916d.png) [@perleo](https://community.unix.com/u/perleo)\
**Post date:** [October 20, 2002, 9:30am UTC](https://community.unix.com/t/basic-math-program-4-child/144523/5 "2002-10-20T09:30:10Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![WIntellect](https://community.unix.com/user_avatar/community.unix.com/wintellect/32/74_2.png) [@WIntellect](https://community.unix.com/u/WIntellect)\
**Post date:** [October 20, 2002, 3:45pm UTC](https://community.unix.com/t/basic-math-program-4-child/144523/6 "2002-10-20T15:45:52Z")

</div>

Sorry, I don't have perl2exe ☹ You'll have to check the docummentation or website

---

<div class="post-metadata">

**Author:** ![WIntellect](https://community.unix.com/user_avatar/community.unix.com/wintellect/32/74_2.png) [@WIntellect](https://community.unix.com/u/WIntellect)\
**Post date:** [October 20, 2002, 3:49pm UTC](https://community.unix.com/t/basic-math-program-4-child/144523/7 "2002-10-20T15:49:30Z")

</div>

OK - I was in a good mood; The website is:

[http://www.indigostar.com/perl2exe.htm](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\>

---

<div class="post-metadata">

**Author:** ![perleo](https://community.unix.com/letter_avatar/perleo/32/5_5575768a8748004e209b776fc1b2916d.png) [@perleo](https://community.unix.com/u/perleo)\
**Post date:** [October 22, 2002, 1:48pm UTC](https://community.unix.com/t/basic-math-program-4-child/144523/8 "2002-10-22T13:48:09Z")

</div>

Thanks

but whats this about ?........

Now, having done your child's homework; my fee ... \<change register sound\>

---

<div class="post-metadata">

**Author:** ![WIntellect](https://community.unix.com/user_avatar/community.unix.com/wintellect/32/74_2.png) [@WIntellect](https://community.unix.com/u/WIntellect)\
**Post date:** [October 22, 2002, 4:17pm UTC](https://community.unix.com/t/basic-math-program-4-child/144523/9 "2002-10-22T16:17:11Z")

</div>

> [@](#):
>
> Originally posted by perleo  
> Now, having done your child's homework; my fee ... \<change register sound\>

It was a joke 😃 Your question looked like a "homework" type question. Read the forum rules for full details 😉

---

<div class="post-metadata">

**Author:** ![perleo](https://community.unix.com/letter_avatar/perleo/32/5_5575768a8748004e209b776fc1b2916d.png) [@perleo](https://community.unix.com/u/perleo)\
**Post date:** [October 22, 2002, 4:51pm UTC](https://community.unix.com/t/basic-math-program-4-child/144523/10 "2002-10-22T16:51:13Z")

</div>

Okay. I dont do perl homework. Iam only 14 !!!!!!

Still in secondary school !
