Big Program, Dont Know Where to begin, any help would be greatly appreciated!

This is a discussion on Big Program, Dont Know Where to begin, any help would be greatly appreciated! within the C Programming forums, part of the General Programming Boards category; Problem Statement Write a program that examines a text file that contains a report of the day’s previous weather. The ...

  1. #1
    Registered User
    Join Date
    Dec 2011
    Posts
    1

    Big Program, Dont Know Where to begin, any help would be greatly appreciated!

    Problem Statement
    Write a program that examines a text file that contains a report of the day’s previous weather. The report may contain any of the following: wind speed in mph or km/hr, description of wind speed, damage reports, and wave conditions. Your task is to decipher this report (usually 1 to 2 paragraphs in length) and determine the most likely wind force based on Beaufort Wind Scale (attached).

    Beaufort Wind Scale
    Requirements
    1. Read a file that resides in the root directory of the drive supplied (example: E:\weatherreport.txt)
    2. Scan the file for keywords or phrases (descriptions, damage, wind speeds, etc) and save each instance.
    3. Assign a Beaufort wind force to each instance.
    4. Calculate the most likely Beaufort wind force for the report by averaging all the instances by giving wind speeds and wave heights 2x weighing and all others 1x weighing.
    5. Generate a report (display and file) according to Appendix A.
    6. Prompt the user for another file (1 to continue else exit).
    Appendix A

    Report Prepared by: Your Name and Date
    File Scanned: drive:\XXXXXXXX.txt
    Numerical Indicators:
    1. wind speed instance number Beaufort force
    2. wave heights number Beaufort force
    _____________________
    Average Beaufort force
    Textual Indicators:
    1. Damage Type Beaufort force
    2. Tree Indications Type Beaufort force
    3. Other Type Beaufort force
    _____________________
    Average Beaufort force
    Summary
    Numerical Beaufort Force Average (XXXX) x2
    Textual Beaufort force Average (XXXX) x1
    Synopsis Beaufort force XXXXX (add above/3)

  2. #2
    Registered User
    Join Date
    Sep 2011
    Posts
    111
    Here are some suggestions to get started.

    Write each part first and do not move onto the next part until the first part is working.

    Requirements
    1. Read a file that resides in the root directory of the drive supplied (example: E:\weatherreport.txt)
    2. Scan the file for keywords or phrases (descriptions, damage, wind speeds, etc) and save each instance.
    3. Assign a Beaufort wind force to each instance.
    4. Calculate the most likely Beaufort wind force for the report by averaging all the instances by giving wind speeds and wave heights 2x weighing and all others 1x weighing.
    5. Generate a report (display and file) according to Appendix A.
    6. Prompt the user for another file (1 to continue else exit).
    Appendix A
    It looks like you are writing a parser to start with. The best way to to work each part before you move to the next. This way if there is some kind of error/bug in the code you know it is with that small chuck of code you are dealing with, and that you don't have some error that is cascading into other functions.

    First write something that will simply open the required file, and to make sure you can open it, and it would help just to to do a straight file copy but as reading lines.

    Then perform any tasks required to work with the line (ie remove white space, check to see if live isn't a comment, skip the line if invaild, etc)

    Extract your KEY/VALUE and make sure those are legal to use.

    Use your KEY/VALUE to feed your program.

    Hope that helps!

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,439
    So it's close to the end of the course...

    What strategies did you develop to solve your increasingly difficult problems up until now?

    How about something like -> A development process

    Of course, if your strategy up to now has been "find a new forum to leech off", then you deserve to fail.

    Post some effort, then we'll help.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 11-17-2010, 01:15 PM
  2. Stuck......help greatly appreciated.
    By matt.s in forum C Programming
    Replies: 5
    Last Post: 10-14-2009, 06:10 PM
  3. Noobie question, all help greatly appreciated!
    By axehero in forum C++ Programming
    Replies: 8
    Last Post: 10-17-2007, 09:47 PM
  4. Any assistance would be greatly appreciated
    By iiwhitexb0iii in forum C Programming
    Replies: 18
    Last Post: 02-26-2006, 11:06 AM
  5. Your help would be greatly appreciated
    By Sway2 in forum C++ Programming
    Replies: 3
    Last Post: 12-03-2002, 06:55 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21