Thread: Someone can help me with my assignment

  1. #1
    Registered User
    Join Date
    Mar 2011

    Someone can help me with my assignment

    Assignment 1: Wind Speed Processor
    A device that connected to wind station constantly sends data on wind details (like wind speed, day and direction) that is stored in a log file (text file).
    The data send is 16 bits in the following format:
    Direction – 4 bits (1 – North, 2 – North West, 3 – West, 4 – South West, 5 – South, 6 – South East, 7 – East, 8 – North East) (0001 to 1000)
    Day – 4 bits (1 – Sunday, 2 – Monday… 7 – Saturday) (0001 to 0111)
    Wind Speed – 8 bits (max 11111111 = 255 mph)
    E.g. 0010000100101011.
    Direction first 4 bits; 0010 ->2 ->North West
    Day second four bits; 0001 ->1 ->Sunday
    Speed last eight bits; 00101011 ->43 mph

    You are required to write a C++ program that read the data from the log file. Split the direction, day and wind speed covert and store them in an array. Calculate and display the min wind speed (with day and direction), max wind speed (with day and direction) and the average wind speed.
    Your program must do the following:
    1. Define a structure DATA with member direction, day and speed.
    2. Declare an array of DATA structure.
    3. Read all the data from the file as string, split and store them in the DATA structure array.
    4. Process the array to calculate and display the min, max and average values of the wind speed.

  2. #2
    Registered User
    Join Date
    Oct 2006
    first, read our homework policy

    then write some code, and try to make it work for yourself. when you run into problems, come back here and ask specific questions.

  3. #3
    Registered User
    Join Date
    Mar 2011
    k, i try my best first

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Menu
    By Krush in forum C Programming
    Replies: 17
    Last Post: 09-01-2009, 02:34 AM
  2. Assignment Operator, Memory and Scope
    By SevenThunders in forum C++ Programming
    Replies: 47
    Last Post: 03-31-2008, 06:22 AM
  3. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  4. Help with a pretty big C++ assignment
    By wakestudent988 in forum C++ Programming
    Replies: 1
    Last Post: 10-30-2006, 09:46 PM
  5. Replies: 1
    Last Post: 10-27-2006, 01:21 PM