Pascal

Moderators: None (Apply to moderate this forum)
Number of threads: 4095
Number of posts: 14007

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
string array program help desperately needed Posted by tipsymich on 14 Mar 2004 at 9:06 AM
Hi ya, I'm hoping that someone out there can help me here, I've been told to create this pascal program:-

it is required to read into a 4 * 7 real array weekly observed sunshine hours recorded at four weather stations. An example of the data is:-

Station Sun Mon Tue Wed Thu Fri Sat
1 2.3 4.6 5.2 3.1 0.2 1.6 1.8
2 6.1 5.9 8.2 7.6 9.4 9.1 6.5
3 3.1 6.2 1.7 9.3 6.5 8.4 1.2
4 11.2 8.2 9.6 10.4 9.9 12.3 10.1

The input data is to be fully validated ensuring data is within reasonable limits.

Output the data in the above form.

Also use the pascal procedure val to test for non-numeric data

The program will analse the data and produce a table of the following form.

Station Min Day Max Day Weekly Average
1 0.2 Thu 5.2 Tue 2.7
2 5.9 Tue 9.4 Thu 7.5
3 1.2 Sat 9.3 Wed 5.3
4 8.2 Mon 12.3 Fri 10.2

Write a program in pascal to achieve this making full use of a 2d real array and a 1d string array for holding days of the week

Anyone that can help will be loved forever!
Report
Re: string array program help desperately needed Posted by zibadian on 14 Mar 2004 at 9:42 AM
: Hi ya, I'm hoping that someone out there can help me here, I've been told to create this pascal program:-
:
: it is required to read into a 4 * 7 real array weekly observed sunshine hours recorded at four weather stations. An example of the data is:-
:
: Station Sun Mon Tue Wed Thu Fri Sat
: 1 2.3 4.6 5.2 3.1 0.2 1.6 1.8
: 2 6.1 5.9 8.2 7.6 9.4 9.1 6.5
: 3 3.1 6.2 1.7 9.3 6.5 8.4 1.2
: 4 11.2 8.2 9.6 10.4 9.9 12.3 10.1
:
: The input data is to be fully validated ensuring data is within reasonable limits.
:
: Output the data in the above form.
:
: Also use the pascal procedure val to test for non-numeric data
:
: The program will analse the data and produce a table of the following form.
:
: Station Min Day Max Day Weekly Average
: 1 0.2 Thu 5.2 Tue 2.7
: 2 5.9 Tue 9.4 Thu 7.5
: 3 1.2 Sat 9.3 Wed 5.3
: 4 8.2 Mon 12.3 Fri 10.2
:
: Write a program in pascal to achieve this making full use of a 2d real array and a 1d string array for holding days of the week
:
: Anyone that can help will be loved forever!
:
I'm willing to write your program, provided that you write mine. I need to write a program, which can compare two strings in a fuzzy-logic manner, and highlight all the differences in both of them. This needs to be done at the word-for-word level instead of the char-for-char level.

Report
Re: string array program help desperately needed Posted by tipsymich on 15 Mar 2004 at 1:57 AM
erm, ok, wel your talking to a dumb blonde, don't think I'm going to come out with anything mildly intelligent!
Report
Re: string array program help desperately needed Posted by zibadian on 15 Mar 2004 at 10:14 AM
This message was edited by zibadian at 2004-3-15 10:15:26

: erm, ok, wel your talking to a dumb blonde, don't think I'm going to come out with anything mildly intelligent!
:
I won't write the program for you, but I will help you in some areas. Reading the file into an array of strings should be easy, so you'll have to do that on your own. Since each line contains multiple fields, which are space-delimited, you need to have some sort of way of getting the parts from those lines. Years ago I wrote a function for that, which I recently posted in the codepedia: http://www.codepedia.com/1/StringSplit.
The help files contain all the data you need on the Val() procedure, so that should also be covered.
I assume you can find the min/max/average temp yourself on paper. If you think about how you do that, then you might be able to find the Pascal-code for it yourself.
I hope this helps you getting closer to writing the program. If you have specific questions or problems, please do ask, provided you show that you looked into the problem yourself (posting the code you wrote, or giving details on how you think to solve it).

P.S.: Sorry about the earlier post, but we get people asking us to do their homework several times per month.
Report
Re: string array program help desperately needed Posted by bading on 17 Mar 2004 at 7:44 AM
: Hi ya, I'm hoping that someone out there can help me here, I've been told to create this pascal program:-
:
: it is required to read into a 4 * 7 real array weekly observed sunshine hours recorded at four weather stations. An example of the data is:-
:
: Station Sun Mon Tue Wed Thu Fri Sat
: 1 2.3 4.6 5.2 3.1 0.2 1.6 1.8
: 2 6.1 5.9 8.2 7.6 9.4 9.1 6.5
: 3 3.1 6.2 1.7 9.3 6.5 8.4 1.2
: 4 11.2 8.2 9.6 10.4 9.9 12.3 10.1
:
: The input data is to be fully validated ensuring data is within reasonable limits.
:
: Output the data in the above form.
:
: Also use the pascal procedure val to test for non-numeric data
:
: The program will analse the data and produce a table of the following form.
:
: Station Min Day Max Day Weekly Average
: 1 0.2 Thu 5.2 Tue 2.7
: 2 5.9 Tue 9.4 Thu 7.5
: 3 1.2 Sat 9.3 Wed 5.3
: 4 8.2 Mon 12.3 Fri 10.2
:
: Write a program in pascal to achieve this making full use of a 2d real array and a 1d string array for holding days of the week
:
: Anyone that can help will be loved forever!
:
STUDY HARDER!READ YOUR BOOKS AND YOU WILL LOVE ME FOREVER!



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.