Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Theory Assignment - 1 
1. What is a loop in a program ? 
In computer programming, a loop is used to repeat a block of stat...
- 2 - 
Theory Assignment - 2 
1. What do you mean by GUI ? 
GUI is an interface that enables the user to interact with the...
- 3 - 
9. Which functions are integrated by a Visual Basic IDE window? 
The Visual Basic IDE window integrates many differ...
- 4 - 
2. How does online chat differ from instant messaging ? 
Instant messaging is like a private chat room and has know...
- 5 - 
14. What are the requirements for online gaming? 
Requirements for online gaming are: 
• High-speed Internet connec...
TERM - II (Lab Activity) 
Q BASIC 
ACTIVITY - I 
Write a Q BASIC program to help shivangi to print the first ten multiples...
VISUAL BASIC 
ACTIVITY - 3 
Kanika wants to create a VB application in which, if she enters her name and clicks Display bu...
VISUAL BASIC 
ACTIVITY - 4 
The Math teacher has asked Sarika to create a VB application to enter the radius of a circle a...
Upcoming SlideShare
Loading in …5
×

Class 7 - Term 2 (2014-2015) Theory & Lab Notes

20,412 views

Published on

Class 7 - Term 2 (2014-2015) Theory & Lab Notes

Published in: Education
  • Be the first to comment

