Ada Programmers..Need a bit of help

Discussion in 'OT Technology' started by Kieffer87, Sep 19, 2007.

  1. Kieffer87

    Kieffer87 Orly OT Supporter

    Joined:
    Sep 23, 2005
    Messages:
    1,491
    Likes Received:
    0
    Location:
    Where the Green Grass Grows
    I have one program that writes keeps an inventory of the name of pop and the total amount in stock. It writes this data to a binary file. My assignment is to write a program that takes that binary file and displays the data on screen. However I can't for the life of me get it to print the actual data in the file, It always prints garbage. Hopefully someone can give me a hand. The link has the data file.

    Code:
    with Ada.Sequential_IO;
    with Ada.Text_IO;
    procedure Display is
    
       --Package for input of integers from a sequential file
       package Seq_Character_IO is new Ada.Sequential_IO (Element_Type => Character);
    
       Value : Character; --Value to be written to screen
    
       Int_File : Seq_Character_IO.File_Type; --The sequential file
    
       begin
          --Prepare file to open
          Seq_Character_IO.Open (File => Int_File, Mode => Seq_Character_IO.In_File, Name => "Pasta.dat");
    
          Display_Loop:
          loop
             exit Display_Loop when Seq_Character_IO.End_Of_File (Int_File);
             Seq_Character_IO.Read (File => Int_File, Item => Value);
             Ada.Text_IO.Put (Item => Value);
             Ada.Text_IO.New_Line;
          end loop Display_Loop;
          Seq_Character_IO.Close (Int_File);
    end Display;
    http://rapidshare.com/files/56817822/Pasta.Dat.html
     
  2. CodeX

    CodeX Guest

    I am pretty sure Ada programmers are all dead...
     
  3. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    I knew this one guy in college who liked ADA. Never got along with him, though.
     
  4. Kieffer87

    Kieffer87 Orly OT Supporter

    Joined:
    Sep 23, 2005
    Messages:
    1,491
    Likes Received:
    0
    Location:
    Where the Green Grass Grows
    Yea I took C/C++ for my computer Science 1 and 2 classes which wasn't bad. I actually like Ada better I think its a bit more straight forward. I still don't understand why all of the sudden when you hit computer Science 3 though they go and make you learn a new language. Doesn't make much since to me.
     
  5. CodeX

    CodeX Guest

    I hate universities pushing java so much. c/c++ is the defacto industry standard, java is a novelty that will never catch on for real development. Sure it can be useful for online or distributed network applications, but it is a purely academic language, more of a proof of concept than anything practical.

    It reminds me of linux, java fans and linux fans are deviants for the sake of being deviants.
     
  6. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    Clearly you haven't used Kubuntu. It's the easiest Linux ever, provides a comparable experience to windows, and with the addition of the CNR database, you'll be able to buy pre-configured installers for all of the non-free programs you could ever want.

    Anyway, back on topic: Java is useful when you need to write a desktop app that can run on multiple operating systems, but nobody does that anymore, so I agree with you there. Kinda the same with .NET, though, and .NET isn't even supported on anything besides Windows, so yeah, C++ is still the king.
     
  7. Penguin Man

    Penguin Man Protect Your Digital Liberties

    Joined:
    Apr 27, 2002
    Messages:
    21,696
    Likes Received:
    0
    Location:
    Edmonton, AB
    Because you're not at school to become a programmer, you're at school to become a computer scientist. A computer scientist should have enough understanding about how programming works to learn a new language quickly. To gain these skills, you have to see and use a wide variety of languages, since not all languages work the same way.

    In my third year, I used several new languages: scheme, prolog, matlab. They all work in different ways and are good for different things.
     

Share This Page