Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

a little programming code pascal

  • 02-11-1999 1:17pm
    #1
    Registered Users, Registered Users 2 Posts: 4,471 ✭✭✭


    how do i get a program to ask a user to input the ammount of numbers he wants to input . then ask him to input the numbers show what the numbers are and show what the smallest and largets is . also to tell then user when the number 12 was last put in and first put in


Comments

  • Registered Users, Registered Users 2 Posts: 2,494 ✭✭✭kayos


    Ok I don't mean to sound condesending but When did you start programming. I never did pascal(Bar Install script which is PASCAL with a difference of two for Install Shield ). Right try somethingLike this.
    Ask the user for the ammount of numbers(say x) and use this to declare an array of x - 1 rows. then use a loop while/for which ever you like best smile.gif and keep asking the user for the number until the array bounds have been reached for every number you read in check if its 12 and if it is put the array subscript (say y) into a int varaable as y + 1 this let you tell the user the first time it was entered then the next time it is entered load it into a different varible (over write this one every time you come across 12 to give you the last time it was entered). then just figure out the max and min numbers and print out what ya what. QED.

    Kayos

    P.S. This is based on my ASM/C/C++ days but the jist should be the same for Pascal


  • Registered Users, Registered Users 2 Posts: 3,744 ✭✭✭deRanged


    http://homepage.eircom.net/~clayton/homework.pas

    does more or less what you want.


  • Registered Users, Registered Users 2 Posts: 4,471 ✭✭✭elexes


    thx lads . but in the end i figured it .


Advertisement