Your name: _________________________ Date: ________________________________ For the multiple-choice questions, type your answer into the _highlighted blank (like this)____ 1) In the while loop below,...

1 answer below »
Hello this is the assignment please follow step by step


Your name: _________________________ Date: ________________________________ For the multiple-choice questions, type your answer into the _highlighted blank (like this)____ 1) In the while loop below, given that k = 0 initially, what is the value of k after execution of the loop? _____ while (k <= 5)="" {="" k="k" +="" 1;="" }="" a.="" 0="" b.="" 1="" c.="" 4="" d.="" 5="" e.="" 6="" f.="" none="" of="" the="" above="" 2)="" a="" _____is="" a="" sequence="" of="" instructions="" with="" a="" name.="" a.="" variable="" b.="" argument="" c.="" parameter="" d.="" function="" 3)="" consider="" the="" following="" function="" call="" round(3.14159,="" 3)="" what="" is="" the="" return="" value?="" _____="" a.="" 3.14159="" b.="" 3.141="" c.="" 3.14="" d.="" 3.1="" 4)="" operators="" such="" as="" greater-than="" and="" less-than,="" used="" to="" compare="" data="" for="" conditions,="" are="" called="" _____operators.="" a.="" logical="" b.="" arithmetic="" c.="" relational="" d.="" smooth="" 5)="" the="" python="" syntax="" to="" assign="" the="" value="" 10="" to="" the="" variable="" count="" is="" _____.="" a.="" count="10;" b.="" count="=" 10;="" c.="" count="" is="10;" d.="" 10="=" count;="" 6)="" consider="" the="" following="" function.="" def="" factorial(n)="" :="" result="1" for="" i="" in="" range(1,="" n="" +="" 1)="" :="" result="result" *="" i="" return="" result="" what="" is="" the="" parameter="" for="" this="" function?="" _____="" a.="" factorial="" b.="" i="" c.="" n="" d.="" result="" 7)="" a="" condition="" such="" as="" "pcount="">< 20" has a _____value. a.numeric b.alphanumeric c.character d.boolean 8) the python condition to test the value of count to be equal to the value 10 is _____. a.(count = 10) b.(count == 10) c.(count.equal(10)) d.(count is = 10) 9) corrections to syntax to eliminate syntax, runtime, or logic errors must be made to the _____. a.compile code b.executable code c.object code d.source code e.none of the above 10) what are supplied to a function when it is called? _____ a. arguments b. numbers c. return values d. sentinals 11) “fix” the following 3 lines of code so that the print the last line of code correctly: age == input(how old are you?) age == age + 1 print["happy birthday! you are" + age + years old!] 12) consider the following function: def squarearea(sidelength) : return sidelength ** 2 what is the value of squarearea(3)? _____ a.2 b.3 c.6 d.9 13) using one line or two of python code, declare a one-dimensional list called citynames, and assign the values: providence, denver, miami, chicago, seattle 14) given the array you created above, what is the output of the line of python below: print(citynames[3]) ________________ 15) given the array above, write a for statement (using python syntax) that will output all of the entries in the array, one name at a time (one name per line) 16) assume you are working in a python program and you have been given the following lines of python code studentfirstname = “pat” studentlastname = “brown” studentfullname = concatnames(studentfirstname, studentlastname) assume there is currently no method called concatnames in the file you are working on. in the space below, write the python code to create a method called concatnames that will take in two values called fname and lname. the method should concatenate the names and return the full name of the student as one string called totalname. 17) in the space below, write a function def countvowels(wordphrase): that returns a count of all vowels in wordphrase. vowels are the letters a, e, i, o, u, and their uppercase variants. page 2 of 2 20"="" has="" a="" _____value.="" a.="" numeric="" b.="" alphanumeric="" c.="" character="" d.="" boolean="" 8)="" the="" python="" condition="" to="" test="" the="" value="" of="" count="" to="" be="" equal="" to="" the="" value="" 10="" is="" _____.="" a.="" (count="10)" b.="" (count="=" 10)="" c.="" (count.equal(10))="" d.="" (count="" is="10)" 9)="" corrections="" to="" syntax="" to="" eliminate="" syntax,="" runtime,="" or="" logic="" errors="" must="" be="" made="" to="" the="" _____.="" a.="" compile="" code="" b.="" executable="" code="" c.="" object="" code="" d.="" source="" code="" e.="" none="" of="" the="" above="" 10)="" what="" are="" supplied="" to="" a="" function="" when="" it="" is="" called?="" _____="" a.="" arguments="" b.="" numbers="" c.="" return="" values="" d.="" sentinals="" 11)="" “fix”="" the="" following="" 3="" lines="" of="" code="" so="" that="" the="" print="" the="" last="" line="" of="" code="" correctly:="" age="=" input(how="" old="" are="" you?)="" age="=" age="" +="" 1="" print["happy="" birthday!="" you="" are"="" +="" age="" +="" years="" old!]="" 12)="" consider="" the="" following="" function:="" def="" squarearea(sidelength)="" :="" return="" sidelength="" **="" 2="" what="" is="" the="" value="" of="" squarearea(3)?="" _____="" a.2="" b.3="" c.6="" d.9="" 13)="" using="" one="" line="" or="" two="" of="" python="" code,="" declare="" a="" one-dimensional="" list="" called="" citynames,="" and="" assign="" the="" values:="" providence,="" denver,="" miami,="" chicago,="" seattle="" 14)="" given="" the="" array="" you="" created="" above,="" what="" is="" the="" output="" of="" the="" line="" of="" python="" below:="" print(citynames[3])="" ________________="" 15)="" given="" the="" array="" above,="" write="" a="" for="" statement="" (using="" python="" syntax)="" that="" will="" output="" all="" of="" the="" entries="" in="" the="" array,="" one="" name="" at="" a="" time="" (one="" name="" per="" line)="" 16)="" assume="" you="" are="" working="" in="" a="" python="" program="" and="" you="" have="" been="" given="" the="" following="" lines="" of="" python="" code="" studentfirstname="“Pat”" studentlastname="“Brown”" studentfullname="concatNames(studentFirstName," studentlastname)="" assume="" there="" is="" currently="" no="" method="" called="" concatnames="" in="" the="" file="" you="" are="" working="" on.="" in="" the="" space="" below,="" write="" the="" python="" code="" to="" create="" a="" method="" called="" concatnames="" that="" will="" take="" in="" two="" values="" called="" fname="" and="" lname.="" the="" method="" should="" concatenate="" the="" names="" and="" return="" the="" full="" name="" of="" the="" student="" as="" one="" string="" called="" totalname.="" 17)="" in="" the="" space="" below,="" write="" a="" function="" def="" countvowels(wordphrase):="" that="" returns="" a="" count="" of="" all="" vowels="" in="" wordphrase.="" vowels="" are="" the="" letters="" a,="" e,="" i,="" o,="" u,="" and="" their="" uppercase="" variants.="" page="" 2="" of="">
Answered Same DayMay 13, 2021

Answer To: Your name: _________________________ Date: ________________________________ For the multiple-choice...

Neha answered on May 17 2021
144 Votes
Your name: _________________________
Date: ________________________________
For the multiple-choice questions, type
your answer into the _highlighted blank (like this)____
1) In the while loop below, given that k = 0 initially, what is the value of k after execution of the loop? __d. 5___
while (k <= 5)
    {
        k = k + 1;
    }

a.    0
b.    1
c.    4
d.    5
e.    6
f. none of the above
2) A _d. function____is a sequence of instructions with a name.
a. variable
b. argument
c. parameter
d. function
3) Consider the following function call round(3.14159, 3) what is the return value? _b. 3.141____
a. 3.14159
b. 3.141
c. 3.14
d. 3.1
4) Operators such as greater-than and less-than, used to compare data for conditions, are called _relational_operators.
a.    logical
b.    arithmetic
c.    relational
d.    smooth
5) The Python syntax to assign the value 10 to the variable count is _a. count = 10;____.
a.    count = 10;
b.    count == 10;
c.    count is = 10;
d.    10 == count;
6) Consider the following function.
def factorial(n) :
     result = 1
     for i in range(1, n + 1) :
     result = result * i
     return result
What is the...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here