Sunday, 30 January 2011

comp1

https://docs.google.com/present/edit?id=0Adju4tKSvCGaZGY2cWNmczNfMWRiZ3RkcXd2&hl=en

Comp1 information

http://www.gr82bgeeky.co.uk/index.php?option=com_content&view=article&id=18&Itemid=25

Link

Monday, 24 January 2011

The Guess my number works fine on my system, but is quite long now that I've seen it on the blog. I'm going to be done with my sample document soon, I picked up an Info 1 paper and noticed that in section B is when ill need to use it, i figured after finishing my document, i can practice with it on a few practice papers and fix any bugs in it. I'll continue to study the Programming requirements and find the fastest way to understand and learn about the pascal, and I'm still looking for a simple and easy to use book, nothing the size of a murder weapon.

Tuesday, 18 January 2011

Guess My Number

program GuessMyNumber;

{$mode objfpc}{$H+}

uses
crt, sysutils,
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Classes
{ you can add units after this };

Var
answer,guess,cnt:integer;
game:string;

begin
repeat
repeat
clrscr();
writeln(' *Guess My Number* ');
writeln('please select A game');
writeln;
writeln('A) Guess out of 10');
writeln('B) Guess out of 100');
writeln('C) Guess out of 1000');
writeln;
write('Your Selection: ');
readln(game);
game:= Uppercase(game);
randomize
until (game = 'A') or (game = 'B') or (game= 'C') ;
clrscr();
if game= 'A' then
begin
answer:=random(10)+1;
writeln('Game 1-10');
end
else if game = 'B' then
begin
answer := random(100)+1;
writeln('Game 1-100');
end
else if game = 'C' then
begin
answer :=random(1000)+1;
writeln('Game1-1000');
end;
cnt:=0;
repeat
write('Please Enter a Guess');
readln(guess);
cnt:= cnt+1;

if guess < answer then
writeln (' TOO LOW! GUESS AGAIN')
else if guess > answer then
writeln('Too High! GUESS AGAIN')
else
writeln('You guessed right! In ',cnt,' guesses');
until guess= answer;
repeat
writeln;
write('Play Again Y/N: ');
readln(game);
game:= Uppercase (game);
until (game= 'Y') or (game='N');
Until game = 'N';
end.

Sunday, 16 January 2011

comp1

//AQA
{Skeleton program code for the AQA Comp1 Summer 2010 examination
this code should be used in conjunction with the Preliminary
Material written by the AQA COMP1 Programmer Team developed in the
Free Pascal IDE for Win32 v1.0.10 programming environment}

{Centres using Delphi should add the compiler directive that sets
the application type to Console (other centres can ignore this
comment).  Centres can also add the SysUtils library}

{Permission to make these changes to the Skeleton Program does not
need to be obtained from AQA - just remove the \ symbol from the
next line of code and remove the braces around "Uses SysUtils"}

//RG.SkuToV
//BB.Bin Power
//     Chnges to original code are documented as comments past the 80
//   character line. Some additional comments have been added for clarity
//   and original post of this version can be obtained from:
//
//                  http://comp1-2010.blogspot.com
//
//   List of changes V1.0:
//       * Line 114  // Who's go added                      \\Added by BB 01/03/2010
//                   Added to show which players turn it is whilst in game
//       * Line 133 // Y corodinate validation added        \\Added by RG 01/03/2010
//               Added to confirm y coordinates given
//           are in acceptable range.   
//       * Line 135 // Occupied Space validation added      \\Added by RG 02/03/2010
//               Added to confirm a given space in empty before
//           allowing a move.
//       * Line 154 // Diagonal Conditions Added            \\Added by RG 01/03/2010
//               Added to include diagonal lines in the win conditions
//           for each game.
//       * Line 166 // Added ; for compiler error           \\Added by RG 01/03/2010
//               Added a ; to fix syntax error in code
//       * Line 179 // Added : for compiler error           \\Added by RG 01/03/2010
//          Added a : to fix syntax error in code
//       * Line 189 // Added Name Validator                 \\Added by BB 02/03/2010
//          Added code to ensure entered names are different
//
//      Various doccumentation, comments and formatting     \\Added by RG 02/03/2010
//      added for ease of reading.
//
//  This work is @COPYLEFT ALL WRONGS RESERVED
//       All users of this work have:
//         0. the freedom to use the work,
//         1. the freedom to study the work,
//         2. the freedom to copy and share the work with others,
//         3. the freedom to modify the work, and the freedom to distribute
//                  modified and therefore derivative works.
//
//  Any subsequent release must contain all notices
//  prior to this point and must be released under the same user license (Copyleft)

