2002 LSU Computer Science High School Programming Contest

Sponsored by Microsoft

Computer Language Information

 MAIN
  Home
  Schedule
  Registration
  Rules
  About
  Language
  Prizes
  
 RESULTS
  Problem Set
  Judge Data
  Solutions
  
 LINKS
  LSU
  Computer Science
  Contest Index
  HS 2001
  HS 2000
  ACM Intl PC
  PC2
  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.

  • 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);
      		

  • 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:
    • Make sure there is a uses Forms; {$apptype console} section between the program xxxx; and the const or var section.

  • 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.

  • 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 v5.0

    NOTES  |  Example Program  |  Judging Information

  • NOTES:

    • When you create your project, just select the standard.exe, not a GUI. Use only one form for your application. Submit only your form file (we just need the form source-- not the whole project).
    • You must name your main subroutine main!

  • 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

Return to Top of Page


Microsoft Visual C/C++ v5.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.

  • 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


IBM Visual Age C/C++

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

  • NOTES:

      None.

  • To Make It Work:

      Nothing special must be done.

  • 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:


  • Example Program:

      import java.io.*; //include Java's standard Input&Output routines
      
      class practice {
      
      public static void main (String[] args) throws IOException {
      
      	// 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 2002 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    Last modified: Friday, 26 April, 2002 10:06:09