What are the different structured loops

Assignment Help C/C++ Programming
Reference no: EM13939704

1. Analyze the following pseudocode. Whats the ansr's final value ?

Num = 8 ansr =0 if num > 5 then if num < 20 then ansr =1 else ansr = 2 endif endif .

A) 0

B) 1

C) 2

D) 7

2. Which piece of pseudocode represent the checking the loop condition

A) rep = 1

(B) rep=rep +1

(C) while (rep< 5)

(D) print " warning "

3.In a control break routine, how do you know when the last category has finished being processed ?

A) at the end of the file

B) when every category is the same

C) when the value of the category is the same as the vale of the control break field

D) there is no way to tell

4.Which of the following is another name for an array?

A) group

B) sequence

C) matrix

D) subscript

5) What piece of pseudocode represents incrementing the loop control variable.

A) rep = 1

B) rep=rep + 1

C) while (rep<5)

D) print "warning "

6) Which of the following is a nontrivial true example of the greater than or equal to operator ?

A) 1> 5

B) 1> = 5

C) Time =3

D) Time > = 4

8) In order to have the most efficient program, which question should be asked first when working with an AND decision.

A) the one that is less likely to be true

B) the one that is more likely to be true

C) the one that involves fewer comparisons

D) the one with the lower valve

9) When listing employees who make more that $10 and less than $12 per hour, you are making a decision bases on a:

A) Range

(B) row

(C) variable

(D) value

10) When a loop control variable is not altered during loop execution, a(n) __________ loop may result.

A) decrement

B) infinite

C) indeterminate

D) default

11)In the following pseudocode sample which will be printed if the value of empDept is 11?

If empDept >=8 the
superviorName = "Fontana
else
if empDept > = 4 then
supervisorName = "Escher "
else
supervisorName + "Dillion"
endif
endif
print supervisorName

A) Fontana

B) Escher

C) Dillion

D) Nothing

11)Which of the following is true of a structured loop

A) the loop can exit from any point

B) the loop body must execute at least one

C) the loop condition represent the only exit from the loop

D) the loop can repeat an infinite number of times

12)When creating a grand total by adding up several subtotals you are

A) rolling up the totals

B) grouping the totals.

C) grabbing the totals

D)grand totaling.

13) What is the term for each part of an array

A) variable

B) element

C) subscript

D) superscripts

14)Array subscript are always

A) large numbers

(B) characters

(C) negative values 3

(D) integers

15)What do array elements all have in common

A) pointer

B) memory location

C)data type

D) default value

Question 15-17

X =1
FoundIt ="N" then
While x< 7
If custItemNo = validItem[x] then
foundIt = "Y"
endif
x =x+1
endwhile
if foundIt ="N" then
print "No such item"
endif

15) In the above code which of the following is a flag variable

A) foundIt

B) x

C) custItemNo

D) validItem

16) In the above code which of the following is an array variable

A) foundIt

B) x

C) custItemNo

D) validItem

17) In the above code , which of the following is the variable being searched for.

A) foundIt

B) x

C) custItemNo

D) validItem

18) If the array list has 4 elements then the statement, then the statement list [5] is:

A) valid

B) out of bounds

C) out of range

D) equal to zero

19) In a for loop, a(n) _____ value is used to control how the loop control variable is incremented.

A) step

(B) group

(C) flag

(D) sentinel

20) A while loop has a(n) _____ condition.

A) posttest

B) pretest

C) infinite

D) incremental

21)Array subscripts must be :

A) negative

B) greater than zero

C) sequential

D) with decimal places

Attachment:- programming essentials(help 2).zip

Reference no: EM13939704

Questions Cloud

Describe the principle characteristics of these individuals : Undertake an analysis of your own job and its context. If you do not have managerial (or similar) experience, or if for some other reason it is not appropriate to analyse your own job, you may choose instead the job of another individual who agree..
Problem regarding the indigenous education : Students are to provide a 500 word pedagogical statement on the importance of embedding Indigenous perspectives in units of work. This statement should be supported by referred literature and linked to the relevant AITSL requirements.
Prepare a statement of cash flows for erie : Prepare a statement of cash flows for Erie, using the indirect method to compute net cash flow from operating activities.
What is your position on organ transplantation : Liver and lung lobes and kidneys can be transplanted via live donor. Find an article that describes the differences between live donor and cadaveric organ transplantation. Post a brief summary of the advantages and disadvantages of live vs. cadave..
What are the different structured loops : Which piece of pseudocode represent the checking the loop condition
Concepts of successful negotiation skills : In your introduction, present a thesis related to the content of the chapter, and then explain how the chapter is arranged to support the thesis. Next, support the thesis based on the concepts of successful negotiation skills
Conceptual design specification report : In this assignment, you will produce a conceptual design specification report for the attached case using a number of design techniques. Note that this is an individual, not a group, assignment.
Use headers for sections such as inventory and accounts : The paper should be one to two pages in length, single spaced, with one inch margins on all sides. Use 'headers' for sections such as Inventory and Accounts Receivable.
Condition of the management software industry : 1. What is the market condition of the management software industry? What is Yonyou's market position? 2. What strategic decisions have caused Yonyou's past success? Are they still viable post 2013?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Program to calculate the records in database

The O-So-Good Chocolate Company produces different types of chocolates daily. They need a little summary report that shows how much of each chocolate type they produce for a given month. This way they can plan next month's production schedule.

  When constructors and destructors are called

Objects, constructors and destructors are called each time the objects Enter and leave scope and inherit parent class

  Design class for textbook-data field for grade level of book

Design a class named TextBook that is child class of Book. Include new data field for grade level of book. Create a displayTextBookInfo () method so that you can accommodate new grade-level field.

  Matching program that takes input from a text file

need to make a string matching program that takes input from a text file and outputs that match (if there is one) asked from the user. i have done this part , the only problem is that , with the output match , i also need to print some words before a..

  Iterative programming problem solving approaches

Write a recursive function void reverse ( ) that reverse a sentence

  Asks the user for the name of an input file and translates

Write a C++ program that asks the user for the name of an input file and translates the contents of that input file using ROT13. Your  main  function should be responsible for reading the input file and coordinating calls to a value-returning functio..

  Write a menu-driven program that maintains an address book

Write a menu-driven program that maintains an address book using a linked list. The address book must supports the following operations

  Write a program that prints the day number of the year

Write a program that prints the day number of the year, given the date in the form month-day-year. For example, if the input is 1-1-2006, the day number is 1.

  Write an array-returning method

Write an array-returning method that takes a two-dimensional array of chars as a parameter and returns a single-dimensional array of Strings as follows:

  Allocate array of n doubles and assign the resulting pointer

The variable dp is to refer to an array of double. Assuming the integer variable n has been assigned a value, declare dp appropriately, allocate an array of n doubles and assign the resulting pointer to dp.

  Developing a database to manage academic issues

What's A Matter University (good old Whatsamatter U) is developing a database to manage academic issues. You are asked to assist in the design of the database. Sketch the Entity-Relationship diagram for each of the following business needs. Your a..

  From the worker''s gross pay

An employee is paid at a rate of $16.78 per hour for the first 40 hours worked in a week. Any hours over the regular 40 hours are paid at the overtime rate of one-and-one-half times that. From the worker's gross pay

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd