Unit 5 Lesson 6: User Input and Strings

Slides:



Advertisements
Similar presentations
SPIM and MIPS programming
Advertisements

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.
Functional Design and Programming Lecture 1: Functional modeling, design and programming.
Lecture 5 Strings and more I/O COMP1681 / SE15 Introduction to Programming.
8 November Forms and JavaScript. Types of Inputs Radio Buttons (select one of a list) Checkbox (select as many as wanted) Text inputs (user types text)
Elementary Data Types Scalar Data Types Numerical Data Types Other
Principles of Procedural Programming
String Escape Sequences
Manipulating Strings.
© The McGraw-Hill Companies, 2006 Chapter 1 The first step.
Programming Languages
Week 4 Number Systems.
A Level Computing#BristolMet Session Objectives U2#S6 MUST identify different data types used in programming aka variable types SHOULD describe each data.
Input & Output: Console
A Level Computing#BristolMet Session ObjectivesU2#S10 MUST describe the difference between constants, local and global variables SHOULD explain why constants.
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.
Objective At the conclusion of this chapter you will be able to:
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.
WMBA 6080Technology Guide 1 1 Computer Hardware. WMBA 6080Technology Guide 12 Hardware: The Basics Central processing unit (CPU) manipulates the data.
1 STRINGS String data type Basic operations on strings String functions String procedures.
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.
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.
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
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.
Operating Systems A Biswas, Dept. of Information Technology.
Introduction to Python Lesson 2a Print and Types.
JavaScript Part 1 Introduction to scripting The ‘alert’ function.
Nat 4/5 Computing Science Data Representation Lesson 3: Storing Text
Text and Images Key Revision Points.
Vocabulary Prototype: A preliminary sketch of an idea or model for something new. It’s the original drawing from which something real might be built or.
Chapter 6 JavaScript: Introduction to Scripting
FOP: User Input & Strings
Input and Output Upsorn Praphamontripong CS 1110
Unit 5 Lesson 3: Introduction to Arrays
Chapter 6: Data Types Lectures # 10.
Learning Intention Learning Intention: To develop understanding of variables, data types, and comments in text based programming languages Context: Sequencing.
Containers and Lists CIS 40 – Introduction to Programming in Python
Microprocessor Systems Design I
Documentation Need to have documentation in all programs
Computing Fundamentals
Lesson 16: Functions with Return Values
Lesson 6: User Input and Strings
LESSON 13 – INTRO TO ARRAYS
Lesson 2: Input and Variables
Format String.
Introduction to Computer Systems
Von Neumann model - Memory
Coding Concepts (Data- Types)
Digital Encodings.
High Level Programming Languages
Data Structure and Algorithms
Starter Load up One Note
Introduction to 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.
Spreadsheets, Modelling & Databases
Introduction to Computer Systems
Chapter 1 Problem Solving with C++
Chapter 17 Looking “Under the Hood”
Chapter 2 part #1 C++ Program Structure
ASCII and Unicode.
Inputs, Outputs and Assignment
Presentation transcript:

Unit 5 Lesson 6: User Input and Strings CS Principles

Unit 5 Lesson 6: User Input and Strings Objectives Students will be able to: Identify strings as a unique data type which contains a sequence of ASCII characters. Describe characteristics of the string data type. Accept string input in a program. Manipulate user-generated string input to generate dynamic output

User Input and Strings 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. While “typed” programming languages require you to declare the size and type of a variable before you use them, in more dynamic programming languages, including JavaScript, this memory management is abstracted away.

U5L6 Vocab 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!").

Mad Libs Activity Guide Decide what the theme of your Mad Libs app will be, what text they 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 students quickly conceive of ideas. There should be at least 3 steps in their instructions. Their app should accept at least 3 pieces of user input. Before moving into the rest of Code Studio, students should have a rough outline of their project.