פתרון בוחן הכיתה. שאלה #1 Module Module1 Sub Main() Dim x, z As Integer x = Console.ReadLine() z = Console.ReadLine() If (x = 0) Then Console.WriteLine("Error")

Slides:



Advertisements
Similar presentations
Mod arithmetic.
Advertisements

Standard Algorithms Find the highest number. ! Your name and today’s date ! Find the maximum Dim numbers(20) As Integer.
מחרוזות של תווים. מבוא לתכנות למנע"ס - שבוע מספר 5 - מאיר קומר - סמסטר ב' - תשס"ו מחרוזות - Strings Dim s As String s = “hello” s = s & “kita” או s =
If – Case Programs CSC Arwa © 2008.
סוגי מידע / משתנים ד " ר אבי רוזנפלד. סוגאורךטווח Boolean1 Bit0,1 Byte1 byte0-255 Char 2 bytes תו Decimal16 bytes0 through +/-79,228,162,514,264,337,593,543,950,335.
תרגילים. גדול, קטן, וממוצע מקובץ Imports System.IO Module Module1 Sub Main() Dim readnum As StreamReader readnum = _ My.Computer.FileSystem.OpenTextFileReader.
מבני בקרה מבוא לתכנות למנע " ס - שבוע מספר 3 - מאיר קומר - סמסטר ב ' - תשס " ו הסתעפות “ אם השמאל ואימנה ואם הימין ואשמאילה ”
פתרון תרגיל 10. שאלה #1 Module Module1 Sub Main() Dim maarach(9), zoogy(4), ezoogy(5) As Integer Dim i, counter, j As Integer For i = 0 To 9 Console.WriteLine("please.
פתרון תרגיל 11. שאלה #1 Module Module1 Sub Main() Dim x(10, 10) As Integer Dim i, j As Integer For i = 1 To 10 For j = 1 To 10 x(i, j) = i * j Console.Write("
מבני בקרה לולאות. פקודת CASE Module Module1 Sub Main() Dim input As Char input = Console.ReadLine() Select Case (input) Case "A" Console.WriteLine("A.
תרגיל #3 פתרונות. חלק א ' ה STRUCT Structure COURSES Dim semkors, semmarza As String Dim kodkors, mispartalmidim, zionminimali As Integer End Structure.
פתרון תרגילים #9. דוגמה פשוטה #1 Module Module1 Sub Main() Dim x As String x = Console.ReadLine For i = 1 To x.Length() - 1 Step 2 Console.WriteLine(x(i))
מערכים דו ממדי ו STRUCTS פונקציות בוליאנית Module Module1 Function Flip(ByVal word1 As String) As Boolean Dim i As Integer For i = 0 To word1.Length()
פונקציות. פונקציות מוכרות Imports System.Math Module Module1 Sub Main() Dim x As Decimal = Math.Abs(-10.4) Dim y As Decimal Console.WriteLine("I will.
الحلقات for For i =1 To x step -2 …………. Next DO while (شرط) …………. Loop DO …………. Loop while (شرط) الحلقة Do while.
Implementing Control Logic in C# Svetlin Nakov Telerik Corporation
1 INF110 Visual Basic Programming AUBG Spring semester 2011 Reference books: Schneider D., An Introduction to Programming Using Visual Basic, Prentice.
1. 2 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Decisions { class.
Microsoft Access Using Visual Basic Routines. Visual Basic Datatypes Boolean Byte Currency Date Double Integer Long Object Single String Variant Hyperlink.
Programming with C# Iteration LECTURE 3. Summary of last lecture SequenceSelectionif and switch statementsCastingRandom.
1 2.2 Selection Logical Operators. 2 Learning Objectives Explain how the logical operator AND Boolean statements works.
 2002 Prentice Hall. All rights reserved. 1 Chapter 4: Control Structures: Part 1 Outline 4.1 Introduction 4.2 Algorithms 4.3 Pseudocode 4.4 Control Structures.
26/10/ Selection Nested If structures & Complex Multiple Conditions.
27/05/ Iteration Loops Nested Loops & The Step Parameter.
Chapter 5: Control Structures: Iteration Visual Basic.NET Programming: From Problem Analysis to Program Design.
4.1 Introduction Structured programming –Control structures Helpful in building and manipulating objects BZUPAGES.COM.
Count and add list of numbers From user input and from file.
Adding 10 items to a list… lstTest.Items.Add(1) lstTest.Items.Add(2) lstTest.Items.Add(3) lstTest.Items.Add(4) lstTest.Items.Add(5) lstTest.Items.Add(6)
מבוא למדעי המחשב לתעשייה וניהול הרצאה 7. סברוטינות subroutines.
Introduction to Visual Basic Programming. Introduction Simple Program: Printing a Line of Text Another Simple Program: Adding Integers Memory Concepts.
Chapter 5: Control Structures: Iteration Visual Basic.NET Programming: From Problem Analysis to Program Design.
مسألة أكتب برنامجاً يقوم بقراءة عددين و إظهار رسالة تفيد بأن أحد العددين هو المضاعف النوني للعدد الآخر و في حال عدم كون أي من العددين مضاعفاً للآخر يظهر.
Method Parameters and Overloading Version 1.0. Topics The run-time stack Pass-by-value Pass-by-reference Method overloading Stub and driver methods.
מבוא למדעי המחשב לתעשייה וניהול הרצאה 12. ספריות.
5.1 Introduction Problem Solving –Requires understanding of: Building blocks Program-construction principles BZUPAGES.COM.
05/02/ Records. 205/02/2016 Learning Objectives State: The difference between records and arrays. The difference between records and arrays. How.
מבנה נתונים ואלגוריתמים ) לשעבר - עיבוד מידע( ד"ר אבי רוזנפלד ד"ר אריאלה ריכרדסון.
 2002 Prentice Hall. All rights reserved. 1 Chapter 5 – Control Structures: Part 2 Outline 5.1Introduction 5.2 Essentials of Counter-Controlled Repetition.
 2002 Prentice Hall. All rights reserved. 1 Chapter 4 – Control Structures Part 1 Outline Counter-Controlled Repetition: Example Sentinel-Controlled Repetition:
Mark Dixon 1 Soft051 Examination Sample Questions.
1 nd Semester Module6 Review Thanawin Rakthanmanon Create by: Aphirak Jansang Computer Engineering Department Kasetsart.
מבוא למדעי המחשב לתעשייה וניהול
Basics programming concepts-2
VB.Net Programming Console Application
Variables, Loops, Decision Statements, etc
C# Control Statements part 1 (Based on Deitel Book)
ניתוח מערכות מידע תכנות ב C#
מבוא למדעי המחשב לתעשייה וניהול
Exception Handling CSCI293 - C# October 3, 2005.
عرض اجمالي المهام الشرطية في سي شارب (الأمر if)
4.1 Strings ASCII & Processing Strings with the Functions
VB.Net Programming Console Application
VB.Net Programming Console Application
If selection construct
Do … Loop Until (condition is true)
Controlling Program Flow
2 types of scale factor problems
Module 3 Selection Structures 4/3/2019 CSE 1321 Module 3.
Intro to Programming Concepts
CSE Module 1 A Programming Primer
Lesson Objectives Aims Key Words
Var Name =Console . ReadLine();
Module 4 Loops and Repetition 4/15/2019 CSE 1321 Module 4.
CS1S467 GUI Programming LECTURE 14 Methods (1 of 2)
VB.Net Programming Console Application
Visual Programming Lecture 4.
Name of Pupil: Your Name Here
Repetition - Counting and Accumulating
Chapter 3 String manipulation.
Presentation transcript:

פתרון בוחן הכיתה

שאלה #1 Module Module1 Sub Main() Dim x, z As Integer x = Console.ReadLine() z = Console.ReadLine() If (x = 0) Then Console.WriteLine("Error") Else Console.WriteLine("Y is " & (40 * x * x * x - 4 * z * z) / (2 * x)) End If End Sub End Module

שאלה #2 Module Module1 Sub Main() Dim count As Integer = 0 Dim temp, i As Integer For i = 1 To 1000 temp = Console.ReadLine() If (temp Mod 10 = 0) Then count += 1 End If Next Console.WriteLine("There were " & count & " times ") End Sub End Module

שאלה #3 Module Module1 Sub Main() Dim i, j, width, height As Integer Console.WriteLine("Please enter height") height = Console.ReadLine() Console.WriteLine("Please enter width") width = Console.ReadLine() For i = 1 To height For j = 1 To width Console.Write("*") Next Console.WriteLine() Next End Sub End Module

שאלה #4 Module Module1 Sub Main() Dim count As Integer = 0 Dim temp As Integer = 1 While (temp > 0) temp = Console.ReadLine() If (temp > 50) Then count += 1 End If If (temp = 0) Then count -= 1 End If End While Console.WriteLine("The number is " & count) End Sub End Module