Mastering Char to ASCII AND DOING MORE RELATED STRING MANIPULATION Why VB.Net ?  The Language resembles Pseudocode - good for teaching and learning fundamentals.

Slides:



Advertisements
Similar presentations
The Software Lifecycle. Example Problem: Update a Checkbook Write a program that allows the user to enter a starting balance, a transaction type, D or.
Advertisements

ABNIAC The following slide presentation is to acquaint the student with ABNIAC. The version used for presentation is the Java version, which can be found.
Hand Crafting your own program By Eric Davis for CS103.
Mathematical Operators  2000 Prentice Hall, Inc. All rights reserved. Modified for use with this course. Introduction to Computers and Programming in.
Algorithms. Introduction Before writing a program: –Have a thorough understanding of the problem –Carefully plan an approach for solving it While writing.
1 Lab Session-III CSIT-120 Spring 2001 Revising Previous session Data input and output While loop Exercise Limits and Bounds GOTO SLIDE 13 Lab session.
Lesson 2 0x Coding ASCII Code.
. If the PHP server is an server or is aware of which server is the server, then one can write code that s information. –For example,
Input/Output  Input/Output operations are performed using input/output functions  Common input/output functions are provided as part of C’s standard.
PHP : Hypertext Preprocessor
Chapter 4: The Selection Structure
A453 Exemplar Password Program using VBA
A Level Computing#BristolMet Session ObjectivesU2#S10 MUST describe the difference between constants, local and global variables SHOULD explain why constants.
A little PHP. Enter the simple HTML code seen below.
07/10/ Strings ASCII& Processing Strings with the Functions - Locate (Instr), Mid, Length (Len), Char (ChrW) & ASCII (Asc)
Lec 3: Data Representation Computer Organization & Assembly Language Programming.
The char Data Type A char is a one byte integer type typically used for storing characters. Example: char oneLetter = ’D’; We enclose the character in.
Java Data Types. Primitive Data Types Java has 8 primitive data types: – char: used to store a single character eg. G – boolean: used to store true or.
CS 114 – Class 02 Topics  Computer programs  Using the compiler Assignments  Read pages for Thursday.  We will go to the lab on Thursday.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 5 – Dental Payment Application: Introducing.
19/10/20151 Data Structures Arrays. 219/10/2015 Learning Objectives Explain initialising arrays and reading data into arrays. Design and write routine/s.
1 Κατανεμημένες Διαδικτυακές Εφαρμογές Πολυμέσων Γιάννης Πετράκης.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Scratch Programming Lesson 4 Question asking and answering.
Lesson 6. Python 3.3 Objectives. In this lesson students will learn how to output data to the screen and request input from the user. Students will also.
C++ Basics C++ is a high-level, general purpose, object-oriented programming language.
Writing JavaScript Functions. Goals By the end of this unit, you should understand … How to breakdown applications into individual, re-usable modules.
22/11/ Selection If selection construct.
Variables, Input, and Output. Challenge: ● Ask the user his or her name, and repeat that name to the user ● Pause video and try.
Programming Fundamentals. Summary of previous lectures Programming Language Phases of C++ Environment Variables and Data Types.
C++ for Engineers and Scientists Second Edition Chapter 7 Completing the Basics.
Chapter 9: Completing the Basics. In this chapter, you will learn about: – Exception handling – Exceptions and file checking – The string class – Character.
More Sequences. Review: String Sequences  Strings are sequences of characters so we can: Use an index to refer to an individual character: Use slices.
CHAPTER 2 PROBLEM SOLVING USING C++ 1 C++ Programming PEG200/Saidatul Rahah.
31/01/ Selection If selection construct.
An Introduction to Programming with C++ Sixth Edition Chapter 13 Strings.
Python Lesson 1 1. Starter Create the following Excel spreadsheet and complete the calculations using formulae: 2 Add A1 and B1 A2 minus B2 A3 times B3.
1 Project 3 String Methods. Project 3: String Methods Write a program to do the following string manipulations: Prompt the user to enter a phrase and.
A Level Computing#BristolMet Session Objectives#U2S11 MUST identify built-in string manipulation functions SHOULD correctly use string manipulation functions.
Visual Basic Declaring Variables Dim x as Integer = 0 In the statement above, x is being declared as an Integer (whole number) and is initialised.
A little PHP. Enter the simple HTML code seen below.
Input, Output and Variables GCSE Computer Science – Python.
A little PHP.
A451 Theory – 7 Programming 7A, B - Algorithms.
IGCSE 4 Cambridge Data types and arrays Computer Science Section 2
2.5 Another Java Application: Adding Integers
Little work is accurate
Input/Output Input/Output operations are performed using input/output functions Common input/output functions are provided as part of C’s standard input/output.
IDENTIFIERS CSC 111.
Use proper case (ie Caps for the beginnings of words)
Introduction to C++ Programming
Programming Funamental slides
For -G7 programing language Teacher / Shamsa Hassan Alhassouni.
1) C program development 2) Selection structure
Format String.
4.1 Strings ASCII & Processing Strings with the Functions
Class Examples.
Coding Concepts (Data- Types)
Conversion Check your class notes and given examples at class.
Software Development Process
Language Constructs Construct means to build or put together. Language constructs refers to those parts which make up a high level programming language.
Programming Concepts and Database
7 – Variables, Input and Output
Strings CSE 1310 – Introduction to Computers and Programming
JavaScript: Introduction to Scripting
Data Types Every variable has a given data type. The most common data types are: String - Text made up of numbers, letters and characters. Integer - Whole.
Data Types and Maths Programming Guides.
An Introduction to Programming
Challenge Guide Grade Code Type Slides
Presentation transcript:

