Sie sind auf Seite 1von 4

National University of Computer & Emerging Sciences

CS214: Programming Fundamentals A#1


Sections: A, B, C
Instructor: Azhar Rauf
Issue date: TA: Talha Anis (i150533) Due date:

Friday Thursday
For queries, contact:
Jan 20th 0335 5703007 Jan 26th
i150533@nu.edu.pk

Assignment
Solo Group Quizbased
Type

Submission
Online Inclass Either
Type
Submission 1. Attach this cover
Guidelines page.
1. Submit .cpp, .jpeg in Follow guidelines
2. Only use A4size
(Read under the designated for the submission
blank white paper
Submission SLATE folder in type checked.
(70g).
Type Assignments tab.
3. Staple all pages.
Column)
4. Due at class start.

Name: _____________________________ Roll No: ________________

Signature: _________________________ Section: ________________


ImportantNotes: ForTAuseonly:

1. ZERO Tolerance Policy for plagiarism and CheckedbyTA


cheating. Plagiarism YesNo
2. Violatorsmay receive F in the course and/or will be %Attempted
reported to the Department Discipline Committee. TotalMarks
3. No retake or allocation of average marks for MarksObtained
assignments in any case, irrespective of the reason,
genuine or otherwise.

NUCES-FAST: Spring17: PF (EE) Assign # 01 Page 1/4


Slight plagiarism can lead you to F. Better not to submit assignment instead of copying.

Q1.Completethecomputerandprogrammersmodelsgivenbelow.Togetmaxcreditshowall
yourworking(directanswerswillnotbeconsidered).

ComputerView ProgrammerView
Address(DEC) Value(HEX) Type Value(DEC)
.
.
.
182424 00
182425 00
Integer
182426 06
182427 06
182428 42 Character
182429
182430
182431
182432
Double 8421.1248
182433
182434
182435
182436
182437 01
182438 93
Float
182439 E8
182440 6B
182441 01
182442 93
Integer
182443 E8
182444 6B
182445 CD
Short
182446 AB
182447
182448
Integer 101325
182449
182450
.
.

.

NUCES-FAST: Spring17: PF (EE) Assign # 01 Page 2/4


Q2.InQ1above,whatistheminimumwidthoftheaddressbus(inbits)ifthelargestmemory
addressis0x4970?

Q3.Whatistherangeofsignedvaluesthatcanberepresentedina32bitdatabus?Express
youranswerindecimal.

Q4.HowmanyKbarethereinamemoryof4MBsize?

Q5.Outofthefollowingdecimalvaluesdetermineiftheycanbefitinmemoryornot?

Ifnotthenspecifythereasonwhy.
IfyesthenwritetheHEXvalue.

Type Value(DEC) Value(HEX)


Integer 1.123x10^7
Float 5.877x10^39
Character 256
Double 1.8167x10^13
Integer 1561013265

Q6.Highlightdifferencesbetweencharacterarrays,CstringsandC++Strings.

Q7.Researchontheinternetto:

a) Brieflyexplaininaparagraphofabout100wordswhatobjectorientedprogrammingis.
b) MentiononefeatureofCthatisnotpartofC++andviceversa.

Q8.Whenusingfileinput,whyareEOFcontrolledloopsusedinsteadofsentinelcontrolled
loops?

NUCES-FAST: Spring17: PF (EE) Assign # 01 Page 3/4


Q9.Assumingthatatextfilenamedinput.txtcontainssometextwrittenintoit,writeaC++
program,thatreadstheinputfileandcreatesanewfilenamedresult.txt,tocontainonly
thosewordsfromtheinputfilewhichstartwithalowercasevowel(i.e.,with'a','e','i','o','u').
Sampleinputandoutputfilesaregivenasshown:

:-

End of Assignment No. 1

NUCES-FAST: Spring17: PF (EE) Assign # 01 Page 4/4