You are on page 1of 7

Programming Fundamentals

Lab Assignment 1

Session: Fall 2014

Faculty of Information Technology
UCP Lahore Pakistan
Submission Deadline: 8 Nov 2014

Here is my work station Cool nah.. These are informal files typed by me so try not to be surprised if you are unable to find your favorite jargons. Let check the emails for today’s tasks. By the way my boss is too grumpy :P Ok this informal email is from the CSA (Chief Software Architect) about task. Requirements as per Major Daud: 1) The software must be able encrypt/decrypt messages.My name is TurboByte (nick actually). 2) Every message should be decrypt and info to be stored in the system. And also the info is purely fictional but based on the actual requirements. We will have more fun on the way. 3) Saved info could be viewed by authorized persons only. Born and raised somewhere in Pakistan. What happened in between well we’ll talk someday later.. My real name is difficult to pronounce so leave it. Please check the attached files for complete info. It’s not the actual thing we are developing. Here is my Display Pic (Hmm not photogenic so leave it too). it’s just a mockup of which type of things we will do in this project on full scale. Regards Hmm ok let check what’s in the files. . It reads: This software is confidential and required by one of military Station. And after many years I became the most expensive developer of my company.

“Recv Ammo Type:3 Quantity:500” means we received ammunition of type 3 and quantity is 500. “Takeoff Squadron:2 Hawk:4” means Airplane no 4 from Squadron no 2 took off. In this case the status should be 1. And display message and tell us that ammunition was added to which box. 5 Squadrons numbered from 0-4. Now add this to boxes but make sure that no box can handle more than 500. Remember each section can have 50 soldiers max. Remember all soldiers which are to be dispatched should be from one section. 10 Sections. b. Update the count in sections from which the soldiers were dispatched and also update the count in the Check post where they were sent. f. if no slot of 9 is available then display the alert message that please inspect the soldiers. b. in box 1 its 400. 6) Messages are of the following format: a. b. And also it should minus the quantity from the respective boxes. So the expected message should be like “50 from box 0. 200 in box 2 and 200 in box 3. 1 if its in air. Now update the count in Check post number 9 and add these soldiers to the section where 9 slots are available. For example in box 0 we have only 50 bullets left. d. c. 20 check posts. . Now System should determine that from which section 10 soldiers are available.  10 boxes of each type numbered from 0-9. Now system should update the status of plane which 0 if on ground.4) We need different levels of authorizations. in box 2 its 300 and in box 3 its 200. b. System should add 100 in box 1. “Send Ammo Type:0 Quantity:350” means We need to send ammunition from type 0 and Quantity is 350. 300 from box 1”. 10 airplanes in each squadron. d) Check posts: a. For example in box 0 the quantity is 500. 15 soldiers on each check posts.  Each box contained max 500 rounds. e. Update its status to 0. 50 soldiers in each Section. Now system should tell us from which boxes should we pick the bullets. 5) Our Current list of entities is as follows: a) Ammunition Store:  4 types of ammunition numbered from 0-3. c) Soldiers: a. b) Airplanes: a. “Arrive Count:15 CP:9” means 15 soldiers arrived from Check post number 9. “Dispatch Count:10 CP:14” means dispatch 10 soldiers to Check Post number(CP) 14. “Landed Squadron:3 Hawk:7” means Airplane no 7 from Squadron number 3 just landed.

As we have 500 soldiers (10 sections with 50 soldiers each). . b. e. Hmm Ok that was lot of info to digest let’s have a cup of tea. Ok now next file is from CSA lets peek in to that.wikipedia. Search Low ammunition: System should ask the type of ammo and the quantity now it should search and display all the boxes from the give type which are less than the given quantity. Technical Briefing by CSA: I am sure you might be having a rough idea by that what they require from us. 2) Receiver: He can only get the Decrypted message and enter that in the system. Now output all boxes from type 2 which are having quantity less than 100. Status of Ammunition: A table where we could see the quantity of Ammunition in each box. 8) We have three types of users 1) Dispatcher: He can only encrypt the message and view the encrypted one. 3) Admin: He can view all the above reports. Status of Sections: Show the number of soldiers in each Sections.g type: 2 quantity: 100. For encryption/decryption we will use Caesar cipher . . For info on that please read this link http://en. Status of Check Post: Show the number of soldiers in each check posts. 7) We should be able to view the following info: a. So our Tally of Soldiers in all Check Posts and Sections should sum up to 500. Airplane Status: A table where we could see which plane is in air and which is on ground. c.g. d.

All checkpost empty. Make sure of 3 things: a) Program should not be terminate when we logout from any account. Admin Should be able to view all the require reports (refer to point 7 in Major Daud’s File).e.So the flow of program should be like: Login by using the username and password Dispatcher: Enter the message Reciever: Enter the Encrypted Message Admin: View the reports Firstly Program should ask the username and password. The actual system would be on different Computers communicating through secure network. c) Login from the Admin account to see the reports. . Usernames are given above i. b) Login from the Reciver account and add the encrypted message into the system. receiver and admin. Upon login users should see only those options for which they are authorized like the dispatcher should only be able to enter the message and see the encrypted string. Program should decrypte the Message and then it should update the info accordingly. Dispatcher. For now to simulate the program do this: a) Login from the Dispatcher account Enter the message and note down the encrypted string. all sections full and Ammunition to full. Receiver could only enter the encrypted message and see the results (refer to point 6 in Major Daud’s file). It should ask to login again to the same or other account. b) All info should come from the message. There should be an option to terminate the program other than that option program should not be termiated or close. No manual entry of any info. c) When The program starts it should put the status of Airplane 0.

no/development/cppstyle.Finally over with is brief. Hmm wait there is another email from Senior White Box tester. It reads : Please make sure that your code is according to the following guidelines: http://geosoft. Let have a hot pizza : Ok now we are refreshed Lets start Coding… . Regards Now we are over with this brief and honestly that was bit hard to digest all this.html Code Should be properly Indented and well Commented.

Join or Create discussions on any topic related to keep in touch with group to see what others students are asking. .facebook.Note: Post all your queries to the study group at https://www.