Hii I have this computer science home work would some body help me 1-Identify on
ID: 3622252 • Letter: H
Question
HiiI have this computer science home work would some body help me
1-Identify one similarity between an array data type and a user-defined class?
2- list two diffrences between an array data type and a user defined class ?
3- two reasone why we want to use an array in a program?
4- example when to use 2-D arrays , 3-D arrays, 4-D arrays ?
5- two advantages of using programs with GUIs
6- two disadvantage of GUI programs over non-GUI programs
7- list three prameters that are genrally considerd in the analysis of an algrothim?
I have some of these questions answers I just want to make sure
Explanation / Answer
ans 1 & 2 ):-
Both arrays and user-defined class are classified as structured data
type as provide a mechanism that enables us to access and
manipulate data in relatively easy manner. but they differ
in number of ways:-
1)An array is a collection of related data elements of same
type. User-defined class can have elements of different types.
2. An array is derived data type whereas a User-defined class is a
programmer defined one.
3) An array behaves like a built in data types only we need
to declare it.but in case of User-defined class , first we have to
design and declare a data structure before the variables of
that type are declared and used.
ans 3):-
Accessing any single short variable, or element, in the array is straightforward. Simply provide a number in square braces next to the name of the array. The number identifies which of the elements in the array you want to access.
Arrays give us some convenience when managing many variables of the same type.
ans 4):-
think of arrays like this:
square paper, where you can write only one character in each square. a strip of square paper with 10 squares, but only 1 square thick would be a 1d array.
e.g
char Example[10];
now imagine you cut up the paper so that there were 10 rows of squares, and 10 columns. a 2d array,
e.g
char Example[10][10];
for a 3d array, imagine you had 10 bits of paper, each 10 squares by 10 squares in size, sort of like a card filing system a library has.
e.g
char Example[10][10][10];
4d array would be more complicated. imagine you had 10 card filing systems, each with 10 bits of paper, 10 rows and 10 columns, and imagine you had a filing cabinet, with 10 drawers, and you put a card filing system in each drawer.
e.g
char Example[10][10][10][10];
ans 5 & 6):-
ans 7);-
Correctness
Time Complexity & Space Complexity
Effectiveness
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.