Visual Basic

Size: px
Start display at page:

Download "Visual Basic"

Transcription

1 1 P a g e Visual Basic 6.0 Punjab University papers Visual Basic Question No 1(a). What is an algorithm and pseudo code? 5.0 1(b). What is OOP? Explain its importance 5.0 Question No 2(a) what are user define data types? which data type are support to VB 5.0 2(b) what are control element? Explain the sub procedure. 5.0 Question NO.3(a) what are optional arguments? Write code example using optional arguments 3(b) what are event procedure.with example Question No 4.(a) what are arrays? Explain two array related functions (b) what are difference between logical and syntax error with example 5.0 Question No 5.(a) what are sequential Access data file? (b) what is a data base? explain the uses of data control 5.0 Visual Basic Question No 1(a). Differentiate between structured programming and OOP (b). what is variable? in visual basic what do you mean by scope of variable. Question No 2(a) what do you means by a user defined sub procedure. Explain by giving example 5.0 2(b) differentiate between input box function and msgbox function. 5.0 Question NO.3(a) what are the different looping construct available in visual basic with example 5.0 3(b) what are the different selection structure available in visual basic with Example 5.0 Question No 4.(a) what do you means control array. In visual basic how control arrays help 5.0 you in coding (b) write a descriptive note on sequential access of file. 5.0 Question No 5.(a) An array of size N contains N positive integer 0-9construct an algorithm to determine if word is palindrome (mom, 4994) (b) write the program to read a positive integer N whether or not N is prime Number. 5.0 Dim i As Integer Dim x As Integer n = InputBox("enter the value ") For i = 2 To n / 2 If n Mod i = 0 Then x = 1 Exit For

