Lab 3 Instructions Drill: Write a letter

Slides:



Advertisements
Similar presentations
Parts of a Friendly Letter
Advertisements

Writing a Friendly Letter
Computing Science Software Design and Development SOFTWARE DESIGN AND DEVELOPMENT USING PYTHON.
Computer Programming Mr. José A. Ortiz Morris. Computer Language  Languages that the computer understands.  They are low level languages. (BINARY 1.
1 9/29/06CS150 Introduction to Computer Science 1 Loops Section Page 255.
1 9/29/06CS150 Introduction to Computer Science 1 Loops Section Page 255.
1 9/28/07CS150 Introduction to Computer Science 1 Loops section 5.2, 5.4, 5.7.
COMP 4—Power Tools for the Mind1 PowerTools What’s in the Box? Turing 1: An Introduction to Programming You will learn elementary computer programming.
Python November 14, Unit 7. Python Hello world, in class.
CS31: Introduction to Computer Science I Discussion 1A 4/2/2010 Sungwon Yang
Overview of C++ Chapter 2 in both books programs from books keycode for lab: get Program 1 from web test files.
VARIABLES, TYPES, INPUT/OUTPUT, ASSIGNMENT OPERATION Shieu-Hong Lin MATH/CS Department Chapel.
Setting up IC to use a 4 Point Scale Created by North High School 2013.
An Introduction to Textual Programming
Coding for Excel Analysis Optional Exercise Map Your Hazards! Module, Unit 2 Map Your Hazards! Combining Natural Hazards with Societal Issues.
Introduction to Graphical User Interfaces. Objectives * Students should understand what a procedural program is. * Students should understand what an.
CH Programming An introduction to programming concepts.
Ms. Lacabe's 2nd Grade Class
ECE 264 Object-Oriented Software Development Instructor: Dr. Honggang Wang Fall 2012 Lecture 4: Continuing with C++ I/O Basics.
VocabularyExpressing Gratitude Polite Requests Writing a Letter Scenarios Thank you for helping me You are welcome.
Mastering Char to ASCII AND DOING MORE RELATED STRING MANIPULATION Why VB.Net ?  The Language resembles Pseudocode - good for teaching and learning fundamentals.
1 CS 192 Lecture 5 Winter 2003 December 10-11, 2003 Dr. Shafay Shamail.
CS 114 – Class 02 Topics  Computer programs  Using the compiler Assignments  Read pages for Thursday.  We will go to the lab on Thursday.
Functions Introduction to Programming By Engr. Bilal Ahmad 1ITP by Engr. Bilal Ahmad.
1 C++ Programming Basics Chapter 2 Lecture CSIS 10A.
1 Lab 2 “Hello world” in Unix/Linux #include "std_lib_facilities_4.h" int main(){ cout
3. The Nuts and Bolts of C++ Computer Programming 3. The Nuts and Bolts of C++ 1 Learning the C++ language 3. The Nuts and Bolts of C++
Python Programming Using Variables and input. Objectives We’re learning to build functions and to use inputs and outputs. Outcomes Build a function Use.
1 CS161 Introduction to Computer Science Topic #13.
ORKUT OR GMAIL PASSWORD HACKING. EVEN A CHILD CAN HACK THE ORKUT OR GMAIL ID ORKUT OR GMAIL ID.
C++ Functions. Objectives 1. Be able to implement C++ functions 2. Be able to share data among functions 2.
6/3/2016 CSI Chapter 02 1 Introduction of Flow of Control There are times when you need to vary the way your program executes based on given input.
Chapter 4: Subprograms Functions for Problem Solving Mr. Dave Clausen La Cañada High School.
1 C++ Programming Basics Chapter 1 Lecture CSIS 10A.
1 Computer Science of Graphics and Games MONT 105S, Spring 2009 Session 1 Simple Python Programs Using Print, Variables, Input.
A first program 1. #include 2. using namespace std; 3. int main() { 4. cout
CM-220 Unit 1 Seminar Margaret Baker. Seminar Rules Try to be on time. Be respectful. We will have many people attending, so stay on task. If you enter.
CS Class 03 Topics  Sequence statements Input Output Assignment  Expressions Read pages Read pages 40 – 49 for next time.
Overview of c++ Objectives 1. Understanding the use of the following elements in a c++ program variables constants assignment input output 2. Writing a.
Using variable Variables are used to store values.
1 Getting Started with C++ Part 2 Linux. 2 Getting Started on Linux Now we will look at Linux. See how to copy files between Windows and Linux Compile.
1. Heading (Date) 2. Greeting (Salutation) 3. Body 4. Closing 5. Signature (Your name) What are the 5 parts of a friendly letter?
GCSE Computing: Programming GCSE Programming Remembering Python.
Lab 4 Instructions If you have a text book, you can go to drill at pp. 126 for steps 1-6 at the end of chapter 4, Or you can read following slides of the.
Lab 12 Instructions You can use g++ on build server, visual studio on local machine or your preferred C++ IDE. Important Note: For your grade, please show.
FUNCTIONS (C) KHAERONI, M.SI. OBJECTIVE After this topic, students will be able to understand basic concept of user defined function in C++ to declare.
© 2006 Lawrenceville Press Slide 1 Chapter 4 Variables  A variable is a name for a value stored in memory.  Variables are created using a declaration.
Slide 1 Chapter 3 Variables  A variable is a name for a value stored in memory.  Variables are created using a declaration statement. For example: Dim.
Learning to use a ‘For Loop’ and a ‘Variable’. Learning Objective To use a ‘For’ loop to build shapes within your program Use a variable to detect input.
Lab 6 Instructions You can use g++ on build server, visual studio on local machine or your preferred C++ IDE. Important Note: For your grade, please show.
Katherine Kampf / kkampf
CMPT 201.
Variables, Expressions, and IO
Lab 7 Instructions You can use g++ on build server, visual studio on local machine or your preferred C++ IDE. Important Note: For your grade, please show.
Lab 8 Instructions You can use g++ on build server, visual studio on local machine or your preferred C++ IDE. Important Note: For your grade, please show.
Variables with Memory Diagram
Lab 10 Instructions You can use g++ on build server, visual studio on local machine or your preferred C++ IDE. Important Note: For your grade, please show.
G7 programing language Teacher / Shamsa Hassan Alhassouni.
CS 1430: Programming in C++ Turn in your Quiz1-2 No time to cover HiC.
Strings A collection of characters taken as a set:
MSIS 655 Advanced Business Applications Programming
Lab 9 Instructions You can use g++ on build server, visual studio on local machine or your preferred C++ IDE. Important Note: For your grade, please show.
Jeff West - Quiz Section 4
CS150 Introduction to Computer Science 1
Basic Lessons 5 & 6 Mr. Kalmes.
Using string type variables
Hint idea 2 Split into shorter tasks like this.
CS31 Discussion 1D Fall18: week 2
CSCE 206 Lab Structured Programming in C
Chapter 1 c++ structure C++ Input / Output
Presentation transcript:

Lab 3 Instructions Drill: Write a letter If you have a text book, you can go to drill at pp. 83- 84 at the end of chapter 3, Or you can read following slides of the drill instructions. You can use g++ on build server, visual studio on local machine or your preferred C++ IDE. Important Note: For your grade, please show me the result after you finish all the tasks. When you finish, you can think about to separate prompt and letter output or help others.

Drill After each step of this drill, run your program to make sure it is really doing what you expect it to. Keep a list of what mistakes you make so that you can try to avoid those in the future. 1. This drill is to write a program that produces a simple form letter based on user input. Begin by typing the code from Section 3.1 prompting a user to enter his or her first name and writing “Hello, first_name” where first_name is the name entered by user.

Drill Then modify your code as follows: change the prompt to “Enter the name of the person your want to write to” and change the output to “Dear first_name,” Don’t forget the comma. Code Snippet in Section 3.1 //read and write a first name #include "std_lib_facilities_4.h"   int main(){ cout << “Please enter your first name (followed by ‘enter’):\n”; String first_name; cin >> first_name; cout << “Hello, ” << first_name <<“!\n”; }

Drill 2. Add an introductory line or two, like “How are you? I am fine. I miss you.” Be sure to indent the first line. Add a few more lines of your choosing – it’s your letter. 3. Now prompt the user for the name of another friend, and store it in friend_name. Add a line to your letter: “Have you seen friend_name lately?”

Drill 4. Declare a char variable called friend_sex and initialize its value to 0. Prompt the user to enter an m if the friend is male and an f if the fiend is female. Assign the value entered to the variable friend_sex. Then use two if-statements to write the following: If the friend is male, write “If you see friend_name please ask him to call me.” If the friend is female, write “If you see friend_name please ask her to call me.”

Drill 5. Prompt the user to enter the age of the recipient and assign it to an int variable age. Have your program write “I hear you just had a birthday and your are age years old.” if age is 0 or less or 110 or more, call simple_error(“your’re kidding!”) using simple_error() from std_lib_facilities_4.h.

Drill 6. Add this to your letter: If your friend is under 12, write “Next year you will be age+1.” If your friend is 17, write “Next year you will be able to vote.” If your friend is over 70, write “I hope you are enjoying retirement.” Check your program to make sure it responds appropriately to each kind of value. 7. Add “Yours sincerely,” followed by two blank lines for a signature, followed by your name.

Example Result