Lesson 6: User Input and Strings

Slides:



Advertisements
Similar presentations
JavaScript I. JavaScript is an object oriented programming language used to add interactivity to web pages. Different from Java, even though bears some.
Advertisements

SPIM and MIPS programming
Introduction to PHP MIS 3501, Fall 2014 Jeremy Shafer
Some computer fundamentals and jargon Memory: Basic element is a bit – value = 0 or 1 Collection of “n” bits is a “byte” Collection of several bytes is.
Data Compressor---Huffman Encoding and Decoding. Huffman Encoding Compression Typically, in files and messages, Each character requires 1 byte or 8 bits.
Lecture 5 Strings and more I/O COMP1681 / SE15 Introduction to Programming.
1 Lecture-2 CS-120 Fall 2000 Revision of Lecture-1 Introducing Computer Architecture The FOUR Main Elements Fetch-Execute Cycle A Look Under the Hood.
Introduction to Python
String Escape Sequences
Manipulating Strings.
Group practice in problem design and problem solving
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming 1.
Input & Output: Console
Mastering Char to ASCII AND DOING MORE RELATED STRING MANIPULATION Why VB.Net ?  The Language resembles Pseudocode - good for teaching and learning fundamentals.
Section 2 Variables National 4/5 Scratch Course. What you should know after this lesson What a variable is Where variables are stored How to get data.
Manipulating Text In today’s lesson we will look at: why we might want to pick out parts of text strings some BASIC functions that can be used to chop.
Fundamental Programming: Fundamental Programming K.Chinnasarn, Ph.D.
Copyright © 2010 Certification Partners, LLC -- All Rights Reserved Perl Specialist.
Bioinformatics Introduction to Perl. Introduction What is Perl Basic concepts in Perl syntax: – variables, strings, – Use of strict (explicit variables)
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.
Strings in MIPS. Chapter 2 — Instructions: Language of the Computer — 2 Character Data Byte-encoded character sets – ASCII: 128 characters 95 graphic,
WMBA 6080Technology Guide 1 1 Computer Hardware. WMBA 6080Technology Guide 12 Hardware: The Basics Central processing unit (CPU) manipulates the data.
Copyright © 2003 ProsoftTraining. All rights reserved. Perl Fundamentals.
1 STRINGS String data type Basic operations on strings String functions String procedures.
Introduction to Python Dr. José M. Reyes Álamo. 2 Three Rules of Programming Rule 1: Think before you program Rule 2: A program is a human-readable set.
Programming Fundamentals. Overview of Previous Lecture Phases of C++ Environment Program statement Vs Preprocessor directive Whitespaces Comments.
SM2220 – Class 06 Finite Automata. SM2220 – Class 06 Topic in theoretical computing. A subset of computation machines. Closely related to formal language.
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.
Basic Computer Organization Rashedul Hasan.. Five basic operation No matter what shape, size, cost and speed of computer we are talking about, all computer.
Sudeshna Sarkar, IIT Kharagpur 1 Programming and Data Structure Sudeshna Sarkar Lecture 3.
Program Design. Simple Program Design, Fourth Edition Chapter 1 2 Objectives In this chapter you will be able to: Describe the steps in the program development.
C++ Programming: From Problem Analysis to Program Design, Fifth Edition Chapter 1: An Overview of Computers and Programming Languages.
Getting Started With Python Brendan Routledge
Chapter 1 slides1 What is C? A high-level language that is extremely useful for engineering computations. A computer language that has endured for almost.
JavaScript Part 1 Introduction to scripting The ‘alert’ function.
More about comments Review Single Line Comments The # sign is for comments. A comment is a line of text that Python won’t try to run as code. Its just.
FOP: User Input & Strings
UNIT 2 – CHAPTER 1 – LESSON 1 DIGITAL INFORMATION.
Unit 5 Lesson 6: User Input and Strings
1-1 Logic and Syntax A computer program is a solution to a problem.
Learning Intention Learning Intention: To develop understanding of variables, data types, and comments in text based programming languages Context: Sequencing.
Lesson 1 An Introduction
Computing Fundamentals
GC211Data Structure Lecture2 Sara Alhajjam.
Beginning C++ Programming
UNIT 3 – LESSON 5 Creating Functions.
Exam 3 Review.
Computer Engineering 1nd Semester
Section 3.2c Strings and Method Signatures
Lesson 1: Buttons and Events – 12/18
Building an App: Multi-Screen App
Lesson 4: Controlling Memory with Variables
Introduction to CS Your First C Programs
Guide To UNIX Using Linux Third Edition
Lesson 17: Building an App: Canvas Painter
Lesson 16: Functions with Return Values
LESSON 13 – INTRO TO ARRAYS
Manipulating Text In today’s lesson we will look at:
Lesson 2: Input and Variables
Format String.
Looping and Random Numbers
Coding Concepts (Data- Types)
Digital Encodings.
Programming Fundamentals Lecture #3 Overview of Computer Programming
Language Constructs Construct means to build or put together. Language constructs refers to those parts which make up a high level programming language.
Basic Computer Organization
Primary School Computing
ASCII and Unicode.
Introduction to scripting
Presentation transcript:

Lesson 6: User Input and Strings UNIT 5 – LESSON 6

VOCABULARY ALERT: Concatenate - to link together or join. Typically used when joining together text Strings in programming (e.g. "Hello, "+name) String - Any sequence of characters between quotation marks (ex: "hello", "42", "this is a string!").

PURPOSE: you are introduced to the string data type as a way of representing arbitrary sequences of ASCII characters. You will use strings to accept input from a user as you work on mastering two new UI elements, the text input and the text area. Students combine these skills to develop a simple Mad Libs® app.

Strings are a feature of essentially every programming language, and they allow for variable-length pieces of text to be represented, stored, and manipulated. While a single string can be stored in a variable, it is worth noting that a string will typically use much more memory than a number. Numbers are typically stored in fixed-width 8-, 16-, 32-, or 64-bit chunks. ASCII characters require a single byte and so a string of 100 characters, short by most standards, would require 800 bits in order to be stored in memory. 

Begin the lesson by moving to the first activity in Code Studio where you will use a Mad Libs app. Over the course of this lesson you will develop skills that will allow you to build your own Mad Libs app by accepting user input as strings. Note: After you move to Code Studio, you should complete the Activity Guide before continuing.

Distribute: the Activity Guide - Mad Libs - Activity Guide Distribute: the Activity Guide - Mad Libs - Activity Guide. You should use this opportunity to decide on what the theme of your Mad Libs app will be, what text you will accept into your app, and how it will be incorporated into its output.

The primary guidelines of the project (also included in the Activity Guide) are: The app should be a “how-to” Mad Libs (e.g., “How to take care of your pet ostrich”). Afterwards, you list steps with key components left open for user input. This is primarily to help you quickly conceive of ideas. There should be at least 3 steps in your instructions. Your app should accept at least 3 pieces of user input. Before moving into the rest of Code Studio, you should have a rough outline of your project. Once you have completed your outlines, you should return to Code Studio.

Go into Code Studio and make your Mad Libs Go into Code Studio and make your Mad Libs! To turn in: Have me watch it, and turn in the Activity Guide with your plan for credit.