1 Session-5 CSIT 121 Spring 2006 Part D due now String Rules Chapter 2 Topics Lab Demo Exercise Assignment.

Slides:



Advertisements
Similar presentations
VARIABLES AND DEBUGGING Beginning Programming. Assignment Statements  Used to hold values in a variable  Calculates a result and stores it in a variable.
Advertisements

Lecture 4 Structure plan Program design process Program design process Basic elements of code: Basic elements of code: –Input (assignment of variables)
1 Session-17 CSIT 121 Spring 2006 Loops: Conditional and Count Controlled Loops: Conditional and Count Controlled LCV: Initialize; Test and Update LCV:
1 *Copyright © 2002 Pearson Education, Inc.. 2 Web Wizard’s Guide to CGI/Perl David Lash Chapter 3 Perl Basics.
1 Session-12 CSIT 121 Spring 2006 Test-1 is on March 9 th ; Demo-5 due date extended to March 7 Test-1 is on March 9 th ; Demo-5 due date extended to March.
1 Session-16 CSIT 121 Spring 2006 Demo for switch-case due now Demo for switch-case due now String comparison String comparison Slide 23; sample case.
1 Lab Session-II CSIT 121 Fall 2000 Visual Studio Introduction Lab-1 Explanation and Demos Debugging Tips How to add new files to your projects How many.
Computer Science-I (CSIT121) Dr. Junaid Ahmed Zubairi SUNY Fredonia Room 210, Fenton X-4694,
1 Lab-1 CSIT-121 Spring 2005 Lab Targets Solving problems on computer Programming in C++ Writing and Running Programs Programming Exercise.
1 Lab 2 CSIT-120 Spring 2001 Session II-A (Feb 13th) Operations on Data Lab Exercise 2-A Data Types Variables Lab Exercise 2-B Session II-B (Feb 20th)
1 Session-I & II CSIT-121 Spring 2006 Session Targets Introducing the VC++.NET Solving problems on computer Programming in C++ Writing and Running Programs.
1 Lab Session-3 CSIT221 Spring 2003 b Group Worksheet 3 Exercise (Demo Required) b No new lab demo will be assigned to allow you to focus on HW#1.
1 Session-7 CSIT 121 Spring 2006 Lab Demo of NiMo Lesson 3-2 Exercises 1,2,3,4,5,6 (Arithmetic Operators with Program ‘Convert.cpp’) Q&A about operators.
1 Session-14 CSIT 121 Spring 2006 Demo due today; demo hint was sent to your campus accounts Demo due today; demo hint was sent to your campus .
1 Lab Session-2 CSIT 121 Spring 2005 Debugging Tips NiMo’s Varying Rates Lab-2 Exercise.
1 Spring 2007 CSCI 660 CSCI-660 Project Title Project team members’ names.
CIS101 Introduction to Computing Week 11. Agenda Your questions Copy and Paste Assignment Practice Test JavaScript: Functions and Selection Lesson 06,
1 Session-11 CSIT 121 Spring 2006 Test-1 is on March 9 th ; Demo-4 due Now Chapter 4 topics –Using get and ignore to control input data (3-19) –Prompting.
Topic R3 – Review for the Final Exam. CISC 105 – Review for the Final Exam Exam Date & Time and Exam Format The final exam is 120-minutes, closed- book,
1 Lab Session-3 CSIT 121 Fall 2004 Section-3 should finish Lab-1 Exercise first Division rules Operator precedence rules Lab Exercise.
1 Lab Session-V CSIT-120 Fall 2000 Menu Driven Software Lab Exercise While and do-while statements Lab-V Continues: The if statement Logical Operators.
1 Lab Session-3 CSIT 121 Spring’05 Division rules Operator precedence rules Lab Exercise.
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.
1 Session-9 CSIT 121 Spring 2006 Lab Demo (first 20 minutes) The correct way to do the previous lab sheet Function calls Calling void functions Calling.
1 Session-13 CSIT 121 Spring 2006 Test-1 is on March 9 th ; Demo-5 due date extended to March 7 Test-1 is on March 9 th ; Demo-5 due date extended to.
1 Lab 2 CSIT-120 Fall 2000 Session II-A (September 14th) Operations on Data Lab Exercise 2-A Data Types Variables Lab Exercise 2-B Session II-B (September.
CS1101: Programming Methodology Aaron Tan.
1 Lab Session-III CSIT-120 Fall 2000 Revising Previous session Data input and output While loop Exercise Limits and Bounds Session III-B (starts on slide.
Lesson 1: Introduction to ABAP OBJECTS Todd A. Boyle, Ph.D. St. Francis Xavier University.
Chapter 31 The Cost of Credit. Interest Calculations - Determining Factors  Interest Rates – The percentage that is applied to your debt expressed as.
General Programming Introduction to Computing Science and Programming I.
A Level Computing#BristolMet Session ObjectivesU2#S10 MUST describe the difference between constants, local and global variables SHOULD explain why constants.
0 eCPIC Admin Training: Custom Calculated Fields These training materials are owned by the Federal Government. They can be used or modified only by FESCOM.
The Web Wizard’s Guide To JavaScript Chapter 6 Working with Dates and Times.
How to Work with Numeric and String Data
1 Lab Session-8 CSIT-121 Spring 2005 Call by Reference Lab Exercise for Demo Practice Problems.
Introduction to MATLAB 7 Engineering 161 Engineering Practices II Joe Mixsell Spring 2010.
Computer Science: A Structured Programming Approach Using C1 2-7 Input/Output Although our programs have implicitly shown how to print messages, we have.
Data Types and Variables. Data Type! Computers are all about Data! Data can be in the form of Text Dates Sounds Pictures.
Computer Science: A Structured Programming Approach Using C1 2-7 Input/Output Although our programs have implicitly shown how to print messages, we have.
Introduction to MATLAB 7 Engineering 161 Engineering Practices II Joe Mixsell Spring 2012.
1 Lecture 4 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
Chapter 3 Numerical Data. Objectives After you have read and studied this chapter, you should be able to Select proper types for numerical data. Write.
1 Lab Session-IV CSIT121 Spring 2002 Some Questions Scope of Variables Top Down Design Problem The Solution Lab Exercises Lab Exercise for Demo.
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.
CSC 480 Software Engineering PSP Project 2 August 27, 2004.
1 Project 2: Sorting Cats. Write a C++ console application to read a text file containing information about cats and output the information to the screen.
1 Project 7: Looping. Project 7 For this project you will produce two Java programs. The requirements for each program will be described separately on.
1 Project 5: Leap Years. 222 Leap Years Write a program that reads an integer value from the user representing a year and determines if the year is a.
1 Project 4: Computing Distance. 222 Computing Distance Write a program to compute the distance between two points. Recall that the distance between the.
Prepared by Johnny Howard © 2015 South-Western, a part of Cengage Learning.
CIS 115 AID Peer Educator/cis115aid.com FOR MORE CLASSES VISIT
CIS 115 Slingshot Academy / Tutorialrank.com Tutorialrank.com For More Tutorials
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand the structure of a C-language program. ❏ To write your first C.
Input, Output and Variables GCSE Computer Science – Python.
Chapter 17 Process Costing.
Introduction to the C Language
Topics discussed in this section:
CIS115 Education for Service-- snaptutorial.com
CIS 115 Teaching Effectively-- snaptutorial.com
Data Science with Python
Topics discussed in this section:
Exam1 Review CSE113 B.Ramamurthy 2/16/2019 B.Ramamurthy.
DO NOW Copy down your homework: 2-4 Lesson Check on page 105
See requirements for practice program on next slide.
Final Review Bina Ramamurthy 4/5/2019 BR.
Using string type variables
The Web Wizard’s Guide To JavaScript
Challenge Guide Grade Code Type Slides
Chapter 2: Adding Integers
Presentation transcript:

1 Session-5 CSIT 121 Spring 2006 Part D due now String Rules Chapter 2 Topics Lab Demo Exercise Assignment

2 String Rules We have used text strings in the previous lab. Let us summarize the rules for strings –You must #include –You can declare a string variable as string name; – You can assign it a value in one of three ways name = “Mike Smith”; cin>>name; //can get the first name only getline(cin,name); //can get full name

3 String Rules You can concatenate (join) strings as follows: –firstname=“Mike”; –lastname=“Smith”; –name=firstname+’ ‘+lastname;

4 Chapter 2 Topics We will cover a few chapter 2 topics before we move on to the lab demo exercise

5 NiMo’s varying rates Niagara Mohawk wants to apply different rates to its customers. If a customer burns more than 1000 units in a month, rate B is applied else rate A is applied. Develop a program that outputs the monthly bill given a customer’s consumption.

6 NiMo’s varying rates You develop the data model for this problem What is the input to your function? Answer: What is the output? Answer: What are the processing requirements? Answer (A or B)*consumption

7 Top Down Design If you are given a complex problem, you are better off dividing it into sub-problems Target is to let each sub-problem deal with one aspect of the software Thus you can rapidly develop the software to solve complex problems

8 NiMo’s varying rates In our example, the program can be divided into three sections: Write a code segment to get the rates Write a code segment to process the charges Write a code segment to output the charges (Input  Processing  Output)

9 Lab Work Finish the NiMo varying rates program and test it with two sample customers. One customer will have rate A (20 cents) applied and the other one will have rate B (15 cents) applied to the monthly bill.

10 Lab Demo Due 2/9 Extend the NiMo program by computing the monthly bill with the energy supply charge. Energy supply charge is different for rate A and rate B customers. For rate A customers, it is 10 percent of the energy bill. For rate B customers, it will be 5 percent of the bill. Add this charge to the bill and display the cumulative monthly bill. The program should display the bill in a nice format with customer information. Assume the name as “Mike Smith” and address as “123 Main Street Anytown NY 12345”. See a sample on the next slide:

11 Sample Output Name: Mike Smith Address: 123 Main St Anytown NY Bill Date: Feb Due By: March Units: 1200 ************************** Charge: $180 Energy Charges: $9 Total Payable: $189 **************************