Help me make a pascal program for school...

Results 1 to 15 of 15
  1. #1
    rawr ! Sergiu14 is offline
    Grand MasterRank
    Apr 2005 Join Date
    565Posts

    Help me make a pascal program for school...

    Write a program that reads the temperatures measured 4 times a day as well as the quantity of precipitation, the temperatures and precipitations are measured for a weak. After doing that the program should write the maximum temperature and the day and hour asociated with it, and the day with the minimum temperature and the day and hour asociated with it. I know for u might sound stupidly simple but I suck at it so... pls do help me.
    OH AND FOR THE PRECIPITATIONS AND TEMPERATURE CHOOSE RANDOM.
    Last edited by Sergiu14; 20-11-06 at 07:58 PM.


  2. #2
    Sorcerer Supreme gan_187 is offline
    Member +Rank
    Aug 2006 Join Date
    On ur footLocation
    310Posts
    help me make?and though u ask some1 to make all the program themselves?

  3. #3
    rawr ! Sergiu14 is offline
    Grand MasterRank
    Apr 2005 Join Date
    565Posts
    Well it wont take more than 5-10 minutes to people that DO KNOW PASCAL but I DONT ... if I would know how to do it I wouldn't have asked for help

  4. #4
    Grand Master Mario_Party is offline
    Grand MasterRank
    Nov 2003 Join Date
    LondonLocation
    1,803Posts
    Are you trying to make a program that measures the temperature and amount of rainfall, or by saying, "OH AND FOR THE PRECIPITATIONS AND TEMPERATURE CHOOSE RANDOM" do you mean you are going to make the information up? Otherwise you will need to record data from sensors, which will mean you need to code differently to interact with different sensors.

  5. #5
    rawr ! Sergiu14 is offline
    Grand MasterRank
    Apr 2005 Join Date
    565Posts
    You dont have to record data, simply choose some random temps and put them in the program.

  6. #6
    /\/\@573|2 NoPeace is offline
    Grand MasterRank
    Feb 2004 Join Date
    under your bedLocation
    15,474Posts
    PM me tomarrow and I'll help you out. Middle of the night now and I'm going to bed. =P

    NoPeace - out

  7. #7
    Grand Master username1 is offline
    Grand MasterRank
    Jul 2004 Join Date
    5,867Posts
    What you need to do is start helping yourself by actually using your Brain to think and solve the problem in a systematic manner. If you constantly leech off others and get them to do the work for you, you will never learn anything.

    There are literally millions of sites out there on your topic, many with excellent information. Start using a Search Engine and see what you can find.

    I'll be nice this time and give you http://www.learn-programming.za.net/...ogramming.html to get started, but don't get the notion that you can always ask others for help.

    One more thing: Pascal is now considered an obsolete language with no advantages over other more powerful languages such as C/C++; the latter you should definitely learn if you plan on doing any 'real' programming.
    Last edited by username1; 21-11-06 at 09:19 AM.

  8. #8
    rawr ! Sergiu14 is offline
    Grand MasterRank
    Apr 2005 Join Date
    565Posts
    Exactly Thats Why I Dont Wanna Learn Pascal, Coz It Totally Fwkin Useless, but There Are Ppl Over Here That Do Know Pascal And Its A Really Easy Program For Them

  9. #9
    Sorcerer Supreme gan_187 is offline
    Member +Rank
    Aug 2006 Join Date
    On ur footLocation
    310Posts
    Quote Originally Posted by username1 View Post
    What you need to do is start helping yourself by actually using your Brain to think and solve the problem in a systematic manner. If you constantly leech off others and get them to do the work for you, you will never learn anything.
    thats what i was thinking. try to make ur own stuff, try to learn how to do that on ur own and dont beg ppl to make one for u. i would hepl u but ive learne visual fox at school and its preety basic and crappy(long live microsoft)

  10. #10
    rawr ! Sergiu14 is offline
    Grand MasterRank
    Apr 2005 Join Date
    565Posts
    I wasn't begging for people to help me I simply asked if someone would help me if not its ok.

  11. #11
    Grand Master username1 is offline
    Grand MasterRank
    Jul 2004 Join Date
    5,867Posts
    Quote Originally Posted by Sergiu14 View Post
    Exactly Thats Why I Dont Wanna Learn Pascal, Coz It Totally Fwkin Useless, but There Are Ppl Over Here That Do Know Pascal And Its A Really Easy Program For Them
    Then why are you learning it?

    I know it's for school, but there are no school systems I'm aware of that make it mandatory for students to study programming.

  12. #12
    /\/\@573|2 NoPeace is offline
    Grand MasterRank
    Feb 2004 Join Date
    under your bedLocation
    15,474Posts
    Quote Originally Posted by username1 View Post
    Then why are you learning it?

    I know it's for school, but there are no school systems I'm aware of that make it mandatory for students to study programming.
    Why? Because it's an easy to learn laguange that makes it easy for people to start out programming.

    It is also a procedure oriented programming language that makes it harder for the user to program which in turn makes them have a better understanding on how to program efficiently then you can with OOP languages like Java, C/C++, and VB.

    Yes it's old and outdated. But here in the states it was the main language they thought 10-15 years ago. And many school systems still have teachers that know how to program in it and still have the books to teach it with. So why buy all new books (which costs $1000s) when they can use the old ones that they already had and use them for an introduction to programming course?

    Also just because it is no longer used to write programs doesn't mean it's pointless to use. The likly hood of seeing newer languages used in a buisness isn't that likely unless it's newer. Most buisness that's been usising computers since the 70's still have all their programs written in COBOL which is older then PASCAL. And if it's a company that's been using computers since the 80's then most likely they are running PASCAL based programs. C++ wasn't used much until the 90's. So when you are employed by a company to update their old programs it'll be highly helpful to know some of the older programming languages like COBOL and PASCAL as they are the ones that was used most back in the time.

    And you really shouldn't be bashing older langauges as they are still just as powerful and they are reliable as it seems with programs that are 20-30 years old still doing their job just fine.

    Now for Sergiu14. The logic for your program is quite simple.

    All you need is a 2 dimentional array. Then read read the data in as [temp, hour, precipitation] for columns [1, 2, 3]. Then you sort the arry by column 1. That way the values you need will be the first and last rows of the array.

    Don't ask me how to code it though. Because 1 I don't remember exactly how to program in PASCAL, 2 I don't intended to look up how to, and 3 it's your work and you need to learn how to do it.

    I told you the steps of doing it and now it's your turn to write how to do it. It shouldn't take you more then 15mins as it's pretty easy to do.

    NoPeace - out

  13. #13
    rawr ! Sergiu14 is offline
    Grand MasterRank
    Apr 2005 Join Date
    565Posts
    Did it thnx mate! :D

  14. #14
    Grand Master username1 is offline
    Grand MasterRank
    Jul 2004 Join Date
    5,867Posts
    Quote Originally Posted by NoPeace View Post
    Yes it's old and outdated. But here in the states it was the main language they thought 10-15 years ago. And many school systems still have teachers that know how to program in it and still have the books to teach it with. So why buy all new books (which costs $1000s) when they can use the old ones that they already had and use them for an introduction to programming course?
    Speaking from the perspective of an instructor of several programming courses (mainly C/Asm), I can say that the instructors who need to teach from books don't really know the material thoroughly enough, or haven't yet figured out the power of the Internet. As for me, I use a combination of material I write myself and that which I find on the Internet.

    Also just because it is no longer used to write programs doesn't mean it's pointless to use. The likly hood of seeing newer languages used in a buisness isn't that likely unless it's newer. Most buisness that's been usising computers since the 70's still have all their programs written in COBOL which is older then PASCAL. And if it's a company that's been using computers since the 80's then most likely they are running PASCAL based programs. C++ wasn't used much until the 90's. So when you are employed by a company to update their old programs it'll be highly helpful to know some of the older programming languages like COBOL and PASCAL as they are the ones that was used most back in the time.
    Many of them are starting to migrate to C++ or even C#.

  15. #15
    Grand Master FragFrog is offline
    Grand MasterRank
    Aug 2004 Join Date
    The NetherlandsLocation
    5,629Posts
    Quote Originally Posted by username1 View Post
    Speaking from the perspective of an instructor of several programming courses (mainly C/Asm), I can say that the instructors who need to teach from books don't really know the material thoroughly enough, or haven't yet figured out the power of the Internet. As for me, I use a combination of material I write myself and that which I find on the Internet.
    Funny, you sound like my professor on C++ - he hates the internet as far as I know, but did write 'the' book on C and C++ - You'll probably know them as the C++ annotations by Frank Brokken :)

    More ontopic, you're right that pascal is an outdated language, but there are plenty of colleges that require students to study useless languages themselfs. I for instance had to take a course in java, even though it extended little further then writing a hello world program and there is a optional course on C++ being given by a much better teacher. Hell, I had to 'learn' HTML from teachers whose skills were limited to framesets :) So yeah, I can believe quite easily that Sergiu must learn this.

    Totally ontopic: I have never coded in pascal, yet your problem is, as has been mentioned, easily solveable by using a 2 dimensional array. Moreso, I would suggest writing the array to either a database or a comma seperated values file (.csv), one line for each readout, and then use simple compare functions to find the maximum temperature.

    A simple SQL query for instance could do this: SELECT time, MAX(temperature) FROM table GROUP BY DAY(date_field) - this would give you a list of all past days with the max temperature and the time of occurance for all days recorded. All your program would need to do is put it in the database several times a day. In a simple language like PHP that would be about 10 lines of code, but I do not know how much it'd be in pascal ofcourse :)



Advertisement