3 4 5 resultTextBlock.Text = result.ToString();

Slides:



Advertisements
Similar presentations
Procedural Programming in C# Chapters Objectives You will be able to: Describe the most important data types available in C#. Read numeric values.
Advertisements

CS 206 Introduction to Computer Science II 09 / 05 / 2008 Instructor: Michael Eckmann.
Class Scope class Student { private: string id; string firstName, lastName; float gpa; public: void Read() { cin >> id >> firstName >> lastName >> gpa;
C++ Basics Variables, Identifiers, Assignments, Input/Output.
Objective: Dealing with data in C++ Agenda: Notes Essay Help.
Searching Kruse and Ryba Ch and 9.6. Problem: Search We are given a list of records. Each record has an associated key. Give efficient algorithm.
$100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300.
Crossword Puzzle Solver Michael Keefe. Solver structure.
Functions Parameters & Variable Scope Chapter 6. 2 Overview  Using Function Arguments and Parameters  Differences between Value Parameters and Reference.
COMPUTER PROGRAMMING. Data Types “Hello world” program Does it do a useful work? Writing several lines of code. Compiling the program. Executing the program.
1 Identifiers  Identifiers are the words a programmer uses in a program  An identifier can be made up of letters, digits, the underscore character (
Timers in Unreal By Todd Brown. Setting up a timer Add ‘simulated function Timer()’ to your class Within this function, put the code for whatever you.
4 Add your text in here Content 03Content 02Content 01 Description of the contents ThemeGallery is a Design Digital Content & Contents mall developed.
HEADLINE TEXT HERE Click here to add text. Click here to add text. Click here to add text. Click here to add text. Click here to add text. Click here to.
Instructor: Chris Trenkov Hands-on Course Python for Absolute Beginners (Spring 2015) Class #005 (April somthin, 2015)
5 BASIC CONCEPTS OF ANY PROGRAMMING LANGUAGE Let’s get started …
Required Functions for Program 3 int readUntilValidBaseRead( ); int readNumbersReturningValue( int base ); int decimalValueOf( char chDigit ); bool isValid(
Pointers OVERVIEW.
Quizard step-by-step. Start with the questions The Question class is abstract –a Superclass You’ll never create something that’s just a question. It’ll.
CSC 107 – Programming For Science. Today’s Goal  Discuss writing functions that return values  return statement’s meaning and how it works  When and.
Two Forms Please use speaker notes for additional information!
Exercise 2 Introduction to C# CIS Create a class called Employee that contains the following private instance variables: Social Securitystring.
3 4 private void saveButton_Click(object sender, RoutedEventArgs e) { saveText("jot.txt", jotTextBox.Text); }
LINKED LIST’S EXAMPLES Salim Malakouti. Linked List? 523 Pointer Node ValuePointer.
private void Application_Launching(object sender, LaunchingEventArgs e) { } private void Application_Activated(object.
CS 1430: Programming in C++ 1. Class StudentList class StudentList { private: int numStudents; Student students[MAX_SIZE]; int find(const Student& s)
C:\Temp\Templates 4 5 Use This Main Program 6.
private void page2Button_Click(object sender, RoutedEventArgs e) { NavigationService.Navigate(new Uri("/PageTwo.xaml", UriKind.RelativeOrAbsolute));
Int fact (int n) { If (n == 0) return 1; else return n * fact (n – 1); } 5 void main () { Int Sum; : Sum = fact (5); : } Factorial Program Using Recursion.
Module 5: I/O and Strings #1 2000/01Scientific Computing in OOCourse code 3C59 Module 5: I/O and STRINGS In this module we will cover The C++ input and.
Test1 Here some text. Text 2 More text.
CIS3931 – Intro to JAVA Lecture Note Set 2 17-May-05.
Java Programming by Ramiro Rocha.
Lecture No.03 Data Structures Dr. Sohail Aslam
Algorithm for deleting a node from a singly linked list
Delete text and place photo here.
Insert Presentation Title Here Insert Presentation Summary Here
[0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]
null, true, and false are also reserved.
Cs212: Data Structures Computer Science Department Lab 7: Stacks.
BUTTERFLY EFFECT DIAGRAM
searching Concept: Linear search Binary search
اصول کامپیوتر ۱ مبانی کامپیوتر و برنامه‌سازی
18.5 Linked Queues Like a stack, a queue can be implemented using pointers and nodes Allows dynamic sizing, avoids issue of wrapping indices NULL front.
[type text here] [type text here] [type text here] [type text here]
2016 BUSINESS REPORT START.
Your text here Your text here Your text here Your text here Your text here Pooky.Pandas.
Control structures Chapter 3.
COMPUTER 2430 Object Oriented Programming and Data Structures I
Your Text Your Text Your Text Your Text Your Text Your Text
Recap Week 2 and 3.
Your text here Your text here Your text here Your text here
Control structures Chapter 3.
[type text here] [type text here] [type text here] [type text here]
Delete text and place photo here.
Nate Brunelle Today: Conditional Decision Statements
STEP ONE. STEP ONE. STEP ONE. STEP ONE. STEP ONE. 02
Control structures Chapter 3.
Hi, there.
YOUR text YOUR text YOUR text YOUR text
Insert Presentation Title Here Insert Presentation Summary Here
Type your presentation title here
Please insert Title Please insert sub-title 1
Class StudentList class StudentList { private: int numStudents;
Main Title Here Topic 2 Topic 3 Topic 4 Topic 5
If there is any case in which true premises lead to a false conclusion, the argument is invalid. Therefore this argument is INVALID.
What does this code do? def digitsum(): code goes here def diffsum():
If there is any case in which true premises lead to a false conclusion, the argument is invalid. Therefore this argument is INVALID.
Click here to add your title
Presentation transcript:

3

4

5 resultTextBlock.Text = result.ToString();

6

7 float v1 = float.Parse(firstNumberTextBox.Text);

8 float v1 = 0; if (!int.TryParse(firstNumberTextBox.Text, out v1)) { // Invalid text in textbox }

9

10 float v1 = 0; if (!float.TryParse(firstNumberTextBox.Text, out v1)) { firstNumberTextBox.Foreground = new SolidColorBrush(Colors.Red); return; }

11 float v1 = 0; if (!float.TryParse(firstNumberTextBox.Text, out v1)) { firstNumberTextBox.Foreground = new SolidColorBrush(Colors.Red); return; }

12

13 private SolidColorBrush errorBrush = new SolidColorBrush(Colors.Red); private Brush correctBrush = null;

14 private void calculateResult() { bool errorFound = false; if (correctBrush == null) correctBrush = firstNumberTextBox.Foreground; // Rest of method goes here }

15 private void calculateResult() { // Sort out brushes if (!float.TryParse(firstNumberTextBox.Text, out v1)) { firstNumberTextBox.Foreground = errorBrush; errorFound = true; } else { firstNumberTextBox.Foreground = correctBrush; } }

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32 72

33

34 // Make a new input scope InputScope digitScope = new InputScope(); // Make a new input scope name InputScopeName digits = new InputScopeName(); // Set the new name to Digits digits.NameValue = InputScopeNameValue.Digits; // Add the name to the new scope digitScope.Names.Add(digits); // Set the scope of the textbox to the new scope firstNumberTextBox.InputScope = digitScope;

35

36

37 MessageBox.Show("Invalid Input" + System.Environment.NewLine + "Please re-enter");

38 if (MessageBox.Show("Do you really want to do this?", "Scary Thing", MessageBoxButton.OKCancel) == MessageBoxResult.OK) { // do scary thing here } else { // do something else }

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57