Mastering Char to ASCII AND DOING MORE RELATED STRING MANIPULATION Why VB.Net ?  The Language resembles Pseudocode - good for teaching and learning fundamentals of programming

*Each character on your keyboard has an ASCII code. Capital "A" = 65 "a" = 97 = 64 And so on … (see Ascii table on Slide 5)

Create a Program that converts a char to ASCII Task 1

Design this interface Task 2

Add this code to make it work

Task 3 Design this interface

Add this code to make it work Question 1: What will the output here be? Question 1: There is one small mistake – how can you correct this? Question 1: What will the output here be? Question 1: There is one small mistake – how can you correct this?

The code outputs each letter (at a time) in the word that is input into the text box Adding this would solve the problem.

Write a program that: 1.Asks a user for a letter grade. 2.Validates this input. (i.e. if the user puts in an invalid character like an or a “#” it would output an error message, else accept the input. Challenge #1 *This requires you to have an understanding of ASCII codes Follow on: See Challenge 4

ASCII CHART: Note that characters like ! And # etc are between Decimal Numbers 32 – 64 and also

Screenshot your solution

One way of developing the solution …. *This is not an ideal solution – although you could develop it and get it to work

Another [Partial] Answer This code involves declaring a variable for converting to Ascii, and storing an integer (value) in it, corresponding to the character input by the user. It also checks to see whether the ASCII value is above 64, and if it is NOT (i.e. it is below 64) - an error message is returned. What needs to be changed / Added? This code involves declaring a variable for converting to Ascii, and storing an integer (value) in it, corresponding to the character input by the user. It also checks to see whether the ASCII value is above 64, and if it is NOT (i.e. it is below 64) - an error message is returned. What needs to be changed / Added?

Write a program that: 1.Asks the user to enter a username in the format: yearofbirth(xxxxFirstname, e.g. 1983Joey 2.Write code to extract the first four characters (the year) and output it in the format: “You were born in the year: xxxx” Challenge #2

Write a program that: 1.Asks the user to enter a word 2.Extracts all the vowels in the word (if any) 3.Concatenates all the vowels together to form a new stringofcharacters e.g. Input: APPLE Output: AE 4. Extra challenge: Create a new word in the format: First character & Mid Character & Last Character Challenge #3

Write a program that: 1.Asks the user for an address 2.If the characters before the sign are NOT alphanumeric, to return an error message. Challenge #4 *This requires you to have an understanding of ASCII codes (See Challenge 1 – this is a follow on) INVALID CHARACTER is present before the sign