Class 7 - Term 2 (2014-2015) Theory & Lab Notes

  1. 1. Theory Assignment - 1 1. What is a loop in a program ? In computer programming, a loop is used to repeat a block of statements a number of times. 2. What are the looping statements in Q BASIC ? There are three looping statements in QBasic: WHILE…WEND, DO…LOOP, and FOR....NEXT. 3. What is the difference between the DO WHILE loop and DO UNTIL loop ? DO WHILE...LOOP is executed as long as the condition is True whereas DO UNTIL...LOOP is executed as long as the condition is False. 4. What is the difference between the DO WHILE loop and DO LOOP WHILE forms of the DO LOOP ? The DO WHILE…LOOP is executed as long as the condition is True whereas DO...LOOP WHILE is executed at least once before the condition is checked. Also, the condition in the DO WHILE… LOOP appears before the loop starts whereas in DO...LOOP WHILE the condition appears at the end of the loop. 5. How many times is the loop executed in DO … LOOP WHILE if the condition starts off as false ? The loop will execute at least once even if the condition starts off as false in DO...LOOP WHILE. 6. Which looping statement is preferred if you know the number of repetitions ? FOR ... NEXT looping statement is preferred if we know the number of repetitions. 7. What is the default STEP value in a FOR NEXT statement ? The default STEP value in a FOR...NEXT statement is one. 8. Can you have negative value in STEP ? If Yes, what will be true about the start and end values in the statement ? Yes, we can have negative value in STEP. In this case, the starting value is greater than the ending value. 9. Give the general format of the FOR...NEXT statement. The general format of the FOR..NEXT statement is: FOR control-variable = start-value TO end-value STEP index-value statement(s) NEXT control-variable 10. Why should the value of COUNT be modified during the loop process? What happens if this is not done? The value of COUNT should be modified during the loop process so that the condition eventually becomes false. If this is not done, the loop will continue infinitely. This is called an endless loop. ********************************** Class 7
  2. 2. - 2 - Theory Assignment - 2 1. What do you mean by GUI ? GUI is an interface that enables the user to interact with the application by using controls like icons, buttons, menus, dialog boxes, and windows. 2. What is event driven programming ? Event-driven programming is one in which the program responds to events, which are actions performed by the user. 3. Write the steps in the development of a Visual Basic application. The steps to develop a Visual Basic application are: i. Create a form. ii. Place controls on the form. iii. Set properties for the controls. iv. Add code to the controls to handle the events. 4. What are the file extensions of a form file and a project file ? The extension of a form fi le is .vb and the extension of a project fi le is .vbproj. 5. What are the two ways to place a control on a form ? The two ways to place a control on the form are: • Double-click on the control in the Toolbox. • Click on the control in the Toolbox and drag it onto the form. 6. Name any four controls in the Toolbox. Four controls in the Toolbox are Label, Button, Combo Box, and ListBox. 7. Name any two properties of Textbox and Label. Two properties of TextBox and Label are Font and Text. 8. Write two ways to run a Visual Basic application. Two ways to run a Visual Basic application are: • Press F5. • Click Debug  Start Debugging.
  3. 3. - 3 - 9. Which functions are integrated by a Visual Basic IDE window? The Visual Basic IDE window integrates many different functions such as designing, editing, compiling, and debugging (removing errors). 10. What are the four areas of a Visual Basic window? The four areas of a Visual Basic window are: • An empty form • The Toolbox tab • The Solution Explorer window • The Properties window 11. What is the general format of declaring a variable in Visual Basic? Give an example. The general format of declaring a variable in VB is: Dim VariableName As Data Type For example, Dim StuName As String You can declare multiple variables in one line, separating each with a comma: Dim StuName As String, Total As Integer, Percentage As Single You can declare more than one variable of the same data type like this: Dim Num1, Num2, Num3 As Integer 12. Discuss three data types in Visual Basic. The three data types in Visual Basic are: • String: It holds alphabetic characters, numeric numbers, and special characters with which calculations cannot be performed. • Integer: It holds whole numbers. • Single: It holds whole or fractional numbers. 13. What is the general format of assigning a value to a variable? Give two examples. The general format of assigning a value to a variable is: Variable = expression or constant For example: A = 100 A = B * C ********************************** Theory Assignment - 3 1. What is a chat room ? A chat room is a service in which multiple users talk to each other in real time by posting messages.
  4. 4. - 4 - 2. How does online chat differ from instant messaging ? Instant messaging is like a private chat room and has known users whereas online chat could also happen between unknown users. 3. Name any two online chat services. Two online chat services are Yahoo! Messenger and Google Talk. 4. How are newsgroups different from e-mail ? In a newsgroup messages are posted on a bulletin board where any member can read and respond to them, unlike e-mails that are sent to somebody’s private mailbox. 5. List any three official newsgroup categories. Three official newsgroup categories are Alt(alternate), Biz(business, commerce), and Soc(social). 6. Why are feed readers useful ? Feed readers are useful because they allow you to keep updated with new content from Web sites and you can easily subscribe to the Web site. 7. What is online file sharing ? List few web sites that allow online sharing. An online file sharing service provides a way to store and access information in the ‘cloud’ rather than locally on a hard drive. The two Web sites that allow online file sharing are Picasa and YouTube. 8. What are the benefits of using Picasa Web Albums ? The benefits of using Picasa Web Albums are that it allows easy photo sharing and storing, and also provides online backup. 9. What is Cloud Computing ? Cloud computing is a technology that uses the Internet and central remote servers to hold data and applications. 10. Write a short note on Instant Messaging (IM). How is it different from online chat? Instant messaging (IM) is a communication service over the Internet that allows instant transmission of text-based messages from sender to receiver. Like online chat, instant messaging also offers text-based, two-way message exchange in real time. Instant messaging is like a private chat room. It includes only those people whom the user has invited. 11. Write a short note on weblogs. A blog or a weblog is a Web site on which articles are posted regularly and displayed in reverse sequential order. Blog entries can have text, hypertext, images, links to other Web pages, video, audio, etc. A blog usually focuses on a particular area of interest. 12. What is a Web feed? Give two examples of feed readers. A Web feed or news feed is a facility that informs interested readers of new content on a Web site. It is a good method of keeping up with blogs, news sites, and other sites. You can see updates from many sites in a single place and don’t even need to visit multiple URLs. 13. Explain online telephony. What is its requirement? Online telephony, or Internet telephony, is a technology that allows users to make telephone calls over the Internet. You can talk to somebody who is using a computer, or you can make domestic or international calls from your computer to a telephone. Skype is the most popular Internet telephony software.
  5. 5. - 5 - 14. What are the requirements for online gaming? Requirements for online gaming are: • High-speed Internet connection • Proper hardware • Gaming control devices, e.g., Xbox, Playstation, joystick • Gaming software • Latest Flash and Web browser versions ********************************** 5 Mark Questions: 1. Explain WHILE . . . WEND loop with an example. 2. Explain DO . . . WHILE loop with an example. 3. Explain DO . . . UNTIL loop with an example. 4. Explain FOR . . . NEXT loop statement in Q BASIC. 5. Write a Q BASIC program to help shivangi to print the first ten multiples of 5. Help her to write the program using WHILE … WEND statement. 6. Shyam wants to write a Q BASIC program to print the factorial of a given number using the FOR … NEXT loop. 7. Kunal’s sister is learning addition in Maths. She is trying to add numbers from 1 to 100. Can you make a program to print the sum of numbers 1 + 2 + 3 + . . . . + 100 ? 8. Sanya’s brother Simant is learning tables for a Math examination. Sanya has written a program that takes a number as input and displays the table of that number from 1 to 10. Can you write the same program ? Which looping statement would you prefer and why ? 9. Explain the components of the Visual Basic Window. 10. How do you add a control to a form in Visual Basic ? 11. List out the steps to use Picasa. 12. Explain Online Gaming. ***********************
  6. 6. TERM - II (Lab Activity) Q BASIC ACTIVITY - I Write a Q BASIC program to help shivangi to print the first ten multiples of 5. Help her to write the program using WHILE … WEND statement. SOLUTION C = 1 WHILE C <= 10 PRINT 5 * C C = C + 1 WEND END Shyam wants to write a Q BASIC program to print the factorial of a given number using the FOR … NEXT loop. SOLUTION CLS INPUT “Enter a Positive Integer:”, X FACTR = 1 FOR N = X TO 1 STEP -1 FACTR = FACTR * N NEXT N PRINT “Factorial of “ ; X ; “ is “ ; FACTR END ACTIVITY - 2 Kunal’s sister is learning addition in Maths. She is trying to add numbers from 1 to 100. Can you make a program to print the sum of numbers 1 + 2 + 3 + . . . . + 100 ? CLS SUM = 0 FOR I = 1 TO 100 SUM = SUM + I NEXT I PRINT “SUM OF 1 + 2 + 3 + . . . + 100 = “ ; SUM END Sanya’s brother Simant is learning tables for a Math examination. Sanya has written a program that takes a number as input and displays the table of that number from 1 to 10. Can you write the same program ? Which looping statement would you prefer and why ? CLS INPUT "Enter a number"; X FOR N = 1 TO 10 PRINT X ; " X " ; N ; " = "; X * N NEXT N END Class 7
  7. 7. VISUAL BASIC ACTIVITY - 3 Kanika wants to create a VB application in which, if she enters her name and clicks Display button, the message 'Hello, Kanika !' will appear in the label. SOLUTION Step 1: Invoke Visual Basic 2010, and create a Windows Forms Application named HelloMessage. Step 2: Place two label controls, one text box control, and one button control on the form. Step 3: Set the following properties for the form and controls: Form1 Text : "Display Message" Font : Bold, 12 BackColor : Highlight Label1 Text : "Enter your Name" Font : Bold, 12 Label2 Text : blank (delete the text) Font : Bold, 12 BorderStyle : FixedSingle TextBox1 Text : blank (delete the text) Font : Bold, 12 Button1 Text : "Display" Font : Bold, 12 Step 4: Double click the Display button to get the code template. Add a line as shown: Step 5: Select Save Project As to save the VB application. Step 6: Press F5 to run the application. Step 7: Enter your name in the text box and click Display. The message will appear in Label2. Output: (to be drawn on the left page)
  8. 8. VISUAL BASIC ACTIVITY - 4 The Math teacher has asked Sarika to create a VB application to enter the radius of a circle and display its area and circumference. (Hint : Area = 3.14 * radius * radius, Circumference = 2 * 3.14 * radius). SOLUTION Step 1: Invoke Visual Basic 2010, and create a Windows Forms Application named Circle. Step 2: Place three label controls, three text box controls, and one button control on the form. Step 3: Set the following properties for the form and controls: Form1 Text : "Circle" Font : Bold, 12 Label1 Text : "Radius of a Circle" Font : Bold, 12 Label2 Text : "Area of a Circle" Font : Bold, 12 Label3 Text : "Circumference of a Circle" Font : Bold, 12 TextBox1 Text : blank (delete the text) Font : Bold, 12 TextBox2 Text : blank (delete the text) Font : Bold, 12 TextBox3 Text : blank (delete the text) Font : Bold, 12 Button1 Text : "Calculate" Font : Bold, 12 Step 4: Double click the Display button to get the code template. Enter the following code : Step 5: Select Save Project As to save the VB application. Step 6: Press F5 to run the application. Step 7: Enter radius in the text box and click Calculate. Area & Circumference of a Circle will be displayed as shown below. Output: (to be drawn on the left page)

×