Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

QUESTION 1: (TRUE OR FALSE: NO ABBREVIATIONS PLEASEO .a)Placing elements of an a

ID: 2293642 • Letter: Q

Question

QUESTION 1: (TRUE OR FALSE: NO ABBREVIATIONS PLEASEO .a)Placing elements of an array in ascending order is called searching .b) Pointer to a structure is stored in the structure itself, for fast access c) String function 'isalphanum' returns logic O, for a lower case character input d) With bit-field configuration, need at least 4 bits to specify suit, in a 52 card deck e) typedef creates an original and secure structure f) Union has the property that the data members use the sequential memory space g) C++, variables can only be declared at the beginning of the program h) cin and cout functions from C+ can also be used in the C programming QUESTION 2]: answer the following clearly a) Integer X12]- (1,2, 3, 5, 7, 11, 13, 17,19, 23, 29, 31); Pointer Xptr refers to the first element of the X array. Y and Z are double variables; What is the value of Y (Xptr+2) (Xptr+ 11)) and Z ((Xptr+3)/ptr+9) b) In the functional SML program, the first two digits refer to the Op.code and the last two digits to the operand memory location. The Op. codes are: READ 10: wRITE 1110AD 20; STORE 21, ADD 30, SUBTRACT 31: DiviDE 32: MULT?PLY 33: BRANCH 40; BRANCHNEG 41; BRANCHZERO 42; HALT 43; In the following machine language program, starting at memory 00. B0 1009 read A 1 1010 read B 82 2009 load A 03 3110 Subtract B 84 410? 5 1118 06 4308 87 1189 88 4300 09 0000 11 8000 12 99999 Given A 27, B-85; When the program is run, what is output; What is the actual value being output? 1) A+B 2) A-B 3) Larger of A or B 4) Smaller of A or B 5) None of these (which) b Ans- 32; What is output and what is the actual value Actual value output- (c)) Program is rerun with A-80 and B 1)A8 2) A-B 3) Larger of A or B 4) Smaller of A or B 5) None of these (which) .c Ans 00 pages. Each page has 40 lines; Each line has 80 characters, following Unicode. How many Actual value bytes of memory is occupied, when the book is downloaded. .d Ans Friends: Good luck

Explanation / Answer

Answers:

Q1.

a. False : placing element of an array in ascending order is called as inserting an element in a sorting array

b. True: Pointer to a structure is stores in the structure itself, are called as nested structures.

c. False: String function “isalphanum” returns a non zero value for a lower case character input and a number. Else for all other cases it returns zero value

d. True: As bit field configuration 4 bits are required to specify suit in a 52 card dech

e. False: Typedef is used for renaming the existing data type

f. False

g. False: C++ can be defined anywhere in the program

h. False: No Cin & Cout can not be used in C as Cin & Cout requires iostream library file

Q2.

a. Y = ((*(Xptr +2) +(*(Xptr +2)) = 3 + 31 = 34

z = ((*(Xptr +3 ) /(*(Xptr +2)) =5/23

b. For A = 27 & B = 85, the output for the given program will be A – B and actual value output 27 – 85 = -58

c. For A = 80 & B = 32, the output for the given program will be A – B and actual value output 80 – 32 = 48

d. Online book has total 100 pages;

Each page has 40 lines so 100 pages will have: 100 * 40 = 4000 lines

Each line has 80 characters so 4000 lines will have = 4000 * 80 = 320000 characters

As one byte can hold / store one character as the characters are stored in ASCII values; so for storing 320000 characters memory of 320 KB