Homework #1: C++ Basics, Flow of Control, and Function Basics

Slides:



Advertisements
Similar presentations
MFA for Business Banking – Security Code Multifactor Authentication: Quick Tip Sheets Note to Financial Institutions: We are providing these QT sheets.
Advertisements

Computer Programming w/ Eng. Applications
Exercise (1).
CS107 Introduction to Computer Science Lecture 3, 4 An Introduction to Algorithms: Loops.
Looping while … do …. Condition Process 2 Process 1 Y Repeated Loop.
Homework #2: Functions and Arrays
Introduction to Application Programming IST 256 Application Programming for Information Systems Xiaozhong Liu
Computer Science 1620 Loops.
1 CSI 101 Elements of Computing Fall 2009 Lecture #4 Using Flowcharts Monday February 2nd, 2009.
Chapter 4 Control Structure: Loop Knowledge: Understand the various concepts of loop control structure Skill: Be able to develop a program involving loop.
An Introduction to Textual Programming
Registering for a South Monterey County JUHSD Parent Aeries Account
CSC 386 – Computer Security Scott Heggen. Database Security How can we minimize the probability of success by attacks like the one shown in the comic?
Repetition Statements Repeating an Action A specified number of times While a Condition is True Until a Condition is True.
CS161 Topic #21 CS161 Introduction to Computer Science Topic #2.
15 Aug Visual Basic for Applications Programming language Very similar to Visual Basic Embedded in Microsoft Office applications “Object oriented”
Homework #3: Classes and Constructors
Array Cs212: DataStructures Lab 2. Array Group of contiguous memory locations Each memory location has same name Each memory location has same type a.
BUILDING JAVA PROGRAMS CHAPTER 7 Arrays. Exam #2: Chapters 1-6 Thursday Dec. 4th.
Homework #4: Operator Overloading and Strings By J. H. Wang May 8, 2012.
More While Loop Examples CS303E: Elements of Computers and Programming.
Homework Assignment #1 J. H. Wang Oct. 2, 2015.
Quiz. Quiz One Type your name, ID and address in the.asm file. MUST DO or ZERO SCORE. Change q1 to yourStudentID_q1. You were working as a programming.
IR Homework #2 By J. H. Wang Mar. 31, Programming Exercise #2: Query Processing and Searching Goal: to search relevant documents for a given query.
Lecture 4 Looping. Building on the foundation Now that we know a little about  cout  cin  math operators  boolean operators  making decisions using.
Homework Assignment #1 J. H. Wang Oct. 13, Homework #1 Chap.1: 1.24 Chap.2: 2.13 Chap.3: 3.5, 3.13* (or 3.14*) Chap.4: 4.6, 4.12* –(*: optional.
Even more problems.. Mean (average) I need a program that calculates the average of student test scores. I need a program that calculates the average.
Homework Assignment #1 J. H. Wang Oct. 6, 2011.
Count and add list of numbers From user input and from file.
Lecture 5: Stopping with a Sentinel. Using a Sentinel Problem Develop a class-averaging program that will process an arbitrary number of grades each time.
Homework #2: Functions and Arrays By J. H. Wang Mar. 20, 2012.
Assignment statement and Arithmetic operation 1 The major part of data processing.
Homework #1: C++ Basics, Flow of Control, and Function Basics By J. H. Wang Mar. 13, 2012.
Excel Future Value FV (rate,nper,pmt,pv,type). Annual interest rate divided by the number of compound periods.
 Online document storage and file sharing.  Access files from anywhere, store them free, and securely share them.  Great back up plan for storing those.
