develooper Front page | perl.beginners | Postings from February 2002

Re: HELP! : To write a script that reads numbers from STDIN andprint on STDOUT.

Thread Previous
From:
Tanton Gibbs
Date:
February 7, 2002 09:22
Subject:
Re: HELP! : To write a script that reads numbers from STDIN andprint on STDOUT.
Message ID:
002501c1affc$12d73e40$a1dc550a@brooklyn
If you could show us what you have already done, maybe we could help show
you what you are doing wrong...we normally don't do homework for other
people :)
----- Original Message -----
From: "Bruce Ambraal" <bambraal@cct.org.za>
To: <beginners@perl.org>
Sent: Thursday, February 07, 2002 11:31 AM
Subject: HELP! : To write a script that reads numbers from STDIN andprint on
STDOUT.


> Hi ALL
>
> Could  any one write some coding for the following problem.
>
> In perl against Linx could someone help.
> --------------------------------------------------------------------------
-----------------------------------------
> I want to write a script that reads in four numbers from STDIN and add the
first two together, and than adds the second 2 together.
> The input format is a number on a line.(press enter after every number)
> I also want to ompare the resulting two numbers with > or < and print the
largest on STDOUT.
>
> --------------------------------------------------------------------------
------------------------------------------
> I have a second part to the previous problem.
>
> I now want to modify the script to read a name, and then the number
> (again each on its own line)
> To read four name/number pairs
> To read two names from STDIN and add the associated numbers together.
> Repeat this step.
> Then to compare the resulting two numbers with
> < or > and print the largest on STDOUT.
>
> Thanks in advance
>
> Bruce
>
>
> --
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org
>


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About