2 2 P a g e Visual Basic 6.0 Punjab University papers If x = 0 Then Print "prime" Else Print "composite" Visual Basic Question no 1(a). What is program solving? explain its advantages (b) What is variable? explain different data types in VB. 5.0 Question No 2. (a) What are arithmetic operator in visual basic? explain with example.`5.0 2(b) How can you use a scrollbar in visual basic with example. 5.0 Question No 3(a) What is user define data types explain with example (b) In visual basic how select case help in coding. 5.0 Question no 4 (a) Discuss the different properties of form in detail (b) Difference between modules and procedure 5.0 Visual Basic Question No.1 what is event driven programming? differentiate between event driven programming and visual programing Question no 2. Write a VB program that takes n numbers as input. it outputs the frequency of positive and negative numbers. A sample input and out put as follows: Input N = 12 The 12 numbers are as under :- 40, 0, -1, 59, -37, 283, 61, 387, -91, -103, 341, 523 Output :- Frequency of positive numbers :- 8 Frequency of negative numbers :- 4 Dim n(11) As Integer

3 3 P a g e Visual Basic 6.0 Punjab University papers Dim sumpos As Integer Dim sumneg As Integer For i = 0 To 11 n(i) = InputBox("enter the value of array:") For i = 0 To 11 Print n(i) If n(i) < 0 Then sumneg = sumneg + 1 Else sumpos = sumpos + 1 Print "the frequency of even " & sumpos Print " the frequency of odd " & sumneg Question NO 3. Write a VB program that reads n values in a list and print the product of the value and position at which it resides in the list. product = L[1]*1, product = L[2] * 2 and so on Note the list does not change : Example:- position : Value Output : Dim n(1 To 5) As Integer For i = 1 To 5 n(i) = InputBox("enter the values in to array") Print " the output is as follwoing:" For i = 1 To 5 Print n(i) * i Visual Basic Question no 1. What is meant by structure programming? Describes event procedures, function procedures and modules. also given one coding for each type of the procedure. 12.5

4 4 P a g e Visual Basic 6.0 Punjab University papers Question no. 2 write a VB program that takes N numbers as input. it print the maximum number and its frequency (number of occurrence ) Sample no 1 N= 10 The 10 inputs are 7,20, -1, 65, 36, 90, 78, 90,90,-2 Maximum is 90 Frequency is 3 Dim fr As Integer Dim i As Integer Dim n As Integer Dim max As Integer fr = 0 max = 0 n = InputBox("enter the values") For i = 1 To n x = InputBox("enter the value ") If x > max Then max = x fr = 1 ElseIf x = max Then fr = fr + 1 Print "max is =" & max Print "frequency of max value" & fr Question no 3. Write a program that read 10 numbers from user and store them in an array. Print the numbers in ascending order. A sample program is given below ,8,90,34,2,9,12,1,10,32 Output :- 1,2,7,8,9,10,12,32,34,90 Dim arr(4) As Integer, temp As Integer Dim s As Integer Dim e As Integer s = InputBox("enter the value of s") e = InputBox("enter the value of e")

5 5 P a g e Visual Basic 6.0 Punjab University papers arr(i) = InputBox("enter the time in min") Print arr(i) For j = s To e - 1 If arr(j) > arr(j + 1) Then temp = arr(j) arr(j) = arr(j + 1) arr(j + 1) = temp Next j Print "sorted array " Print arr(i) Visual Basic Question no.1 Explain the following programming concept with example : a. data types in visual basic b. variables and their scope in a program c. branching & looping instructions d. function procedure e. relational operator. Question no.2 write a VB program that should takes a number n as input. your program print first 10 multiples of n by using loop Dim n As Integer n = InputBox("enter the value of n") For i = 1 To 10 Print "multiple" & n * i

6 6 P a g e Visual Basic 6.0 Punjab University papers Question no. 3 write a VB program that should takes 10 numbers as input and store them in an array. It should print the number of even numbers among those numbers. you need to use if else and loop in your program Dim n(9) As Integer Dim sumeven As Integer sumeven = 0 For i = 0 To 9 n(i) = InputBox("enter the value of n") For i = 0 To 9 If n(i) Mod 2 = 0 Then Print n(i) sumeven = sumeven + 1 MsgBox "total even number frequency=" & sumeven Visual Basic Question no 1. Explain the following terms and techniques : a. low level language b. OOP c. Structured programming d. sub procedure e. variable in VB Question No 2. Write a VB program that should takes 10 numbers from user as input data. your program should separate count the even and odd numbers presents in input. print both of the counts on the screen Dim n(9) As Integer For i = 0 To 9 n(i) = InputBox("enter the value of array:") For i = 0 To 9 Print n(i) If n(i) Mod 2 = 0 Then

7 7 P a g e Visual Basic 6.0 Punjab University papers evensum = evensum + 1 Else oddsum = oddsum + 1 Print "the frequency of even " & evensum Print " the frequency of odd " & oddsum Question No 3. Write a program in VB that should takes 3 numbers from user as input. your program find and print the square and cube of these three numbers on the screen Dim a As Integer Dim b As Integer Dim c As Integer a = InputBox("enter the value of a ") b = InputBox("enter the value of b ") c = InputBox("enter the value of c ") Print "a =" & vbtab & a ^ 2 & vbtab & a ^ 3; vbnewline & "b =" & vbtab & b ^ 2 & vbtab & b ^ 3; vbnewline & "c =" & vbtab & c ^ 2 & vbtab & c ^ 3; vbnewline Visual Basic Question NO.1. briefly explain the different between the following terms :- ( ) 1. variable and constant 2. low level and high level programming language 3. conditional and repletion statement in VB (B) write a VB program that inputs three distinct number and find and display middle one.

8 8 P a g e Visual Basic 6.0 Punjab University papers Dim a As Integer Dim b As Integer Dim c As Integer a = InputBox("enter the value") b = InputBox("enter the value") c = InputBox("enter the value") If (a > b And a < c) Or (a < b And a > c) Then Print "a is middile value" ElseIf (b > a And b < c) Or (b < a And b > c) Then Print " b is middle value" ElseIf (c > a And a < b) Or (c > b And a < c) Then Print "c is middle value" Question No 2(a) The Area of a rectangle is the rectangle s multiplied by its width. write program that asks for length and width of two rectangles. The program should tell the user which rectangle has the greater area or if the area are the same. ( ) Dim l1 As Integer Dim l2 As Integer Dim w1 As Integer Dim w2 As Integer Dim a1 As Integer Dim a2 As Integer l1 = InputBox("enter the value of lenght 1st triangle") w1 = InputBox("enter the value of width 1st triangle") l2 = InputBox("enter the value of lenght 2nd triangle") w2 = InputBox("enter the value of width 2nd triangle ") a1 = l1 * w1 a2 = l2 * w2 If a1 > a2 Then MsgBox ("area of first triangle is greater from second triangle ") ElseIf a1 = a2 Then MsgBox ("area of first triangle is equal to second triangle") ElseIf a1 < a2 Then MsgBox ("area of second triangle is greater from first triangle ")

9 9 P a g e Visual Basic 6.0 Punjab University papers (b). Write a VB program that should take a positive number n as input. your should display the sum of all numbers between 1 to n numbers. Solution : - Dim n As Integer Dim sum As Integer n = InputBox("enter the value") For i = 1 To n num = InputBox("enter the value") Print num sum = sum + num Print "sum of all the num" & sum Question NO 3.(a) write a VB program that should take 10 number from user. your program should find and display the maximum number. ( ) Dim num As Integer Dim max As Integer Dim count As Integer count = 0 max = num num = InputBox("enter the value :") Do While num > 0 count = count + 1 If num > max Then max = num num = InputBox("enter the value for exit ") Loop Print "max num is = " & max Dim n(10) As Integer Dim max As Integer OTHER SOLUTION

10 10 P a g e Visual Basic 6.0 Punjab University papers For i = 1 To 10 n(i) = InputBox("enter the 10 value") max = n(1) For i = 1 To 10 Print n(i) If max < n(i) Then max = n(i) Print "max =" & max (b) write a program that should takes two numbers (that is, first and last ) from the user and display all the numbers and their square in the form of an order pair between first and last numbers For example if user enter 2 to 5 then it should display pairs (2,4) (3,9) (4,16) (5,25) For example if user enter -3 to1 then it should display pairs (-3,9) (-2,4) (-1,1) (0,0) )(1,1) Dim n As Integer Dim S As Integer Dim E As Integer S = InputBox("enter the value") E = InputBox("enter the value") n = S For n = S To E Print "(" & n & "," & n ^ 2 & ")" Next n

11 11 P a g e Visual Basic 6.0 Punjab University papers Visual Basic Question NO 1(a) briefly Explain the difference between the following terms ( ) 1. structured programming 2. object oriented programming 3. visual programming Question No 1(b) running on a particular treadmill burn 3.9 calories per minutes. write a program that uses a loop to display the number of calories burned after 10, 15,20, 25 and 30 minutes Dim calories As Single Dim total_cal As Double total_cal = 0 calories = InputBox("enter the calories") For i = 10 To 30 Step 5 Print calories * i total_cal = total_cal + calories * i Print "total calories" & total_cal Const calories As Single = 3.9 Dim total_cal As Double total_cal = 0 For i = 10 To 30 Step 5 Print calories * i total_cal = total_cal + calories * i Print "total calories" & total_cal With constant Question NO 2(a) A country club, which currently charge RS per year for membership has, announced it will increase its membership fee by 4% each year for next 6 years. write a program uses loop to display the projected for next six years. ( ) Dim membership As Integer

12 12 P a g e Visual Basic 6.0 Punjab University papers Dim sum As Integer Dim year As Integer sum = 0 membership = 2500 For year = 2011 To 2016 Print year & vbtab & membership * 0.04 sum = sum + membership * 0.04 projected_cost = membership + sum Next year Print "projected membership for next 6 years " & projected_ cost Question No 2(b) write a VB program that should takes 10 positive numbers as input. your program should display the sum of all the numbers from 1 to n numbers. Dim n As Integer Dim sum As Integer sum = 0 For i = 1 To 10 n = InputBox("enter the value") Print n sum = sum + n Print "sum of numbers" & sum Question NO 3(a) write a VB program that should takes 10 minutes from user and save in an array. your program should sort and display these numbers in ascending order. ( ) Dim arr(4) As Integer, temp As Integer Dim s As Integer Dim e As Integer s = InputBox("enter the value of s") e = InputBox("enter the value of e") arr(i) = InputBox("enter the time in min") Print arr(i)

13 13 P a g e Visual Basic 6.0 Punjab University papers For j = s To e - 1 If arr(j) > arr(j + 1) Then temp = arr(j) arr(j) = arr(j + 1) arr(j + 1) = temp Next j Print "sorted array " Print arr(i) Question N0.3(b) write a program that asks the user to enter the amount that he or she budgeted for a month. A loop should then user to enter each of his or her expenses for the month and keep a running total. when the loop finishes, the program should displays the amount that user is over or under the budgets. Dim budget As Integer Dim val As Integer Dim exp As Integer exp = 0 budget = InputBox("enter the budget") Do val = InputBox("enter the expenses or enter the 0 to end ") exp = exp + val Loop While (val <> -1) If budget > exp Then Print " expenses under the budget" Else Print " expenses over the budget"

CPSC 203 Extra review and solutions

CPSC 203 Extra review and solutions CPSC 203 Extra review and solutions Multiple choice questions: For Questions 1 6 determine the output of the MsgBox 1) x = 12 If (x > 0) Then s = s & "a" s = s & "b" a. a b. b c. s d. ab e. None of the

More information

CPSC 230 Extra review and solutions

CPSC 230 Extra review and solutions Extra review questions: the following questions are meant to provide you with some extra practice so you need to actually try them on your own to get anything out of it. For that reason, solutions won't

More information

LECTURE 17. Array Searching and Sorting

LECTURE 17. Array Searching and Sorting LECTURE 17 Array Searching and Sorting ARRAY SEARCHING AND SORTING Today we ll be covering some of the more common ways for searching through an array to find an item, as well as some common ways to sort

More information

Functions. Arash Rafiey. September 26, 2017

Functions. Arash Rafiey. September 26, 2017 September 26, 2017 are the basic building blocks of a C program. are the basic building blocks of a C program. A function can be defined as a set of instructions to perform a specific task. are the basic

More information

Problem Set CVO 103, Spring 2018

Problem Set CVO 103, Spring 2018 Problem Set CVO 103, Spring 2018 Hakjoo Oh Due: 06/12 (in class) Problem 1 The Fibonacci numbers can be defined as follows: 0 if n = 0 fib(n) = 1 if n = 1 fib(n 1) + fib(n 2) otherwise Write in OCaml the

More information

Blum-Blum-Shub cryptosystem and generator. Blum-Blum-Shub cryptosystem and generator

Blum-Blum-Shub cryptosystem and generator. Blum-Blum-Shub cryptosystem and generator BBS encryption scheme A prime p is called a Blum prime if p mod 4 = 3. ALGORITHM Alice, the recipient, makes her BBS key as follows: BBS encryption scheme A prime p is called a Blum prime if p mod 4 =

More information

VARIABLE, OPERATOR AND EXPRESSION [SET 1]

VARIABLE, OPERATOR AND EXPRESSION [SET 1] VARIABLE, OPERATOR AND EXPRESSION Question 1 Write a program to print HELLO WORLD on screen. Write a program to display the following output using a single cout statement. Subject Marks Mathematics 90

More information

LOOPS. 1- Write a program that prompts user to enter an integer N and determines and prints the sum of cubes from 5 to N (i.e. sum of 5 3 to N 3 ).

LOOPS. 1- Write a program that prompts user to enter an integer N and determines and prints the sum of cubes from 5 to N (i.e. sum of 5 3 to N 3 ). LOOPS 1- Write a program that prompts user to enter an integer N and determines and prints the sum of cubes from 5 to N (i.e. sum of 5 3 to N 3 ). 2-Give the result of the following program: #include

More information

Subject: Computer Science

Subject: Computer Science Subject: Computer Science Topic: Data Types, Variables & Operators 1 Write a program to print HELLO WORLD on screen. 2 Write a program to display output using a single cout statement. 3 Write a program

More information

Sample Paper 2010 Class XII Subject Informatic Practices

Sample Paper 2010 Class XII Subject Informatic Practices Sample Paper 2010 Class XII Subject Informatic Practices (Section A) Q1. Answer the following Questions a) Visual Basic is not an Object Oriented Language Justify this statement. 2 b) How is a standard

More information

PROGRAMMING IN C AND C++:

PROGRAMMING IN C AND C++: PROGRAMMING IN C AND C++: Week 1 1. Introductions 2. Using Dos commands, make a directory: C:\users\YearOfJoining\Sectionx\USERNAME\CS101 3. Getting started with Visual C++. 4. Write a program to print

More information

CS 2113 Midterm Exam, November 6, 2007

CS 2113 Midterm Exam, November 6, 2007 CS 2113 Midterm Exam, November 6, 2007 Problem 1 [20 pts] When the following VBA program is executed, what will be displayed in the message box? Option Explicit Sub problem1() Dim m As Integer, n As Integer

More information

ECE15: Introduction to Computer Programming Using the C Language. Lecture Unit 4: Flow of Control

ECE15: Introduction to Computer Programming Using the C Language. Lecture Unit 4: Flow of Control ECE15: Introduction to Computer Programming Using the C Language Lecture Unit 4: Flow of Control Outline of this Lecture Examples of Statements in C Conditional Statements The if-else Conditional Statement

More information

Algorithms 4. Odd or even Algorithm 5. Greatest among three numbers Algorithm 6. Simple Calculator Algorithm

Algorithms 4. Odd or even Algorithm 5. Greatest among three numbers Algorithm 6. Simple Calculator Algorithm s 4. Odd or even Step 3 : If number divisible by 2 then Print "Number is Even" Step 3.1 : else Print "Number is Odd" Step 4 : Stop 5. Greatest among three numbers Step 2 : Read values of a, b and c Step

More information

Arrays. Storing Multiple Values

Arrays. Storing Multiple Values Arrays Storing Multiple Values Motels If you have a room in a motel and they give you room 5, which room is it? 1 2 3 4 5 6 Hotels If you have room 1541 in the Deluxe Ritz Hilton, which floor would you

More information

RBI PHASE 1 RECAP 2 ND JULY 18 QUANT NUMBER SYSTEM

RBI PHASE 1 RECAP 2 ND JULY 18 QUANT NUMBER SYSTEM RBI PHASE 1 RECAP 2 ND JULY 18 QUANT NUMBER SYSTEM Relative primes Two numbers are said to be relative or co-prime if they do not have any common factor other than 1. As 15 and 16 do not have any common

More information

Suggestive List of C++ Programs

Suggestive List of C++ Programs Suggestive List of C++ Programs 1. Write a C++ program to display Hello World! on the output screen. 2. Write a program to display Multiplication Table of a number inputted by the user. 3. Write a program

More information

Secure understanding of multiplication of whole numbers by 10, 100 or 1000.

Secure understanding of multiplication of whole numbers by 10, 100 or 1000. Secure understanding of multiplication of whole numbers by 10, 100 or 1000. Begin to identify common factors. Identify multiples and factors, including finding all factor pairs of a number, and common

More information

UNIT I : OVERVIEW OF COMPUTERS AND C-PROGRAMMING

UNIT I : OVERVIEW OF COMPUTERS AND C-PROGRAMMING SIDDARTHA INSTITUTE OF SCIENCE AND TECHNOLOGY:: PUTTUR Siddharth Nagar, Narayanavanam Road 517583 QUESTION BANK (DESCRIPTIVE) Subject with Code : PROGRAMMING FOR PROBLEM SOLVING (18CS0501) Course & Branch

More information

PROGRAMS. EXCELLENT ACADEMY OF ENGINEERING. Telephone: / NORMAL PROGRAM

PROGRAMS. EXCELLENT ACADEMY OF ENGINEERING. Telephone: / NORMAL PROGRAM PROGRAMS NORMAL PROGRAM 1. Wap to display months in words where month in number is input. 2. Wap to print Fibonacci series till n elements. 3. Wap to reverse 4 digit numbers. 4. Wap to accept a number

More information

Introduction to Computer Science Midterm 3 Fall, Points

Introduction to Computer Science Midterm 3 Fall, Points Introduction to Computer Science Fall, 2001 100 Points Notes 1. Tear off this sheet and use it to keep your answers covered at all times. 2. Turn the exam over and write your name next to the staple. Do

More information

Statements and Operators

Statements and Operators Statements and Operators Old Content - visit altium.com/documentation Mod ifi ed by Rob Eva ns on Feb 15, 201 7 Parent page: EnableBasic Enable Basic Statements Do...Loop Conditional statement that repeats

More information

Stratford upon Avon School Mathematics Homework Booklet

Stratford upon Avon School Mathematics Homework Booklet Stratford upon Avon School Mathematics Homework Booklet Year: 7 Scheme: 1 Term: 1 Name: Show your working out here Homework Sheet 1 1: Write 7:43 pm using the 24 hour clock 11: Find the area of this shape.

More information

INDIAN SCHOOL MUSCAT COMPUTER SCIENCE(083) CLASS XI

INDIAN SCHOOL MUSCAT COMPUTER SCIENCE(083) CLASS XI INDIAN SCHOOL MUSCAT COMPUTER SCIENCE(083) CLASS XI 2017-2018 Worksheet No. 1 Topic : Getting Started With C++ 1. Write a program to generate the following output: Year Profit% 2011 18 2012 27 2013 32

More information

UNIT 1. Introduction to Microsoft.NET framework and Basics of VB.Net

UNIT 1. Introduction to Microsoft.NET framework and Basics of VB.Net UNIT 1 Introduction to Microsoft.NET framework and Basics of VB.Net 1 SYLLABUS 1.1 Overview of Microsoft.NET Framework 1.2 The.NET Framework components 1.3 The Common Language Runtime (CLR) Environment

More information

6 Functions. 6.1 Focus on Software Engineering: Modular Programming TOPICS. CONCEPT: A program may be broken up into manageable functions.

6 Functions. 6.1 Focus on Software Engineering: Modular Programming TOPICS. CONCEPT: A program may be broken up into manageable functions. 6 Functions TOPICS 6.1 Focus on Software Engineering: Modular Programming 6.2 Defining and Calling Functions 6.3 Function Prototypes 6.4 Sending Data into a Function 6.5 Passing Data by Value 6.6 Focus

More information

Unit 7. Lesson 7.1. Loop. For Next Statements. Introduction. Loop

Unit 7. Lesson 7.1. Loop. For Next Statements. Introduction. Loop Loop Unit 7 Loop Introduction So far we have seen that each instruction is executed once and once only. Some time we may require that a group of instructions be executed repeatedly, until some logical

More information

Computer Science E-119 Practice Midterm

Computer Science E-119 Practice Midterm Name Computer Science E-119 Practice Midterm This exam consists of two parts. Part I has 5 multiple-choice questions worth 3 points each. Part II consists of 3 problems; show all your work on these problems

More information

CSE120 Wi18 Final Review

CSE120 Wi18 Final Review CSE120 Wi18 Final Review Practice Question Solutions 1. True or false? Looping is necessary for complex programs. Briefly explain. False. Many loops can be explicitly written out as individual statements

More information

B. V. Patel Institute of Business Management, Computer & Information Technology, UTU 2013

B. V. Patel Institute of Business Management, Computer & Information Technology, UTU 2013 Information Technology, UTU 203 030000 Fundamentals of Programming Problems to be solved in laboratory Note: Journal should contain followings for all problems given below:. Problem Statement 2. Algorithm

More information

Revision for Final Examination (Second Semester) Grade 9

Revision for Final Examination (Second Semester) Grade 9 Revision for Final Examination (Second Semester) Grade 9 Name: Date: Part 1: Answer the questions given below based on your knowledge about Visual Basic 2008: Question 1 What is the benefit of using Visual

More information

MODULE 2: Branching and Looping

MODULE 2: Branching and Looping MODULE 2: Branching and Looping I. Statements in C are of following types: 1. Simple statements: Statements that ends with semicolon 2. Compound statements: are also called as block. Statements written

More information

S.W.B.A.T: Identify the independent and dependent variable in sentence. Write a function rule for a table and a situation.

S.W.B.A.T: Identify the independent and dependent variable in sentence. Write a function rule for a table and a situation. Lesson 31 Date: Mr. Jones S.W.B.A.T: Identify the independent and dependent variable in sentence. Write a function rule for a table and a situation. DO NOW 1. If ( ), find f(3). 2. If f(x) = 2x -1, what

More information

Downloaded from

Downloaded from CLASS 11 COMPUTER SCIENCE (83) PRACTICAL LIST 1. Write a C++ Program to find area & circumference of circle. 2. Write a C++ Program to display ASCII character & vice versa. 3. Write a C++ Program to find

More information

AP Computer Science Principles Programming Question Tips. 1: Which algorithm/code segment achieves some result?

AP Computer Science Principles Programming Question Tips. 1: Which algorithm/code segment achieves some result? AP Computer Science Principles Programming Question Tips Name: Recall that roughly 40 percent of the questions on the AP exam will be programming or algorithm questions. These will often fall into one

More information

Programming with Visual Studio Higher (v. 2013)

Programming with Visual Studio Higher (v. 2013) Programming with Visual Studio Higher (v. 2013) Contents/Requirements Checklist Multiple selection: using ifs & case While Loops Using arrays Filling arrays Displaying array contents Types of variables:

More information

Sample Paper of Computer for Class 10

Sample Paper of Computer for Class 10 General Instructions: Sample Paper of Computer for Class 10 1. Answers to this Paper must be written on the paper provided separately. 2. You will not be allowed to write during the first 15 minutes. 3.

More information

Practical List of. MCA IV SEM Session -2010

Practical List of. MCA IV SEM Session -2010 1. WAP to create own exception. Rani Durgavati Vishwavidyalaya Jabalpur (M.P.) (UICSA) Master of Computer Application (MCA) Practical List of MCA IV SEM Session -2010 MCA-401 - Internet and Java Programming

More information

QBASIC Programs SET-3 [SUB and FUNCTION] 1

QBASIC Programs SET-3 [SUB and FUNCTION] 1 QBASIC Programs SET-3 [SUB and FUNCTION] 1 Share on Facebook Share Share on TwitterTweet Share on Google Plus Share Share on LinkedIn Share Print This Page Write a program to display the reverse of input

More information

Knowledge Organiser - E3

Knowledge Organiser - E3 Knowledge Organiser - E3 Code Objective E3.0 Interpret negative numbers in context, count forwards and backwards with positive and negative whole numbers, including through zero The temperature in Bolton

More information

variables programming statements

variables programming statements 1 VB PROGRAMMERS GUIDE LESSON 1 File: VbGuideL1.doc Date Started: May 24, 2002 Last Update: Dec 27, 2002 ISBN: 0-9730824-9-6 Version: 0.0 INTRODUCTION TO VB PROGRAMMING VB stands for Visual Basic. Visual

More information

Repetition Algorithms

Repetition Algorithms Repetition Algorithms Repetition Allows a program to execute a set of instructions over and over. The term loop is a synonym for a repetition statement. A Repetition Example Suppose that you have been

More information

CS1100 Introduction to Programming

CS1100 Introduction to Programming Decisions with Variables CS1100 Introduction to Programming Selection Statements Madhu Mutyam Department of Computer Science and Engineering Indian Institute of Technology Madras Course Material SD, SB,

More information

CHAPTER 4 FUNCTIONS. 4.1 Introduction

CHAPTER 4 FUNCTIONS. 4.1 Introduction CHAPTER 4 FUNCTIONS 4.1 Introduction Functions are the building blocks of C++ programs. Functions are also the executable segments in a program. The starting point for the execution of a program is main

More information

Lesson Plan -- Multiplying and Dividing Integers

Lesson Plan -- Multiplying and Dividing Integers Lesson Plan -- Multiplying and Dividing Integers Chapter Resources - Lesson 3-9 Multiply Integers - Lesson 3-9 Multiply Integers Answers - Lesson 3-10 Divide Integers - Lesson 3-10 Divide Integers Answers

More information

There are three questions on this exam. You have 2 hours to complete it. Please indent your program so that it is easy for the grader to read.

There are three questions on this exam. You have 2 hours to complete it. Please indent your program so that it is easy for the grader to read. There are three questions on this exam. You have 2 hours to complete it. Please indent your program so that it is easy for the grader to read. 1. Write a function named largestadjacentsum that iterates

More information

Dept. of CSE, IIT KGP

Dept. of CSE, IIT KGP Control Flow: Looping CS10001: Programming & Data Structures Pallab Dasgupta Professor, Dept. of Computer Sc. & Engg., Indian Institute of Technology Kharagpur Types of Repeated Execution Loop: Group of

More information

VALLIAMMAI ENGINEERING COLLEGE

VALLIAMMAI ENGINEERING COLLEGE VALLIAMMAI ENGINEERING COLLEGE SRM Nagar, Kattankulathur 603 203 DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING QUESTION BANK B.E. - Electrical and Electronics Engineering IV SEMESTER CS6456 - OBJECT ORIENTED

More information

Intermediate Mathematics League of Eastern Massachusetts

Intermediate Mathematics League of Eastern Massachusetts IMLEM Meet #4 March, 2017 Intermediate Mathematics League of Eastern Massachusetts This is a calculator meet! Category 1 Mystery Meet #4 - February, 2017 Calculator Meet 1) What is the maximum (greatest)

More information

Variable A variable is a value that can change during the execution of a program.

Variable A variable is a value that can change during the execution of a program. Declare and use variables and constants Variable A variable is a value that can change during the execution of a program. Constant A constant is a value that is set when the program initializes and does

More information

METHODS EXERCISES GuessNumber and Sample run SumAll Sample Run

METHODS EXERCISES GuessNumber and Sample run SumAll Sample Run METHODS EXERCISES Write a method called GuessNumber that receives nothing and returns back nothing. The method first picks a random number from 1-100. The user then keeps guessing as long as their guess

More information

Functionally Modular. Self-Review Questions

Functionally Modular. Self-Review Questions Functionally Modular 5 Self-Review Questions Self-review 5.1 Which names are local, which are global and which are built-in in the following code fragment? Global names: Built-in names: space_invaders

More information

AN OVERVIEW OF C, PART 3. CSE 130: Introduction to Programming in C Stony Brook University

AN OVERVIEW OF C, PART 3. CSE 130: Introduction to Programming in C Stony Brook University AN OVERVIEW OF C, PART 3 CSE 130: Introduction to Programming in C Stony Brook University FANCIER OUTPUT FORMATTING Recall that you can insert a text field width value into a printf() format specifier:

More information

IS 320 A/B Winter 1998 Page 1 Exam 1

IS 320 A/B Winter 1998 Page 1 Exam 1 IS 320 A/B Winter 1998 Page 1 Use your own paper to answer the questions. You may do work on this document but transfer your answers to separate sheets of paper. Turn in this document as well as your answers

More information

Sol. Sol. a. void remove_items_less_than(int arr[], int size, int value) #include <iostream> #include <ctime> using namespace std;

Sol. Sol. a. void remove_items_less_than(int arr[], int size, int value) #include <iostream> #include <ctime> using namespace std; r6.14 For the operations on partially filled arrays below, provide the header of a func tion. d. Remove all elements that are less than a given value. Sol a. void remove_items_less_than(int arr[], int

More information

Course Outlines. Elementary Mathematics (Grades K-5) Kids and Numbers (Recommended for K-1 students)

Course Outlines. Elementary Mathematics (Grades K-5) Kids and Numbers (Recommended for K-1 students) Course Outlines Elementary Mathematics (Grades K-5) Kids and Numbers (Recommended for K-1 students) Shapes and Patterns. Grouping objects by similar properties. Identifying simple figures within a complex

More information

Chapter 3 Problem Solving and the Computer

Chapter 3 Problem Solving and the Computer Chapter 3 Problem Solving and the Computer An algorithm is a step-by-step operations that the CPU must execute in order to solve a problem, or to perform that task. A program is the specification of an

More information

PROBLEM SOLVING AND PROGRAM. Looping statements Executing steps many times

PROBLEM SOLVING AND PROGRAM. Looping statements Executing steps many times PROBLEM SOLVING AND PROGRAM Looping statements Executing steps many times LOOPING What if there are a number of steps that must be done several times, would you re-write those steps for each time you needed

More information

VALLIAMMAI ENGINEERING COLLEGE

VALLIAMMAI ENGINEERING COLLEGE VALLIAMMAI ENGINEERING COLLEGE SRM Nagar, Kattankulathur 60 20 DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING QUESTION BANK B.E I SEMESTER GE85- Problem Solving and Python Programming Regulation 207 Academic

More information

CHAPTER 9: Quadratic Equations and Functions

CHAPTER 9: Quadratic Equations and Functions CHAPTER : Quadratic Equations and Functions Notes # -: Exploring Quadratic Graphs A. Graphing ax A is a function that can be written in the form ax bx c where a, b, and c are real numbers and a 0. Examples:

More information

Lesson 26: Volume of Composite Three-Dimensional Objects

Lesson 26: Volume of Composite Three-Dimensional Objects Lesson 26: Volume of Composite Three-Dimensional Objects Student Outcomes Students compute volumes of three-dimensional objects composed of right prisms by using the fact that volume is additive. Lesson

More information

An overview about DroidBasic For Android

An overview about DroidBasic For Android An overview about DroidBasic For Android from February 25, 2013 Contents An overview about DroidBasic For Android...1 Object-Oriented...2 Event-Driven...2 DroidBasic Framework...2 The Integrated Development

More information

Reg. No. : Question Paper Code : B.E./B.Tech. DEGREE EXAMINATION, JANUARY First Semester GE 6151 COMPUTER PROGRAMMING

Reg. No. : Question Paper Code : B.E./B.Tech. DEGREE EXAMINATION, JANUARY First Semester GE 6151 COMPUTER PROGRAMMING wss Reg. No. : Question Paper Code : 37007 B.E./B.Tech. DEGREE EXAMINATION, JANUARY 2014. First Semester Civil Engineering GE 6151 COMPUTER PROGRAMMING (Common to all branches) (Regulation 2013) Time :

More information

review for 3rd 9 weeks test

review for 3rd 9 weeks test Class: Date: review for 3rd 9 weeks test What are the variables in each graph? Describe how the variables are related at various points on the graph. 1. Lena makes home deliveries of groceries for a supermarket.

More information

Algorithm. Building blocks of algorithm

Algorithm. Building blocks of algorithm UNIT I ALGORITHMIC PROBLEM SOLVING 9 Algorithms, building blocks of algorithms (statements, state, control flow, functions), notation (pseudo code, flow chart, programming language), algorithmic problem

More information

The Absolute Value Symbol

The Absolute Value Symbol Section 1 3: Absolute Value and Powers The Absolute Value Symbol The symbol for absolute value is a pair of vertical lines. These absolute value brackets act like the parenthesis that we use in order of

More information

Questions Bank. 14) State any four advantages of using flow-chart

Questions Bank. 14) State any four advantages of using flow-chart Questions Bank Sub:PIC(22228) Course Code:-EJ-2I ----------------------------------------------------------------------------------------------- Chapter:-1 (Overview of C Programming)(10 Marks) 1) State

More information

GENERAL INFORMATICS Chapter 3. The Representation of Processing Algorithms Algorithm definition Steps in computer problem solving process

GENERAL INFORMATICS Chapter 3. The Representation of Processing Algorithms Algorithm definition Steps in computer problem solving process GENERAL INFORMATICS Chapter 3. The Representation of Processing Algorithms 3.1. Algorithm definition 3.2. Steps in computer problem solving process 3.3. Steps for preparing a program for execution 3.4.

More information

How to Do Word Problems. Study of Integers

How to Do Word Problems. Study of Integers Study of Integers In this chapter, we are are going to closely look at the number line system and study integers. -3-2 -1 0 1 2 3 4 5 6 An integer is simply a number like 0, 1, 2, 3, and 4, but unlike

More information

Guess Paper Class XII Subject Informatics Practices TIME : 1½ HRS. M.M. : 50

Guess Paper Class XII Subject Informatics Practices TIME : 1½ HRS. M.M. : 50 Guess Paper 2009-10 Class XII Subject Informatics Practices Answer the following questions 1. Explain the following terms: 2x5=10 a) Shareware b) PHP c) UNICODE d) GNU e) FLOSS 2 Explain the following

More information

3 The L oop Control Structure

3 The L oop Control Structure 3 The L oop Control Structure Loops The while Loop Tips and Traps More Operators The for Loop Nesting of Loops Multiple Initialisations in the for Loop The Odd Loop The break Statement The continue Statement

More information

Sri Vidya College of Engineering & Technology

Sri Vidya College of Engineering & Technology UNIT I INTRODUCTION TO OOP AND FUNDAMENTALS OF JAVA 1. Define OOP. Part A Object-Oriented Programming (OOP) is a methodology or paradigm to design a program using classes and objects. It simplifies the

More information

CS130/230 Lecture 12 Advanced Forms and Visual Basic for Applications

CS130/230 Lecture 12 Advanced Forms and Visual Basic for Applications CS130/230 Lecture 12 Advanced Forms and Visual Basic for Applications Friday, January 23, 2004 We are going to continue using the vending machine example to illustrate some more of Access properties. Advanced

More information

WASHINGTON STATE MIDDLE SCHOOL COMPUTER SCIENCE COMPETITION 2017

WASHINGTON STATE MIDDLE SCHOOL COMPUTER SCIENCE COMPETITION 2017 WASHINGTON STATE MIDDLE SCHOOL COMPUTER SCIENCE COMPETITION 2017 Individual Challenge Grades 5 6 30 minutes Please read these directions carefully before beginning. Breaking any of the rules is grounds

More information

VBScript: Math Functions

VBScript: Math Functions C h a p t e r 3 VBScript: Math Functions In this chapter, you will learn how to use the following VBScript functions to World Class standards: 1. Writing Math Equations in VBScripts 2. Beginning a New

More information

Repetition Structures

Repetition Structures Repetition Structures There are three main structures used in programming: sequential, decision and repetition structures. Sequential structures follow one line of code after another. Decision structures

More information

Choose 3 of the 1 st 4 questions (#'s 1 through 4) to complete. Each question is worth 12 points.

Choose 3 of the 1 st 4 questions (#'s 1 through 4) to complete. Each question is worth 12 points. Choose 3 of the 1 st 4 questions (#'s 1 through 4) to complete. Each question is worth 12 points. Use the remaining question as extra credit (worth 1/2 of the points earned). Specify which question is

More information

n Group of statements that are executed repeatedly while some condition remains true

n Group of statements that are executed repeatedly while some condition remains true Looping 1 Loops n Group of statements that are executed repeatedly while some condition remains true n Each execution of the group of statements is called an iteration of the loop 2 Example counter 1,

More information

Sébastien Mathier wwwexcel-pratiquecom/en While : Loops make it possible to repeat instructions a number of times, which can save a lot of time The following code puts sequential numbers into each of the

More information

Lesson 9: An Application of Linear Equations

Lesson 9: An Application of Linear Equations Classwork Exercises 1. Write the equation for the 15 th step. 2. How many people would see the photo after 15 steps? Use a calculator if needed. S.30 3. Marvin paid an entrance fee of $5 plus an additional

More information

7 Control Structures, Logical Statements

7 Control Structures, Logical Statements 7 Control Structures, Logical Statements 7.1 Logical Statements 1. Logical (true or false) statements comparing scalars or matrices can be evaluated in MATLAB. Two matrices of the same size may be compared,

More information

Overview About KBasic

Overview About KBasic Overview About KBasic The following chapter has been used from Wikipedia entry about BASIC and is licensed under the GNU Free Documentation License. Table of Contents Object-Oriented...2 Event-Driven...2

More information

Computers in Engineering COMP 208 Repetition and Storage Michael A. Hawker. Repetition. A Table of Values 9/20/2007

Computers in Engineering COMP 208 Repetition and Storage Michael A. Hawker. Repetition. A Table of Values 9/20/2007 Computers in Engineering COMP 208 Repetition and Storage Michael A. Hawker Repetition To fully take advantage of the speed of a computer, we must be able to instruct it to do a lot of work The program

More information

More About Factoring Trinomials

More About Factoring Trinomials Section 6.3 More About Factoring Trinomials 239 83. x 2 17x 70 x 7 x 10 Width of rectangle: Length of rectangle: x 7 x 10 Width of shaded region: 7 Length of shaded region: x 10 x 10 Area of shaded region:

More information

ELEMENTARY NUMBER THEORY AND METHODS OF PROOF

ELEMENTARY NUMBER THEORY AND METHODS OF PROOF CHAPTER 4 ELEMENTARY NUMBER THEORY AND METHODS OF PROOF Copyright Cengage Learning. All rights reserved. SECTION 4.3 Direct Proof and Counterexample III: Divisibility Copyright Cengage Learning. All rights

More information

Burrows & Langford Chapter 10 page 1 Learning Programming Using VISUAL BASIC.NET

Burrows & Langford Chapter 10 page 1 Learning Programming Using VISUAL BASIC.NET Burrows & Langford Chapter 10 page 1 CHAPTER 10 WORKING WITH ARRAYS AND COLLECTIONS Imagine a mail-order company that sells products to customers from all 50 states in the United States. This company is

More information

Mr.Khaled Anwar ( )

Mr.Khaled Anwar ( ) The Rnd() function generates random numbers. Every time Rnd() is executed, it returns a different random fraction (greater than or equal to 0 and less than 1). If you end execution and run the program

More information

Syllabus of Diploma Engineering. Computer Engineering. Semester: II. Subject Name: Computer Programming. Subject Code: 09CE1104

Syllabus of Diploma Engineering. Computer Engineering. Semester: II. Subject Name: Computer Programming. Subject Code: 09CE1104 Semester: II Subject Name: Computer Programming Subject Code: 09CE1104 Objective: This Course will help to develop programming skills in the students, using a structured programming language `C'. Students

