Preview

12 computer science notes ch4D Arrays a

Powerful Essays
Open Document
Open Document
5461 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
12 computer science notes ch4D Arrays a
Chapter - 4
Structured Data Types : Arrays and Structures.
Objectives :






to understand the meaning of structure datatypes and its availability in C++.
To appreciate the use and importance of Arrays in C++ to differentiate between the use and implementation of different types of Arrays
To use structures as User Defined data type to write programs.
To understand and use typedef

Structured Data types :
Students till now whatever data type we have used are just primitive data types like int , char , float , etc. All these datatypes are defined within the C++ compiler and that is why they are also called as primitive. We can define a length using int , a weight using float , a name using characters etc. but suppose I tell you “please define a fruit for me in program” ,then your mind starts wondering, as you can't define a fruit just with any one datatype as you did with length , weight etc.
A Fruit itself is a composite entity having following attributes : color : can be described with a name i.e. char [ ] taste : can be described with a name i.e. char[ ] season : can be described with int i.e. 1 for summer , 2 for winter … price : can be described as float ans so on...
This means that to describe a fruit we need to have a collection of data-types bundled togeather so that all the attributes of the fruit can be captured. This is true for any real world thing around you say student , mobile , plant etc. So when we bundle many primitive data types together to define a real world thing then it is known as derived data type or structured data type or User defined data types. In this chapter we would look onto two important structured data types , one is Array and the other one is Structure.
Sometimes we need to have variables in very large quantities , that too of same data type i.e. suppose we want 200 integer variables. In this situation will you declare 200 individual variables ? Absolutely not. This is because it will :
a) wastage of time as well time taking

You May Also Find These Documents Helpful

  • Good Essays

    Week 1 Lab_ CIS_115

    • 439 Words
    • 2 Pages

    List all variables you will use (use valid variable names). Indicate whether the data type is string, integer, or decimal, and so on.…

    • 439 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    The column specification that determines what kind of data can be stored in that column, character versus numeric or date, for example.…

    • 327 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    5. (TCO 2) A collection of related data items that are specific to an instance of an entity, such as all the data about a specific employee, is (Points : 4)…

    • 368 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    Nt1330 Unit 1 Research Paper

    • 4285 Words
    • 18 Pages

    Each character requires one byte as it is usually stored as an ASCII character. Notice that a digit such as 8 could be held as either a character, an integer or even a real. If any calculations are going to take place on the value then it should be held as either an integer or a real. If the calculation will never result in it being extremely large or gaining decimal places then an integer should be used.…

    • 4285 Words
    • 18 Pages
    Powerful Essays
  • Powerful Essays

    Unit 18 - Database P1, M1

    • 995 Words
    • 4 Pages

    Data type is the type of content and it decides the content can be input and the file size.…

    • 995 Words
    • 4 Pages
    Powerful Essays
  • Good Essays

    7 and Array

    • 500 Words
    • 2 Pages

    7. When a single array element, such as myArray[2], is passed to a method, the method receives _____.…

    • 500 Words
    • 2 Pages
    Good Essays
  • Good Essays

    Data Base

    • 2312 Words
    • 10 Pages

    * SQL Server offers a list of system data types which can be utilized to define various types of data within SQL Server. SQL Server data types are composed of string, binary, number, date and other types, such as sql_variant, xml and cursor. A user is also able to define his own data types in Transact-SQL or the Microsoft .NET framework. However, these user-defined data types are based on the existing system data types. User-defined types gain their characteristics from the methods of a class, which the user builds within the programming languages supported by the .NET framework.…

    • 2312 Words
    • 10 Pages
    Good Essays
  • Better Essays

    ii. The first component of the class definition is called the access_mode. It will either be public, abstract, final, or not used at all.…

    • 939 Words
    • 4 Pages
    Better Essays
  • Good Essays

    When we are kids our parents tend to teach us how important is to eat fruits, what they don’t teach us is what comes along with that. That is for us to experience because only the ones who do, are the ones who can really take something out of it. I am a fruit person; I can say that I like them all but every time I try eating strawberries something interesting happens to me. I am like a little girl looking for what is there to learn about fruits in her first day of kindergarten, but all at the same time, using my five senses.…

    • 530 Words
    • 3 Pages
    Good Essays
  • Good Essays

    SCIENCE FAIR 2014

    • 400 Words
    • 2 Pages

    5. Make sure all different types of fruit are cut into pieces of the same size and that there are no pieces of fruit skin or seeds.…

    • 400 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    use a lot in research studies or experiments. Example of a variable can be height, weight, number of…

    • 215 Words
    • 1 Page
    Satisfactory Essays
  • Better Essays

    A database stores keyed information in an organized and accessible manner. The size and capacity of databases can vary widely, from a small database used by an individual to file phone numbers, to an extremely large enterprise database that stores several gigabytes of information accessed by thousands of individuals. Databases are essential for almost every company in today's business world. Database can help us keep track of, inventory, billing, pay role, phone numbers and much more. Lacking the use of databases, work will take longer to accomplish. Another wonderful feature about having a database in place is that a record of all transitions can be kept for analyzing purposes.…

    • 807 Words
    • 4 Pages
    Better Essays
  • Good Essays

    Comparative Analysis

    • 920 Words
    • 4 Pages

    Data is defined as a group of symbols I form of a text, image, or voice representing…

    • 920 Words
    • 4 Pages
    Good Essays
  • Good Essays

    Data Dictionary

    • 473 Words
    • 2 Pages

    Character (Char), numeric (N) including number of decimals, integer (Smallint, Int), memo, binary, varchar, etc.…

    • 473 Words
    • 2 Pages
    Good Essays
  • Good Essays

    Entity type describes the schema or intension for a set of entities that share the same structure.…

    • 720 Words
    • 3 Pages
    Good Essays

Related Topics