BCS1101 Assignment on Principles of Programming

Added on - 09 Oct 2019

  • 6


  • 1229


  • 26


  • 0


Showing pages 1 to 3 of 6 pages
BACHELOR OF COMPUTER SCIENCE (HONS)BCS1101 – PRINCIPLES OF PROGRAMMINGIndividual AssignmentInstructions:AnswerALLquestionsThe answer for each question should comprisePseudocode,Flowchartand SourceCode.Marks will be awarded for good presentation and thoroughness in your approachNOmark will be awarded for the entire assignment if any part of it is found to becopied directly from printed materials or from another student.Submit your assignment inhardcopy(printed) andsoftcopy(save all your worksin to a CD)Complete this cover sheet (page 1 and 2) and attach it to your assignment.Student’s Particulars:Matric No:Intake / Semester:Student’s Name:Lecturer’s Name:Assoc. Prof. Dr. Lee Lam HongDue Date:Submission Date:Total number of pages including this cover page :Official Use:Marker’s CommentMarks Awarded :/ 100Overall Marks (20%) :Student declaration:
BCS1101 – Principles of ProgrammingIndividual AssignmentI declare that:I understand what is meant by plagiarismThe implication of plagiarism has been explained to me by my institutionThis assignment is all my own work and I have acknowledged any use of thepublished and unpublished works of other people.Student’s signature:..................................Date:...........................Marks Sheet:Marks TableQuestionsMarksAllocatedMarksAwardeda10b40c10d10e20f10Total100Overall Total :/1002/6
BCS1101 – Principles of ProgrammingIndividual AssignmentQuestion (100 marks)Battleship(alsoBattleshipsorSea Battle) is aguessing gamefor two players. It is knownworldwide as apencil and paper game which dated back since World War I. The purpose ofthe game is to destroy all opposing player's battleships, and ends with a fight to the death.The figure above illustrates a map of one player's ships and the hits against them, from agame in progress. The grey boxes are the ships placed by the player, and the cross marksshow the squares that their opponent has fired upon. The player would be tracking the successof their own shots in a separate grid.The game is played on fourgrids, two for each player. The grids are typically square –usually 10×10 – and the individual squares in the grid are identified by letter and number. Onone grid the player arranges ships and records the shots by the opponent. On the other gridthe player records their own shots.[Source: https://en.wikipedia.org/wiki/Battleship_(game)]Write a Battleship computer game in C language to fulfil the criteria described using standardANSI C Programming Language.(a)Your computer game shall follow strictly the configurations below:(10 marks)The size of the game board should be a10x10 gridThe game can be played by2 players.The types and number of ships for each player are as below:Class ofshipSizeNumberCarrier51Battleship423/6
You’re reading a preview

To View Complete Document

Become a Desklib Library Member.
Subscribe to our plans

Unlock This Document