3rd prep. – 2nd Term MOE Book Questions.

Slides:



Advertisements
Similar presentations
CS0004: Introduction to Programming Select Case Statements and Selection Input.
Advertisements

Chapter 6: The Repetition Structure
Objectives Understand the software development lifecycle Perform calculations Use decision structures Perform data validation Use logical operators Use.
CHAPTER 5: Repetition Control Structure. Objectives  To develop algorithms that use DOWHILE and REPEAT.. UNTIL structures  Introduce a pseudocode for.
Iteration (Looping Constructs in VB) Iteration: Groups of statements which are repeatedly executed until a certain test is satisfied Carrying out Iteration.
Visual Basic Fundamental Concepts. Integrated Development Enviroment Generates startup form for new project on which to place controls. Features toolbox.
Lecture Set 5 Control Structures Part D - Repetition with Loops.
08/10/ Iteration Loops For … To … Next. 208/10/2015 Learning Objectives Define a program loop. State when a loop will end. State when the For.
Chapter 12: How Long Can This Go On?
ENGR 112 Decision Structures.
1 Week 6 The Repetition Structure. 2 The Repetition Structure (Looping) Lesson A Objectives After completing this lesson, you will be able to:  Code.
Tutorial 51 Programming Structures Sequence - program instructions are processed, one after another, in the order in which they appear in the program Selection.
Tutorial 6 The Repetition Structure
CS285 Visual Basic 2 Department of Computing UniS 1 Statements in Visual Basic A statement is the fundamental syntactical element of a program smallest.
Visual Basic Programming
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Class Average Application Introducing the Do...Loop While and Do...Loop Until.
Class 3 Remote Instruction Computer Math EDU 556 Programming for Instruction Dr. Steve Broskoske This is an audio PowerCast. Make sure your volume is.
Chapter 3 Functions, Events, and Control Structures JavaScript, Third Edition.
6.2 For…Next Loops General Form of a For…Next Loop
Visual Basic 2010 How to Program © by Pearson Education, Inc. All Rights Reserved.1.
‘Tirgul’ # 2 Enterprise Development Using Visual Basic 6.0 Autumn 2002 Tirgul #2.
JavaScript, Fourth Edition
Chapter 3 Control Structures. The If…Then Statement The If…Then statement is a Decision statement = that executes a set of statements when a condition.
Loops Robin Burke IT 130. Outline Announcement: Homework #6 Conditionals (review) Iteration while loop while with counter for loops.
Visual Basic 2010 How to Program © by Pearson Education, Inc. All Rights Reserved.1.
Looping Structures Do Loops, For Next Do...Loop While structures check the condition after executing the code and repeat a code block until the test.
Chapter 6 Looping Structures. Do…LoopDo…Loop Statement Can operate statements repetitively Do intx=intx + 1 Loop While intx < 10 –The Loop While operates.
For…Next Loops, Checked List Boxes, and Combo Boxes Chapter 5.
CECS 5020 Computers in Education Visual Basic Variables and Constants.
31/01/ Selection If selection construct.
For…Next and Do...While Loops! Happy St. Patrick’s Day!
© 2006 Lawrenceville Press Slide 1 Chapter 6 The Post-Test Do…Loop Statement  Loop structure that executes a set of statements as long as a condition.
Controlling Program Flow with Looping Structures
Controlling Program Flow with Decision Structures.
Visual Basic Review LBS 126. VB programming Project Form 1Form 2Form 3 Text boxButton Picture box Objects Text box Button Objects.
 2002 Prentice Hall. All rights reserved. 1 Chapter 5 – Control Structures: Part 2 Outline 5.1Introduction 5.2 Essentials of Counter-Controlled Repetition.
C Language 1 Program Looping. C Language2 Topics Program looping Program looping Relational operators / expressions Relational operators / expressions.
Loop Blocks Chapter 6 Part A. Program Blocks 1.Actions- commands, messages, methods 2.Branches- decisions to be made 3.Loops- actions to be repeated.
Chapter 6 Controlling Program Flow with Looping Structures.
Loops ( while and for ) CSE 1310 – Introduction to Computers and Programming Alexandra Stefan 1.
© 2010 Lawrenceville Press Slide 1 Chapter 5 The Do…Loop Statement  Loop structure that executes a set of statements as long as a condition is true. 
Visual Basic Fundamental Concepts
VISUAL BASIC 6.0 Designed by Mrinal Kanti Nath.
Egyptian Language School Computer Department
IE 8580 Module 4: DIY Monte Carlo Simulation
UNIT 5 Lesson 15 Looping.
Introduction To Repetition The for loop
Repetition Structures Chapter 9
Visual Basic 6 (VB6) Data Types, And Operators
Lecture 7: Repeating a Known Number of Times
3rd prep. – 2nd Term MOE Book Questions.
Starter Write a program that asks the user if it is raining today.
CHAPTER FIVE Decision Structures.
Visual Basic..
Chapter 5 The Do…Loop Statement
حلقات التكرار.
Chapter 3: Introduction to Problem Solving and Control Statements
Chapter (3) - Looping Questions.
Do … Loop Until (condition is true)
Language Constructs Construct means to build or put together. Language constructs refers to those parts which make up a high level programming language.
The structure of programming
Final Revision sheet- term2
Chapter (3) - Procedures
Final Revision sheet- term2
Cyber bullying.
3.2 Working with Data Scope of variables 29/07/2019.
REPETITION Why Repetition?
Cyber bullying.
Presentation transcript:

