Article View: comp.lang.pascal.misc
Article #138New to pascal, need help w/ program
From: Joshua Roth
Date: Thu, 07 Jan 1999 00:00
Date: Thu, 07 Jan 1999 00:00
27 lines
2368 bytes
2368 bytes
I'm currently taking a Pascal course as a requirement for my major, and my
instructor is probably the worst instructor I've ever had. I now have
homework due in less then a week, and I have know clue how to do it. Can
anyone help me out? Here is the problem:
Make the unrealistic assumption that your computer has maxint equal to 18,
and write a program to read in two numbers of 10 or fewer digits and output
their sum. The two numbers are stored in arrays of the following type:
type
Number = array[0...9] of integer;
Each digit of a number is stored in one indexed variable of it's array. The
numbers are to be read as character values, one digit at a time, using a
variable of type char. Each digit is converted into a number and stored in
an indexed variable of an array. If the number is less than 10 digits long,
then leading zeros should be added to the array.
an addition procedure is then called to calculate the sum and stored it in a
third array. If the sum would be more than 10 digits long, the two numbers
read in and their sum are output.
I only have four days before this is due, and I'm at a lost. Can anyone
help.......I'm desperate
josh
joshroth@pacbell.net
Technical Details
Message-ID:
<nNfl2.402$kt3.5337@typhoon-sf.pbi.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 102601,96d55c5bdf0b8d1a,start X-Google-Attributes: gid102601,public X-Google-Thread: 10261c,96d55c5bdf0b8d1a,start X-Google-Attributes: gid10261c,public X-Google-Thread: fd1d1,96d55c5bdf0b8d1a,start X-Google-Attributes: gidfd1d1,public X-Google-Thread: 16176c,96d55c5bdf0b8d1a,start X-Google-Attributes: gid16176c,public X-Google-Thread: 1006de,96d55c5bdf0b8d1a,start X-Google-Attributes: gid1006de,public From: "Joshua Roth" <joshroth@pacbell.net> Subject: New to pascal, need help w/ program Date: 1999/01/07 Message-ID: <nNfl2.402$kt3.5337@typhoon-sf.pbi.net> X-Deja-AN: 430069215 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 X-Complaints-To: abuse@pacbell.net X-Trace: typhoon-sf.pbi.net 915769555 207.214.183.66 (Thu, 07 Jan 1999 20:25:55 PDT) Organization: SBC Internet Services NNTP-Posting-Date: Thu, 07 Jan 1999 20:25:55 PDT Newsgroups: comp.lang.pascal.misc,csugrad.programming.pascal,ctdl.lang.pascal,de.comp.lang.pascal,de.comp.lang.pascal.misc