Which of the following statements is equivalent to the algorithm in the flowchart?
If you're seeing this message, it means we're having trouble loading external resources on our website. Show
If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked. 5. “Desk-checking” refers to?(A) Testing an algorithm at the flowchart stage using several different kinds of data.(B) The continual problem programmers have with losing things.(C) Timing a program to see how fast it completes its tasks.(D) Having a fellow programmer read your pseudocode to be sure it is understandable. 6. Which of the following properties determines the words appearing in a form’s title bar? Get answer to your question and much more 7. What effect will the following statement have? Get answer to your question and much more We have textbook solutions for you!The document you are viewing contains questions related to this textbook. Expert Verified(B) It is not a valid Visual Basic statement(C) Make IbIOne invisible(D) Delete IbIOne8. the properties window plays an important role in the development of Visual Basic programs. It ismainly used? Get answer to your question and much more 9. What would be a good name for a text box to hold a person’s first name?(A) txtFirstName(B) txt First Name(C) First Name(D) FirstName 10. When the user clicks a button,ـــــــــــــــــــــis raised. Get answer to your question and much more 1. Which of the following is a valid name for a variable? Get answer to your question and much more 2. Which of the numbers below is equivalent to 0.000017489? Get answer to your question and much more 3. Which statement will display the words “Hello World” in a text box? (A) txtBox.Text = “Hello” & World(B) txtBox.Text = “Hello” & “World”(C) txtBox.Text = “Hello” & World(D) txtBox.Text = “Hello” & “World” 4. Given the data assigned to the string variable str2 shown below, which of the following statementswill assign the value ALL to the string variable str1? Get answer to your question and much more 5. What is the value of (“12/15/09”). Substring (3,2)? Get answer to your question and much more 6. Asc (“A”) is 65. What is displayed by txtBox.Text = Chr(65) & “BC”? Get answer to your question and much more 7. Which of the following is true?(A) “Cat” = “cat”(B) Relational operators are only valid for numeric value(C) “Cat” < “cat”(D) “Cat” 8. Which of the following is a valid Visual Basic conditional statement? Get answer to your question and much more 9. Which value for X would make the following condition true: Not (x >= 5) Get answer to your question and much more 10. Suppose that the selector in a Select Case block is the string variable myVar. Which of thefollowing is NOT a valid Case clause? Get answer to your question and much more ALGORITHMS PROGRAM CONTROL Pseudocode CONTROL STRUCTURES - All programs could be written in terms of only three control structures: FLOW CHART Usual meaning of flowchart symbols: -OVAL - one containing the word "Begin" and the other containing the word "End" -RECTANGLE - action symbol -DIAMOND - decision symbol C++ KEY WORDS The following are C++ keywords: asm, auto, break, bool, case, char, catch, class, const, const_cast, continue, delete, default, do, double, dynamic_cast, else, enum, explicit, extern, false, float, for, friend, goto, if, inline, int, long, mutable, namespace, new, operator, private, protected, public, register, reinterpret_cast,
return, short, signed, sizeof, static, static_cast, struct, switch, template, this, throw, true, try, typedef, typeid, typename, union, unsigned, using, virtual, void, volatile, wchar_t, while. THE if SELECTION PROCEDURE - A selection structure is used to choose among alternative courses of action. Example: Pseudocode C++ statement if ( grade >= 60) if LOGIC -
condition true - statement executed, condition false - statement ignored and control is passed to the next statement. In C++ draft standard, the keywords "true" and "false" are used to represent the values of type "bool" - based on the word boolean algebra. if STRUCTURE - single-entry/single-exit structure. THE if/else SELECTION STRUCTURE - A different action is to be performed when the condition is "true" than when the condition is "false". Example: Pseudocode: C++ statement if ( grade >= 60 ) C++ provides the conditional operator (?:) that is closely related to the if/else structure. The conditional operator is C++'s only ternary operator - it takes three operands. Example: This could also be written
as: Nested if/else structure Pseudocode: If student's grade is greater than or equal to 90 C++ statement if ( grade >= 90 ) This is the same as: if ( grade >= 90 ) This latter form is popular because it avoids the deep indentation of the code to the right. Compound statement if ( grade >= 60 ) The braces surrounding the two statements are important, without them, the statement cout << "You must take this course
again.\n"; would be outside the body of the "else" part of the "if", and would execute regardless of whether the grade is less than 60. THE while REPETITION STRUCTURE - Allows the programmer to specify that an action is to be repeated while some condition remains true. Example: Pseudocode C++ statement
The initial
value of "product" here which is 2 and which is obtained by raising the power of 2 by 1 is called INITIALIZATION. A PROBLEM A class of ten students took a quiz. The grades (integers in the range of 0 to 100) for this quiz are availabale to you. Determine the class average on the quiz. Pseudocode While grade counter is less than or equal to ten Set the class average to the total divided by ten C++ program // Class average program with counter controlled repetition. Counter variables are normally initialized to zero or one, depending on their use.
|