Computer Programming Technique

  • Upload
    -

  • View
    218

  • Download
    0

Embed Size (px)

Citation preview

  • 8/2/2019 Computer Programming Technique

    1/16

    Department of IT and Engineering Computer Programming Technique Assignment

    Student ID: 5507 Page 1 of16

    CONTENT

    1. Introduction 22. Program Flow Chart 33. Algorithm 54. Program Documentation 105. User Documentation 116. Output 117. References 168. Bibliography 16

  • 8/2/2019 Computer Programming Technique

    2/16

    Department of IT and Engineering Computer Programming Technique Assignment

    Student ID: 5507 Page 2 of16

    Introduction:

    This computer programming technique assignment is done as a part of my course work. This

    assignment consists of basic programming technique used to code the program. In this assignment I

    have document a program for the student registration system which have a section for new student

    registration and to read the registered student details. This assignment also consists of flow diagram

    which consists of different geometrical shapes.

    Program Flow Chart:

    Start

    Read Registeredstudent Details

    Initialising

    End

    T

    F

    (Cogswell, 2005)

  • 8/2/2019 Computer Programming Technique

    3/16

    Department of IT and Engineering Computer Programming Technique Assignment

    Student ID: 5507 Page 3 of16

    Start

    End

    Select From theMenu

    Case 1:

    Case 2:

    Case 3:

    Read RegisteredStudents Details

    Enter New StudentDetails

    Exit

    T

    F

    T

    F

    T

    Cogswell, J. (2005) Cogswell, J. (2005)

  • 8/2/2019 Computer Programming Technique

    4/16

    Department of IT and Engineering Computer Programming Technique Assignment

    Student ID: 5507 Page 4 of16

    Start

    Select From theMenu

    Case 1:

    Case 2:

    Case 3:

    Read RegisteredStudents Details

    Enter New StudentDetails

    Default

    T

    F

    T

    F

    Initialising

    End

    T

    F

  • 8/2/2019 Computer Programming Technique

    5/16

    Department of IT and Engineering Computer Programming Technique Assignment

    Student ID: 5507 Page 5 of16

    Algorithm:

    /*About: This program is written as part of the fulfilment for the

    Computer Programming TechniqueCourse - HND in EEE at Icon College, London.

    Date : 18/08/2011By : Naresh Poudel. Student ID: 5507

    Tutor: Dr. Y M Gebremichael********************************************************************

    *****************/#include

    #includeusingnamespace std;

    /****************************

    Initialising the variable******************************/

    int studentIDNumber, passportNumber;

    string firstName,lastName,dateofBirth,houseNumber;string maritalStatus,nationality,placeofBirth;

    string visaRequired,courseEnrolled;string streetName,townorCity,postCode,country;

    string save,y,n;

    /************************

    Function Prototype

    *************************/void Enternewstudentdetails(void);

    void Readregisteredstudentdetails(void);

    void exit(void);void menu(void);

    void reset(void);

    void main(){

    menu();}/*******************************************************************

    **********************************About: This Program choose the option from the menu option and take

    to the blog that you have chosen.

    *******************************************************************************************************/void menu(void)

    {int menu=0;

    cout

  • 8/2/2019 Computer Programming Technique

    6/16

    Department of IT and Engineering Computer Programming Technique Assignment

    Student ID: 5507 Page 6 of16

    cout

  • 8/2/2019 Computer Programming Technique

    7/16

    Department of IT and Engineering Computer Programming Technique Assignment

    Student ID: 5507 Page 7 of16

    void Enternewstudentdetails(void)/*Function defination*/{

    cout

  • 8/2/2019 Computer Programming Technique

    8/16

    Department of IT and Engineering Computer Programming Technique Assignment

    Student ID: 5507 Page 8 of16

    cout

  • 8/2/2019 Computer Programming Technique

    9/16

  • 8/2/2019 Computer Programming Technique

    10/16

    Department of IT and Engineering Computer Programming Technique Assignment

    Student ID: 5507 Page 10 of16

    {}

    void reset(void)/* Function defination as it reset the values*/{

    studentIDNumber =0 ;passportNumber =0 ;firstName = "";lastName = "";

    dateofBirth = "";houseNumber = "";

    maritalStatus = "";nationality = "";

    placeofBirth = "";visaRequired = "";courseEnrolled = "";

    streetName = "";

    townorCity = "";postCode= "";

    country ="" ;}

    (Horton, 2006), (Wany, 2004)

    Program Documentation

    In the program function menu gives the user to select the appropriate section from the menu. I have

    used switch statements to select from the appropriate menu items.

    In the section one the program asks the user to input the different parts of the details. After the

    details are entered the program clears the screen and asks for the user to save or discard the details

    entered before. Here, if y is entered the details are saved and if n is entered the details are

    discarded. For this section I have used if else function as it help us to execute the statements of code

    in a different order, depending on certain conditions. In the read registered student details, I have

    again used if else statements to read the data that have input in the section. After the section

    executes the program as the user to enter the student ID number, if the id number matches or true

    with the details provided, it gives the relevant information, but if the student id is wrong or false, the

    program displays the message as YOU ARE UNREGISTERED. I have initialises my details as thedefault value, so if my student id number is entered the program gives my details. The next function

    is exit as it exits from the whole program. I have also used reset function to reset the values if the n

    is pressed the section 1 after the student details is entered. This discard the details used in section

    one. (Crawford, 2005) , (Deitel, 2005)

    For every menu item of the menu, I have grouped together to execute the program to make a

    function. Every function has to be declared outside the main function which is called as function

    prototype and every function has to call inside the main function. The variables that are used inside

    the function are different from the variables used in the main function. The scope of declared the

    variable within the function is their own function or block.

  • 8/2/2019 Computer Programming Technique

    11/16

    Department of IT and Engineering Computer Programming Technique Assignment

    Student ID: 5507 Page 11 of16

    User Documentation:

    As the program starts the menu item is displayed, which enables the user to use the different menu

    section. Section 1 requests the user to input the new student details and after the last item is

    entered, the program displays Yes or No prompt. If Yes is pressed, the details are saved temporarily,

    but if No is selected, the details are discarded.

    Section 2 gives the user details of the registered student. In the section 2, the program request the

    user to input the registered student ID number which after displays the registered student details. If

    the student ID number is incorrect the program displays YOU ARE UNREGISTERED message in the

    program. In the program my details are hardcoded in the system as the default values, if my student

    ID number is entered, the program displays my details.

    Section 3 exits the whole program.

    Output:

  • 8/2/2019 Computer Programming Technique

    12/16

    Department of IT and Engineering Computer Programming Technique Assignment

    Student ID: 5507 Page 12 of16

  • 8/2/2019 Computer Programming Technique

    13/16

    Department of IT and Engineering Computer Programming Technique Assignment

    Student ID: 5507 Page 13 of16

  • 8/2/2019 Computer Programming Technique

    14/16

    Department of IT and Engineering Computer Programming Technique Assignment

    Student ID: 5507 Page 14 of16

  • 8/2/2019 Computer Programming Technique

    15/16

    Department of IT and Engineering Computer Programming Technique Assignment

    Student ID: 5507 Page 15 of16

  • 8/2/2019 Computer Programming Technique

    16/16

    Department of IT and Engineering Computer Programming Technique Assignment

    Student ID: 5507 Page 16 of16

    References:

    Cogswell, J. (2005) C++ cookbook, OReilly.

    Crawford,T.(2005) C in nutshell,OReilly.

    Deitel, H.M (2005) C++ how to program, Prentice hall.

    Horton, I. (2006)Beginning visual c++, Indiana: John Wiley.

    Wany, W. (2004) Beginning programming for dummies, 3rd

    ed, Indiana: John Wiley

    Bibliography:

    Davis, R (2010)Beginning Programming with C++ For Dummies.Wiley Publishing: Indiana.

    Henkmans, D.(2003)C++ Programming for the absolute beginner, Ptemier Press: London

    Lichade, M. V(2003) C programming, Dreamtec press.Perry, G. (2001)Sams Teach Yourself Beginning Programming in 24 hours, Sams Pulication: Los

    Angels.

    Veeraraghavan, S.(2002) Sams Teach Yourself Shell Programming in 24 hours, Sams Publication.