Homework #4: Operator Overloading and Strings By J. H. Wang Apr. 17, 2009.
Homework #2: Functions and Arrays By J. H. Wang Mar. 24, 2014.
Chapter 7 Problem Solving with Loops
LAB SESSION ONE DIMENSIONAL ARRAY.
Programming Fundamentals I Java Programming Spring 2009 Instructor: Xuan Tung Hoang TA: Tran Minh Trung Lab 03.
Homework Assignment #1 J. H. Wang Oct. 11, 2013.
Homework #3: Classes and Constructors By J. H. Wang Apr. 14, 2014.
Homework #5: Pointers, Dynamic Arrays and Inheritance By J. H. Wang Jun. 5, 2009.
Exercise 1 #include int main() { printf(“Hello C Programming!\n”); return 0; } 1.Run your Visual Studio 2008 or Create a new “project” and add.
1 Project 2: Using Variables and Expressions. 222 Project 2 Overview For this project you will work with three programs Circle Paint Ideal_Weight What.
COMP Loop Statements Yi Hong May 21, 2015.
Homework #3: Classes and Constructors
Homework #3: Classes and Constructors By J. H. Wang Apr. 24, 2015.
CS 101 – Oct. 7 Solving simple problems: create algorithm Structure of solution –Sequence of steps (1,2,3….) –Sometimes we need to make a choice –Sometimes.
Homework #4: Operator Overloading and Strings By J. H. Wang May 22, 2015.
IR Homework #2 By J. H. Wang Apr. 13, Programming Exercise #2: Query Processing and Searching Goal: to search for relevant documents Input: a query.
Homework Assignment #1 J. H. Wang Oct. 11, 2016.
Homework #2 J. H. Wang Oct. 19, 2017.
Chapter 2 Assignment and Interactive Input
Iterations Programming Condition Controlled Loops (WHILE Loop)
Administrative things
PRG 410 Competitive Success-- snaptutorial.com
PRG 410 Education for Service-- snaptutorial.com
PRG 410 Teaching Effectively-- snaptutorial.com
Using Turnitin.com.
Public Schools of Robeson County
Introduction to pseudocode
Powerschool for Parents
Office 365 Login Instructions
Warm-up Write an equation whose limit at infinity does not exist
CS150 Introduction to Computer Science 1
Exit Ticket: Completion Verified
Homework #1 Chap. 1, 3, 4 J. H. Wang Oct. 2, 2018.
Homework #2 J. H. Wang Oct. 18, 2018.
Week 7: Computer Tools for Problem Solving and Critical Thinking
Presentation transcript:

Homework #1: C++ Basics, Flow of Control, and Function Basics By J. H. Wang Mar. 13, 2015

Programming Exercises Write a C++ program that allows the user to repeatedly enter integers until she inputs a 0 (zero). Then, your program should do the following: (a) count the number of positive values and the number of negative values in user input; (b) calculate the sum and average of the numbers; [Note: Do not count the ending input 0 in the result.] [Note: Please do not use arrays because you don’t need them in this exercise.]

Programming Exercises A formula for calculating annual compound interest is: F=P(1+r)n where P is the present value, r is the interest rate per year, n is the number of years. Write a C++ program that asks the user to input integers n and P, a double r between 0 and 1, and computes the future value of F. [Note: Please do not use the predefined math functions such as pow().]

One way to estimate the height of a child is to use the following formula, which uses the height of the parents: Hmale_child=((Hmother13/12)+Hfather)/2 Hfemale_child=((Hfather12/13)+Hmother)/2 All heights are in inches. Write a function that takes as input parameters the gender of the child, height of the mother in inches, and height of the father in inches, and outputs the estimated height of the child in inches. Embed your function in a C++ program that allows you to test the function over and over again until telling the program to exit. The user should be able to input the heights in feet and inches, and the program should output the estimated height of the child in feet and inches. Use the integer data type to store the heights.

Homework Submission Due: 2 weeks (Mar. 27, 2015) Submission instructions: Homework submission Web site at: http://mslin.ee.ntut.edu.tw/ Account: At your first login, please use your student ID as the account and password. Remember to change the password as soon as possible for better security. File names: Please name your file according to our homework. For example, [id]_HW1.zip or [id]_quiz2.rar.

Thanks for Your Attention!