More information

DATABASE AUTOMATION USING VBA (ADVANCED MICROSOFT ACCESS, X405.6)

DATABASE AUTOMATION USING VBA (ADVANCED MICROSOFT ACCESS, X405.6) Technology & Information Management Instructor: Michael Kremer, Ph.D. Database Program: Microsoft Access Series DATABASE AUTOMATION USING VBA (ADVANCED MICROSOFT ACCESS, X405.6) AGENDA 3. Executing VBA

More information

Introduction to COSY INFINITY

Introduction to COSY INFINITY Introduction to COSY INFINITY 1 COSY INFINITY is the first arbitrary order beam physics code. It is a DA (Differential Algebra) based, new generation code for the study and design of beam physics systems:

More information

ELEMENTARY NUMBER THEORY AND METHODS OF PROOF

ELEMENTARY NUMBER THEORY AND METHODS OF PROOF CHAPTER 4 ELEMENTARY NUMBER THEORY AND METHODS OF PROOF Copyright Cengage Learning. All rights reserved. SECTION 4.3 Direct Proof and Counterexample III: Divisibility Copyright Cengage Learning. All rights

More information

COMPUTER APPLICATIONS

COMPUTER APPLICATIONS COMPUTER APPLICATIONS (Theory) (Two hours) Answers to this Paper must be written on the paper provided separately. You will not be allowed to write during the first 15 minutes. This time is to be spent

