Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

string array program help desperately needed

tipsymichtipsymich Member Posts: 2
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!

Comments

  • zibadianzibadian Member Posts: 6,349
    : 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.

  • tipsymichtipsymich Member Posts: 2
    erm, ok, wel your talking to a dumb blonde, don't think I'm going to come out with anything mildly intelligent!
  • zibadianzibadian Member Posts: 6,349
    [b][red]This message was edited by zibadian at 2004-3-15 10:15:26[/red][/b][hr]
    : 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.
  • badingbading Member Posts: 9
    : 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!
Sign In or Register to comment.