2003 LSU Computer Science High School Programming Contest

 MAIN
  Home
  When
  Schedule
  Registration
  Rules
  About
  Language
  Prizes
  
 RESULTS
  Standings
  
 LINKS
  LSU
  Computer Science
  Contest Index
  HS 2002
  HS 2001
  HS 2000
  ACM Intl PC
  PC2
  
  Printable
  This page includes instructions and information about all the languages we intend to supply/support/use at the LSU Computer Science High School Programming Contest.

Table of Contents:

Return to Top of Page


Borland Turbo Pascal v1.5 for Windows

    NOTES  |  To Make It Work  |  Example Program  |  Judging Information

  • NOTES:

    • You must not try to use the debugger!!! It does not work and will crash the system (Turbo Pascal at least)!
    • You must have the uses WinCRT; at the top of your program to get output.
    • You should only use READ, READLN, WRITE, and WRITELN for I/O.

  • To Make It Work:

      You can trick standard I/O into reading from a file and writing to a file by doing the following:
    • At the top of the program, after the program declaration and before the var declaration, make sure there is
      	uses WinCRT;
      		
    • In the body of the program, after the main begin declaration, make sure there is
      	Assign(Input,'input.txt'); Reset(Input);
      	Assign(Output,'output.txt'); Rewrite(Output);
      		
    • At the end of the main program, before the end. declaration, make sure there is
      	Close(Output);
      		
    • Command Line Compiles (2003.04.01): To compile a Pascal program, execute tpcw myprog.pas. This produces myprog.exe. Pascal should be in the path, but the executable resides in C:\TPW.

  • Example Program:

    	program Welcome;
    
    	uses WinCRT;
    
    	var
    	  name: string;
    
    	begin
    	  Assign(Input,'input.txt'); Reset(Input);
    	  Assign(Output,'output.txt'); Rewrite(Output);
    
    	  Readln(name);
    	  Writeln('Welcome to Turbo Pascal for Windows, ',name);
    
    	  Close(Output);
    	end.
    	
    Items in red are the needed additions for file I/O using standard I/O commands.

  • Judging Information:

    • Look at the source for:
      • Make sure there is a uses WinCRT; section
      • Make sure the following two lines are just after the begin of the main program (if they aren't already there):
          Assign(Input,'C:\TEMP\test.in'); Reset(Input);
          Assign(Output,'C:\TEMP\test.out'); Rewrite(Output);
      • Make sure the following line is just before the end. of the main program:
          Close(Output);
      If any of these sections aren't there, return IS - Improper Submission

Return to Top of Page


Borland Delphi v6.0

    NOTES  |  To Make It Work  |  Example Program  |  Judging Information

  • NOTES:

    • You must have the uses Forms; {$apptype console}.
    • You should only use READ, READLN, WRITE, and WRITELN.

  • To Make It Work:

    • You can trick standard I/O into reading from a file and writing to a file by doing the following:
    • Create a console project by clicking on file->new->other and choosing Console Application.
    • Make sure there is a uses Forms; {$apptype console} section between the program xxxx; and the const or var section.
    • Command Line Compiles (2003.04.01): To compile a Delphi program, execute dcc32 myprog.dpr. This produces myprog.exe. Delphi should be in the path, but the executable resides in C:\Program Files\Borland\Delphi6\Bin.

  • Example Program:

    	program practice;
    
    	uses Forms; {$apptype console}
    
    	var
    		name : string;
    
    	begin
    		readln(name);
    		writeln('Hello ',name);
    	end.
    	
    Items in red are the needed additions.

  • Judging Information:

    • Look at the source for:
      • Make sure there is a uses Forms; {$apptype console} section between the program xxxx; and the const or var section. If the red section isn't there, return IS - Improper Submission

Return to Top of Page


Microsoft QBasic

    NOTES  |  To Make It Work  |  Example Program  |  Judging Information

  • NOTES:

    • Write your code to do keyboard input(INPUT) and ouput (PRINT).
    • Make sure you use the TEST button from PC2

  • To Make It Work:

      You can run your program through QBasic like you are used to. You can also create the source with your favorite editor and then do the following:
      C:\temp\practice>qbasic /run prac.bas < input.txt > output.txt
      
      This will work assuming the following:
      1. Your program and input data are in this directory
      2. Your source program file is named prac.bas (if it is not, change prac.bas to whatever you called your source file (as long as it has .bas for an extension)
      3. Your input data file is named input.txt
      You can then type type output.txt to see the output of your program. This is how our test and judge scripts work.
    • Command Line Compiles (2003.04.01): See above.

  • Example Program:

    rem Practice Problem
    
    input name$
    print "Hello ", name$
    

  • Judging Information:

    • You will need to exit the QBasic window (Under File, select Exit)
    • The output file will have a ? followed by input for every line of input the program processes.

Return to Top of Page


Microsoft Visual Basic v6.0

    NOTES  |  Example Program  |  Judging Information

  • NOTES:

    • When you create your project, just select the standard.exe, not a GUI. Do not use any forms in your application! Instead, create a Module that has at least one subroutine called Main. Submit only your Module file (.bas file) filename.bas (we just need the Module source-- not the whole project).
    • You must name your main subroutine Main!
  • To Make It Work:

      Command Line Compiles:To compile a Visual Basic Program, type on the command line

        vb6.exe /make MYPROG.vbp

      where MYPROG.vbp is your project file.( You should have at least two files: a .vbp file and a .bas file. This will produce a file called MYPROG.exe.

    • Example Program:

      Private Sub Main()
      	Close #1
      	Open "input.txt" For Input As #1
      	Open "output.txt" For Append As #2
      	Dim name as string
      	Input #1, name
      	Print #2, "Hello ",name
      	Close #1
      	Close #2
      End Sub
      	

    • Judging Information:

      • If the red section isn't there, return IS - Improper Submission
      • Here is a sample Project.vbp file. This is the file that is given to the program VB6.exe for compiling. This particular project has only one source file referenced in it, a module called module.bas.
          Type=Exe
          Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\WINNT\System32\Stdole2.tlb#OLE Automation
          Module=module; module.bas
          Startup="Sub Main"
          Command32=""
          Name="Project1"
          HelpContextID="0"
          CompatibleMode="0"
          MajorVer=1
          MinorVer=0
          RevisionVer=0
          AutoIncrementVer=0
          ServerSupportFiles=0
          VersionCompanyName="Louisiana State University"
          CompilationType=0
          OptimizationType=0
          FavorPentiumPro(tm)=0
          CodeViewDebugInfo=0
          NoAliasing=0
          BoundsCheck=0
          OverflowCheck=0
          FlPointCheck=0
          FDIVCheck=0
          UnroundedFP=0
          StartMode=0
          Unattended=0
          Retained=0
          ThreadPerObject=0
          MaxNumberOfThreads=1
          
          [MS Transaction Server]
          AutoRefresh=1
          
                              
                              

    Return to Top of Page


    Microsoft Visual C/C++ v6.0

      NOTES  |  To Make It Work  |  Example Program

    • NOTES:

      • When creating a new project, make sure you select Win32 Console Application for the project type!
      • When creating a new source file, choose C++ Source File and let it append a .cpp to your filename (this works even if you only code in C).
      • Your project should have only one .c or .cpp file.

    • To Make It Work:

      • Under the Build menu, select Rebuild All to compile.
      • Under the Build menu, select Execute <filename> to run.
      • Command Line Compiles (2003.04.01): To compile a Visual C/C++ program, first execute c:\Program Files\Microsoft Visual Studio\VC98\Bin\vcvars32.bat. Then use cl myprog.cpp. This produces myprog.exe. The vcvars32.bat program sets the environment correctly, but cl resides in C:\Program Files\Microsoft Visual Studio\VC98\Bin.

    • Example Program:

      #include <stdio.h>
      
      int main()
      {
       	char name[80];
      
      	scanf("%s",name);
      	printf("\nHello %s\n",name);
      	
      	return 0;
      }
      	

    • Judging Information:

        None.

    Return to Top of Page


    SUN Java 2 SDK Standard Edition 1.4.0

      NOTES  |  To Make It Work  |  Example Program  |  Judging Information

    • NOTES:

      • Use stdin and stdout for all input and output.
      • All judging will be done with Sun Java 2 SDK Standard Edition 1.4.0.
      • Use the PC^2 test button to make sure your program works.
      • Input file must be input.txt and in the same directory as the source.
      • Filename (before .java) must match class name.

    • To Make It Work:

      • Command Line Compiles (2003.04.03): To compile a Java program, execute javac myprog.java. This produces myprog.class. To execute this execute java myprog.class.

    • Example Program:

        import java.io.*; //include Java's standard Input&Output routines
        
        class practice 
        { // start of class practice
        
         public static void main (String[] args) throws IOException 
          { // method main
        
        	// Defines the standard input stream
        	BufferedReader stdin = new BufferedReader (new InputStreamReader(System.in));
        	String name;
        
        	name = stdin.readLine();
        
        	System.out.println("Hello " + name);
        
          } // method main
        } // end of class practice
        

    • Judging Information:


    Return to Top of Page




 

The statements and opinions included in these pages are those of 2003 LSU Computer Science High School Programming Contest only. Any statements and opinions included in these pages are not those of Louisiana State University or the LSU Board of Supervisors.
Site maintained by: Isaac Traxler
© 2000,2001,2002,2003    Last modified: Friday, 04 April, 2003 23:49:22