More information

WASHINGTON STATE MIDDLE SCHOOL COMPUTER SCIENCE COMPETITION 2017

WASHINGTON STATE MIDDLE SCHOOL COMPUTER SCIENCE COMPETITION 2017 WASHINGTON STATE MIDDLE SCHOOL COMPUTER SCIENCE COMPETITION 2017 Individual Challenge Grades 7 8 30 minutes Please read these directions carefully before beginning. Breaking any of the rules is grounds

More information

Chapter 5 7. num = 0 repeat: if (num is Odd ) print (num is Odd) num = num + 1 until (num < 50) 11. Suppose N is the given integer.

Chapter 5 7. num = 0 repeat: if (num is Odd ) print (num is Odd) num = num + 1 until (num < 50) 11. Suppose N is the given integer. Chapter 5 7. num = 0 repeat: if (num is Odd ) print (num is Odd) num = num + 1 until (num < 50) 11. Suppose N is the given integer. Then the following will work. You may want to ask your students how this

More information

Number System. Introduction. Natural Numbers (N) Whole Numbers (W) Integers (Z) Prime Numbers (P) Face Value. Place Value

Number System. Introduction. Natural Numbers (N) Whole Numbers (W) Integers (Z) Prime Numbers (P) Face Value. Place Value 1 Number System Introduction In this chapter, we will study about the number system and number line. We will also learn about the four fundamental operations on whole numbers and their properties. Natural