{$APPTYPE CONSOLE}
uses
  SysUtils;

Type
  TBoard = Array[1..3, 1..3] Of Char;
Var
  Board : TBoard;
  PlayerOneName : String;
  PlayerTwoName : String;
  PlayerOneScore : Real;
  PlayerTwoScore : Real;
  XCoord : Integer;
  YCoord : Integer;
  ValidMove : Boolean;
  NoOfMoves : Integer;
  GameHasBeenWon : Boolean;
  GameHasBeenDrawn : Boolean;
  CurrentSymbol : Char;
  StartSymbol : Char;
  PlayerOneSymbol : Char;
  PlayerTwoSymbol : Char;
  Answer : Char;

Procedure DisplayBoard(Board : TBoard);
  Var
    Row : Integer;
    Column : Integer;
  Begin
    Writeln('  | 1 2 3 ');
    Writeln('--+-------');
    For Row := 1 To 3
      Do
        Begin
          Write(Row, ' | ');
          For Column := 1 To 3
            Do Write(Board[Column, Row], ' ');
          Writeln;
        End;
    Writeln;
  End;

Procedure ClearBoard(Var Board : TBoard);
  Var
    Row : Integer;
    Column : Integer;
  Begin
    For Row := 1 To 3
      Do
        For Column := 1 To 3
          Do Board[Column, Row] := ' ';
  End;

Procedure GetMoveCoordinates(Var XCoordinate, YCoordinate : Integer);
var CurrentPlayer : String;
  Begin
    if (PlayerOneSymbol = CurrentSymbol)                                        // Who's go added
     then CurrentPlayer := PlayerOneName
     else CurrentPlayer := PlayerTwoName;
    Write(CurrentPlayer, ' Enter x coordinate: ');
    Readln(XCoordinate);
    Write(CurrentPlayer, ' Enter y coordinate: ');                              // Who's go added /end
    Readln(YCoordinate);
    Writeln;
  End;

Function CheckValidMove(XCoordinate, YCoordinate : Integer;
                                Board : TBoard) : Boolean;
  Var
    ValidMove : Boolean;
  Begin
    ValidMove := True;
    {Check x coordinate is valid}
    If (XCoordinate < 1) Or (XCoordinate > 3)
      Then ValidMove := False;
    If (YCoordinate < 1) Or (YCoordinate > 3)                                   // Y corodinate validation added
      Then ValidMove := False;
    If Board[XCoordinate, YCoordinate] <> ' '                                   // Occupied Space validation added
      Then ValidMove := False;
    CheckValidMove := ValidMove;
  End;

Function CheckXOrOHasWon (Board : TBoard) : Boolean;
  Var
    Row : Integer;
    Column : Integer;
    XOrOHasWon : Boolean;
  Begin
    XOrOHasWon := False;
    If (Board[1, 1] = Board[2, 2])                                              // Diagonal Conditions Added
        And (Board[2, 2] = Board[3, 3])
            And (Board[2, 2] <> ' ')
        Then XOrOHasWon := True;
    If (Board[1, 3] = Board[2, 2])
        And (Board[2, 2] = Board[3, 1])
            And (Board[2, 2] <> ' ')
        Then XOrOHasWon := True;                                                // Diagonal Conditions Added /end
    For Column := 1 To 3
      Do
        If (Board[Column, 1] = Board[Column, 2])
            And (Board[Column, 2] = Board [Column, 3])
              And (Board[Column, 2] <> ' ')
          Then XOrOHasWon := True;
    For Row := 1 To 3
      Do
        If (Board[1, Row] = Board[2, Row])
            And (Board[2, Row] = Board [3, Row])
              And (Board[2, Row] <> ' ')
          Then XOrOHasWon := True;                                              // Added ; for compiler error
    CheckXOrOHasWon := XOrOHasWon;
  End;