3rd prep. – 2nd Term MOE Book Questions

Chapter (1)- Data Questions

15

Chapter (2) - Branching Questions

The user entered value greater than or equal to 50 Message Box with text “successful” will appear Message Box with text “successful” will appear If Y<0 then If Y<0 then MsgBox (“A negative number “) Code 1 Code 2

To check the student’s Grade and Print “ناجح” if X>=50 click Button1 Single Current form ”ناجح“

1 2 If country =“Egypt” then MsgBox (“مصر”) Else MsgBox(“Egypt”) End if

“ناجح” “راسب” If x > 50 then MsgBox(“ناجح”) else MsgBox(“راسب”) Label2.text=“even” Label2.text=“odd” Dim N As integer

Dim X As integer N= Me.TextBox1.text If N mod 2=0 Then MsgBox (“الرقم زوجي”) Else MsgBox(“الرقم فردي”) End if

to determine if the degree is (<0 , = 0 or >0 ) “ تحت الصفر” click Button1 single

Chapter (3) - Looping Questions

click Button1 Variable , Integer M 1 3 1 4 MsgBox(M)

To print the odd numbers from 5 to 9 But_Repeat click Dim (For … Next) Statement Me.Label1.text = Me.Label1.Text & m & vbCrLf Concatenate or append strings together MsgBox (m)

To Print the multiplication table of table 3 from 1 to 12 in separate lines inside textbox control. True True False True True

5 Step 2 7 7

Dim n , Product As Integer Dim n , Product As String For n = 1 To 10 For n = 1 To 10 Step -1 Product = 9 * n Product = 9 + n Next str Next n

Product Str Next m

I 1 B C TO Create new line between variables To print the numbers from 1 to B and increased by C in separate lines inside textbox1 I 1 B C TO Create new line between variables

Comparison between Looping Statements For …Next Statement Do …. While Statement It is one of the limited loop statements used when we want to repeat a code for specific number of time . It needs numeric variable (integer or decimal) to work as a counter with start value , end value and add or increment value . The statement 'Do while ... loop' is used to repeat a specific code for a several times of an unknown end, but based on a specific condition, so they are useful if you do not know the number of iterations emphatically. The repetitive code will be implemented (executed) as long as the counter variable is less than or equal the end value .The loop stops when the value of the counter exceeds the last value. The repetitive code will be implemented (executed) as long as the conditional expression is true. If the condition is not met for any reason, we get out of the iterative loop, and implement the code after the Loop if it exists. General syntax for this statement For Variable = Start To End Step Add Value Repetitive Code Next [Variable] Do While Conditional Expression Repetitive Code Loop

To increase the counter variable I by 2 Do … While To increase the counter variable I by 2 To print the odd or even no.`s from 1 to the entered no. Control Method property

To receive the value entered by the user in textbox1 and assign it to the variable N in computer memory. Do … While Statement The conditional expression (I <= N) is true TextBox1 N

Chapter (3) - Procedures Questions

We can notice the declaration of the following : 1 ."Class" is under the name (Form1) 2"Variables" are under the names (total, i) 3-"Event procedures" are under the name of (Button1_Click, Button2_Click(

Here we declare what is so-called (Procedures); this declaration is done only once and then, you recall the procedures many times from anywhere in your program; which avoids code duplication in places where procedures are recalled.

Note: In the procedure declaration, we can use more than one Parameter. When the procedure is recalled, we determine values of the outside procedure called (Argument).

Declaration of Function SUM Calling of Function SUM

X √ X X X √ √

√ √ X X √ √ X √ Value X Parameters √

ShowOddOrEven Start Integer Start 2 Start

XXX Single YYY - ZZZ RRR

Chapter (4) –Cyber Bullying

First: State whether the following statements are true ( ) or false (X) √ √ √ √ √ √ √ X x Cyber stalking x Cyber threats x

Don't send any electronic message when I’m angry&Inform my parents 2-Make a password that is difficult to predict. 3-Don't publish(post) any private data. 8-The download of software from the internet should be done under 6- Be careful! Don't send any electronic message when you are angry. 4-Avoid deleting Cyber bullying messages. Cyber bullying Exclusion Don't send any electronic message when I’m angry&Inform my parents 1-Don't send any respond when I’m angry 2- take the parent's opinion about the appropriate response 3- write a message in a polite way 4-Avoid deleting cyber bullying messages.