More information

Maintaining Mathematical Proficiency

Maintaining Mathematical Proficiency NBHCA SUMMER WORK FOR ALGEBRA 1 HONORS AND GEOMETRY HONORS Name 1 Add or subtract. 1. 1 3. 0 1 3. 5 4. 4 7 5. Find two pairs of integers whose sum is 6. 6. In a city, the record monthly high temperature

More information

Essential Questions. Key Terms. Algebra. Arithmetic Sequence

Essential Questions. Key Terms. Algebra. Arithmetic Sequence Linear Equations and Inequalities Introduction Average Rate of Change Coefficient Constant Rate of Change Continuous Discrete Domain End Behaviors Equation Explicit Formula Expression Factor Inequality

More information

EECS1012. Net-centric Introduction to Computing. Lecture 7 Computational Thinking. Fall 2018, EECS York University. M.S. Brown and Amir H.

EECS1012. Net-centric Introduction to Computing. Lecture 7 Computational Thinking. Fall 2018, EECS York University. M.S. Brown and Amir H. EECS1012 Net-centric Introduction to Computing Lecture 7 Computational hinking all 2018, EECS York University M.S. Brown and Amir H. Chinaei overview computational thinking the thought process involved

More information

21-Loops Part 2 text: Chapter ECEGR 101 Engineering Problem Solving with Matlab Professor Henry Louie

21-Loops Part 2 text: Chapter ECEGR 101 Engineering Problem Solving with Matlab Professor Henry Louie 21-Loops Part 2 text: Chapter 6.4-6.6 ECEGR 101 Engineering Problem Solving with Matlab Professor Henry Louie While Loop Infinite Loops Break and Continue Overview Dr. Henry Louie 2 WHILE Loop Used to

More information

Assertions & Verification & Example Loop Invariants Example Exam Questions

Assertions & Verification & Example Loop Invariants Example Exam Questions 2014 November 27 1. Assertions & Verification & Example Loop Invariants Example Exam Questions 2. A B C Give a general template for refining an operation into a sequence and state what questions a designer

More information