basic programming 2

Assignment 1:

Part A. Create a flowchart for the following problem.

Input: three different integers: a, b, c.

output: The greatest from the given three numbers.

For simplicity, we assume that all numbers are different.

Part B.

Find out the outcome of the following pseudo codes

1. [3 marks]

a = 1

While a < 10

print in a line the value of a

a = a + 4

End while

Print “bye”

2. [4 marks]

a = 1

While a < 10

if a mod 2 is 0 then

print in a line “a is even”

else

print in a line “a is odd”

end if

a = a + 3

End while

Print “bye”

3. [4 marks]

a = 2

If a mod 2 is 0 then

While a < 10

print in a line the value of a

a = a + 1

End while

else

While a < 5

print in a line the value of a

a = a + 1

End while

End if

Print “bye”

Part C:

1. [ 4 marks]

Compute the operation number for the following code block:

a = 1

While a < 6

print in a line the value of a

a = a + 1

End while

Print “bye”

2. [4 marks]

Compute the operation number for the following code block:

a = 1

While a < 12

print in a line the value of a

a = a + 3

End while

Print “bye”

3. [5 marks]

Compute the operation number for the following code block:

a = 3

While a < 7

if a mod 2 is 0 then

print in a line “a is even”

else

print in a line “a is odd”

end if

a = a + 1

End while

4. [5 marks]

Compute the operation number for the following code block:

a = 3

If a mod 2 is 0 then

While a < 9

print in a line the value of a

a = a + 1

End while

else

print in a line “this is else part”

End if

Print “bye”

6. [7 marks]

Explain the following nested loop with output.

a = 1

While a < 3

b = 1

While b < 4

print in a line the value of b

b = b + 1

end while

a = a + 1

End While

 

“Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!
Use Discount Code “Newclient”for a 15% Discount!”


Buy Custom Nursing Papers

The post basic programming 2 appeared first on Student Homeworks.

#write essay #research paper #blog writing #article writing #academic writer #reflective paper #essay pro #types of essays #write my essay #reflective essay #paper writer #essay writing service #essay writer free #essay helper #write my paper #assignment writer #write my essay for me #write an essay for me #uk essay #thesis writer #dissertation writing services #writing a research paper #academic essay #dissertation help #easy essay #do my essay #paper writing service #buy essay #essay writing help #essay service #dissertation writing #online essay writer #write my paper for me #types of essay writing #essay writing website #write my essay for free #reflective report #type my essay #thesis writing services #write paper for me #research paper writing service #essay paper #professional essay writers #write my essay online #essay help online #write my research paper #dissertation writing help #websites that write papers for you for free #write my essay for me cheap #pay someone to write my paper #pay someone to write my research paper #Essaywriting #Academicwriting #Assignmenthelp #Nursingassignment #Nursinghomework #Psychologyassignment #Physicsassignment #Philosophyassignment #Religionassignment #History #Writing #writingtips #Students #universityassignment #onlinewriting #savvyessaywriters #onlineprowriters #assignmentcollection #excelsiorwriters #writinghub #study #exclusivewritings #myassignmentgeek #expertwriters #art #transcription #grammer #college #highschool #StudentsHelpingStudents #studentshirt #StudentShoe #StudentShoes #studentshoponline #studentshopping #studentshouse #StudentShoutout #studentshowcase2017 #StudentsHub #studentsieuczy #StudentsIn #studentsinberlin #studentsinbusiness #StudentsInDubai #studentsininternational