Function GetWhoStarts : Char;
  Var
    RandomNo : Integer;
    WhoStarts : Char;
  Begin
    RandomNo := Random(100);
    If (RandomNo Mod 2) = 0
      Then WhoStarts := 'X'
      Else WhoStarts := 'O';
    GetWhoStarts := WhoStarts;                                                  // Added : for compiler error
  End;

///////////////////////{ Main program block starts here }\\\\\\\\\\\\\\\\\\\\\\\
Begin
  Randomize;
  Write('What is the name of player one? ');
  Readln(PlayerOneName);
  Write('What is the name of player two? ');
  Readln(PlayerTwoName);
  while (PlayerOneName = PlayerOneName)                                         // Added Name Validator
    do
      begin
        Writeln ('Player names can''t be the same');
        Write('What is the name of player two? ');
        Readln(PlayerTwoName);
    end;                                                                        // Added Name Validator /end
  Writeln;
  PlayerOneScore := 0;
  PlayerTwoScore := 0;
  Repeat {Choose player one's symbol}
    Write(PlayerOneName, ' what symbol do you wish to use, X or O? ');
    Readln(PlayerOneSymbol);
    Writeln;
    // validate entry
    If Not (PlayerOneSymbol In ['X', 'O'])
      Then
        Begin
          Writeln('Symbol to play must be uppercase X or O');
          Writeln;
        End; {begin}
  Until PlayerOneSymbol In ['X', 'O']; {repeat, player 1 choose}
  //set player 2 symbol
  If PlayerOneSymbol = 'X'
    Then PlayerTwoSymbol := 'O'
    Else PlayerTwoSymbol := 'X';
  StartSymbol := GetWhoStarts;
  Repeat {Play a game}
  // initialise variables
    NoOfMoves := 0;
    GameHasBeenDrawn := False;
    GameHasBeenWon := False;
    ClearBoard(Board);
    Writeln;
    DisplayBoard(Board);
    //choose starting player
    If StartSymbol = PlayerOneSymbol
      Then Writeln(PlayerOneName, ' starts playing ', StartSymbol)
      Else Writeln(PlayerTwoName, ' starts playing ', StartSymbol);
    Writeln;
    CurrentSymbol := StartSymbol;
    Repeat {Play until a player wins or the game is drawn}
      Repeat {Get a valid move}
        GetMoveCoordinates(XCoord, YCoord);
        ValidMove := CheckValidMove(XCoord, YCoord, Board);
        If Not ValidMove
          Then Writeln('Coordinates invalid, please try again');
      Until ValidMove;
      Board[XCoord, YCoord] := CurrentSymbol;
      DisplayBoard(Board);
      GameHasBeenWon := CheckXOrOHasWon(Board);
      NoOfMoves := NoOfMoves + 1;
      If Not GameHasBeenWon
        Then
          If NoOfMoves = 9 {Check if maximum number of allowed moves has been reached}
            Then GameHasBeenDrawn := True
            Else
              If CurrentSymbol = 'X'
                Then CurrentSymbol := 'O'
                Else CurrentSymbol := 'X';
    Until GameHasBeenWon Or GameHasBeenDrawn;

    //////// End of Game code \\\\\\\\

    If GameHasBeenWon {Update scores and display result}
      Then
        If PlayerOneSymbol = CurrentSymbol
          Then
            Begin
              Writeln(PlayerOneName, ' congratulations you win!');
              PlayerOneScore := PlayerOneScore + 1;
            End
          Else
            Begin
              Writeln(PlayerTwoName, ' congratulations you win!');
              PlayerTwoScore := PlayerTwoScore + 1;
            End
      Else Writeln('A draw this time!');
    Writeln;
    Writeln(PlayerOneName, ', your score is: ', PlayerOneScore:3:1);
    Writeln(PlayerTwoName, ', your score is: ', PlayerTwoScore:3:1);
    Writeln;
    If StartSymbol = PlayerOneSymbol
      Then StartSymbol := PlayerTwoSymbol
      Else StartSymbol := PlayerOneSymbol;
    Write('Another game Y/N? ');
    Readln(Answer);
  Until (Answer In ['N', 'n']);
End.

Review of 2010 exams and guidance for centres on 2011 exams

Review of 2010 exams and guidance for centres on 2011 exams
We take a great deal of care to ensure that our developments are supported by rigorous research and that our work is governed by strict quality assurance procedures. However, regrettably, during the post-
results period, it became clear that some parts of the separate (unconstrained) answer books for a small number of candidates’ scripts which had been marked on screen, were unmarked. We are making
changes to our internal quality controls to ensure that this cannot happen again.
To assist us in making sure that candidates get the appropriate credit for their work, it would be helpful if you could explain to your candidates the importance of clearly numbering answers on scripts.

Candidates working with separate (unconstrained) answer books should:
• number all responses according to question paper instructions
• write clearly the number of each question answered, leaving a space of two lines before starting the next response
• ensure the number of each question answered comprises two digits. These will start with 0 for numbers under l0, eg 0l, 02 etc
• always use the question numbers printed in black boxes on the question paper. Section and topic numbers that are given as part of the question should not be used
• write question numbers in the white boxes in the margin of the answer book, not in the main body of the answer
• write again the number of the question they wish to continue to answer later in their script, using the white boxes next to the start of each response. Asterisks should not be used to indicate the inclusion of footnotes or additional material which has been added to a response elsewhere in the answer book.
Four-page Supplementary answer books
Candidates should:
• use a four-page Supplementary answer book if they need more space to answer questions; they should not use a second answer book
• complete the information in full on the front of the answer book and on the front of any four-page Supplementary answer book(s) used.
By following this guidance, candidates will support us to identify each question answered and mark it correctly.
What other support is available on the Examination of Long Answers?
• Guides for:
• Teachers
• Exams Officers
• Students
• Question papers and mark schemes
• Summer 2010 can be downloaded from Secure Key Materials (until April 2011)
• Specimen question papers are on the subject pages of aqa.org.uk
For more information on this topic, please contact:

Thursday, 13 January 2011

book required

AQA Computing AS’ by Kevin Bond and Sylvia Langfield, published by Nelson Thornes

AQA computing

  AQA specification
http://web.aqa.org.uk/qual/gce/ict/computing_materials.php?id=04&prev=04
AQA will support the following programming languages.

• Pascal

 

This list will be updated as required. Centres will be asked to make their preferences known to AQA at the start of
the course.
3.1.1 Fundamentals of Problem Solving
Introduction to Principles Focus on studying the processes of computation and understanding
of Computation why and where they are important in Computing.
(See the

Stages of Problem Solving Understand the problem.
Define the problem
 given(s)
 
, goal,
ownership,
 resources
algorithm. See Chapter 1.2 ‘AQA Computing AS’ by Kevin Bond and Sylvia Langfield, published by Nelson Thornes
6
GCE Computing Specification for AS exams 2009 onwards and A2 exams 2010 onwards (version 1.5)
3
3.1.2 Fundamentals of Programming
Features of Imperative High Illustrate these features for a particular imperative, third-generation
Level Languages language such as Pascal.
Data Types Use the following appropriately.
• Built-in Integer, byte, real, boolean, character, string, date/time.
• User-defined Enumerated, subrange, sets, records, arrays.
The Role of Variables Recognise the different roles a variable can take:
fixed value, stepper, most recent holder, most wanted holder,
gatherer, transformation, follower, temporary.
Programming Statements Use these statement types.
• Type Definitions
• Variable Declarations
• Constant Definitions
• Procedure/Function
Declarations
• Assignment
• Iteration
• Selection
• Procedure and Function calling Explain the advantages of procedure/functions.
Arithmetic operators including +, –, /, x, DIV, MOD
modular arithmetic
Relational operators =, <, >, <>, <=, >=
Boolean operators NOT, AND, OR
Logical bitwise operators NOT, AND, OR, XOR
Set operators Union, difference, intersection, membership.
Built-in functions Arithmetic functions: round, truncation.
String handling functions: length, position, substring, concatenation.
String conversion functions to/from integer, real, date/time.
Constants and Variables Explain the advantages of named variables and constants.
Procedure and Function Describe the use of parameters to pass data within programs.
Parameters Understand the different mechanisms for parameter passing:
by value and by reference.
Fundamentals of Structured Understand the structured approach to program design and
Programming construction.
Construct and use structure tables, structure charts and hierarchy
charts when designing programs.
Use meaningful identifier names.
Use procedures/functions with interfaces.
Use procedures that execute a single task.
Explain the advantages of the structured approach.
Data Structures
• One- and Two-Dimensional Arrays Use arrays in the design of solutions to simple problems.
• Fields, Records and Files Read/write records from/to a file: csv file or file of records.
Validation Understand the importance of validation of input data.
Program simple validation.
7
GCE Computing Specification for AS exams 2009 onwards and A2 exams 2010 onwards (version 1.5)
3
3.1.3 Fundamentals of Data Representation
Bit Patterns in a Computer Explain the different interpretations that may be associated with a
pattern of bits.
Binary number system
Pure Binary Representation of Describe the representation of unsigned denary integers in binary.
Denary Integers Perform conversion from denary to binary and vice-versa.
Binary Arithmetic Add two binary numbers and multiply two binary numbers.
Representation of signed integers by Describe the use of Two’s Complement to perform subtraction.
Two’s Complement Convert a denary integer into Two’s Complement and vice versa.
The Concept of Number Bases: Describe the conversion of a denary integer to hexadecimal form and
Denary, Binary and Hexadecimal vice versa. Describe the use of hexadecimal as shorthand for binary.
Integers and Numbers with a Draw a distinction between integers and numbers with a fractional
Fractional Part part in a computer context.
Describe how an unsigned denary number with a fractional part is
represented in fixed-point form in binary.
Information Coding Schemes Describe standard coding systems for coding character data.
• ASCII Differentiate between the character code representation of a denary
• Unicode digit and its pure binary representation.
Error checking and correction Parity bits, Hamming code.
Gray coding Describe Gray coding. Explain why and where it is used.
Representing Images, Sound Describe how bit patterns may represent other forms of data
and other data including graphics and sound.
Bitmapped Graphics Bitmaps: resolution, colour depth and simple bitmap file calculations.
Vector Graphics Vector graphics: drawing list – objects and their properties.
Compare bitmaps to vector graphics; advantages, disadvantages.
Sound files The need for compression and basic techniques for compression.
Sampled Sound and Nyquist-theorem Sampling resolution, sampling rate.
Sound Synthesis Streaming audio.
Analogue and Digital Data Differentiate between analogue and digital data and analogue and
Analogue and Digital Signals digital signals.
Analogue to Digital Converter (ADC) Describe the principles of operation of an analogue to digital
converter.
3.1.4 Systems Development Life Cycle
Analysis Describe the stages of development of a hardware/software system.
Design Specify the method of testing the programmed solution (dry run
Implementation testing, black box testing, white box testing).
Testing Specify the selection of test data including normal (typical), boundary
and erroneous data.
Program the solution as per design.
Test the solution using selected test data.
Evaluation Reflect on how successful the operational system is.
8
GCE Computing Specification for AS exams 2009 onwards and A2 exams 2010 onwards (version 1.5

1
ISBN 978-0-7487-8298-7
constraints
Given(s) = the initial situation
Goal = Desired target situation
Ownership = who does what
Resources and constraints = tools, knowledge,
skills, materials and rules, regulations, guidelines,
boundaries, timings
Define boundaries.
Plan solution.
Check solution.
Top-down Design / Step-wise Consider sub-problems and the use of modules.
Refinement
Decision tables Determine logical conditions and consequential actions.
Finite state machines with outputs Mealy machine
Finite state machines without outputs Finite State Automation
• state transition diagrams Draw and interpret simple state transition diagrams, transition tables.
• state transition tables
Algorithm Design Understand the term
Express the solution to a simple problem as an algorithm using
flowcharts, pseudo-code or structured English and the standard
constructs:
• sequence
• assignment
• selection
• repetition.
Hand trace simple algorithms.
Convert a simple algorithm from
• structured English into pseudo-code,
• pseudo-code into high level program code.
Understand the standard algorithms: Bubble Sort, Linear Search.
Teacher Resource Bank for examples.)1:
3.1 Unit 1 COMP1 Problem Solving, Programming,
Data Representation and Practical Exercise