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

Slides:



Advertisements
Similar presentations
Interactive Scripts: Intermediate. Error Trapping When requesting user input, it is imperative that the users enter the data in the desired format. Dropdown,
Advertisements

Standard Algorithms Find the highest number. ! Your name and today’s date ! Find the maximum Dim numbers(20) As Integer.
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
Race Condition Zutao Zhu 10/09/09. Outline Race Condition –Some functions –File format of /etc/passwd and /etc/shadow –Input Redirection Format-string.
CS107 Introduction to Computer Science Loops. Instructions Pseudocode Assign values to variables using basic arithmetic operations x = 3 y = x/10 z =
1 Lab Session-6 CSIT-121 Spring 2005 Structured Choice The do~While Loop Lab Exercises.
Java vs. You.
11 Chapter 4 LOOPS AND FILES. 22 THE INCREMENT AND DECREMENT OPERATORS To increment a variable means to increase its value by one. To decrement a variable.
1 Project 5: Median. 2 The median of a collection of numbers is the member for which there are an equal number less than or equal and greater than or.
CSC 1051 M.A. Papalaskari, Villanova University Repetition CSC 1051 – Data Structures and Algorithms I Dr. Mary-Angela Papalaskari Department of Computing.
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?
Creating a FAMWEB User account New FEPMIS Production Site To gain access into New FEPMIS, you must request a new account. Go to the National Fire and Aviation.
First tutorial.
While Loops Indefinite Iteration. Last lesson we looked at definite loops using the ‘For’ statement. The while loop keeps going while some condition is.
How to: REGISTER. STEP 1 Click the link shown below to register.
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.
RiskMeter Batch Training. Batch Tool The Riskmeter batch tool allows users to submit multiple locations all at once. The Riskmeter batch tool allows users.
Practice and Evaluation. Practice Develop a java class called: SumCalculator.java which computes a sum of all integer from 1 to 100 and displays the result.
1 MANAGEMENT OF THE ST ScI ELECTRONIC GRANTS MANAGEMENT SYSTEM BY INSTITUTIONAL ACCOUNTING STAFF September, 2000.
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.
Control Structures Repetition or Iteration or Looping Part II.
Online Homework/Tutorial System.
Homework Assignment #1 J. H. Wang Oct. 6, 2011.
CS161 Topic #16 1 Today in CS161 Lecture #16 Prepare for the Final Reviewing all Topics this term Variables If Statements Loops (do while, while, for)
Set up Your SAM 2013 Account Go to: sam.cengage.com Do not type www.
IR Homework #1 By J. H. Wang Mar. 16, Programming Exercise #1: Vector Space Retrieval - Indexing Goal: to build an inverted index for a text collection.
CS1109 L AB 3 July 3rd. R OAD M AP Homework submission Review How to use function and scripts While-end Finish last exercise Lab 2 Challenge questions.
Homework #2: Functions and Arrays By J. H. Wang Mar. 20, 2012.
IR Homework #3 By J. H. Wang May 10, Programming Exercise #3: Text Classification Goal: to classify each document into predefined categories Input:
Data Verification and Validation
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.
Agenda Perform Quiz #1 (20 minutes) Loops –Introduction / Purpose –while loops Structure / Examples involving a while loop –do/while loops Structure /
Computer Information Technology. I need you to submit your project electronically to the Hancock website. Before you can submit your project you will.
Homework #1: C++ Basics, Flow of Control, and Function Basics
LAB SESSION ONE DIMENSIONAL ARRAY.
Programming Fundamentals I Java Programming Spring 2009 Instructor: Xuan Tung Hoang TA: Tran Minh Trung Lab 03.
Think Possibility 1 Iterative Constructs ITERATION / LOOPS C provides three loop structures: the for-loop, the while-loop, and the do-while-loop. Each.
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.
COMP Loop Statements Yi Hong May 21, 2015.
PHP Form Processing * referenced from
Homework #3: Classes and Constructors
Homework #3: Classes and Constructors By J. H. Wang Apr. 24, 2015.
CS 115 OBJECT ORIENTED PROGRAMMING I LECTURE 11 GEORGE KOUTSOGIANNAKIS 1 Copyright: 2015 Illinois Institute of Technology_ George Koutsogiannakis.
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.
Chapter 4 Repetition Statements Program Development and Design Using C++, Third Edition.
Logging Into Windows XP for first time (labs only!)
Affinity Program | Client Approved Copy| Native App Landing Page
Think What will be the output?
Week 4 – Chapter 3 Repetition.
Iterations Programming Condition Controlled Loops (WHILE Loop)
PRG 410 Competitive Success-- snaptutorial.com
PRG 410 Education for Service-- snaptutorial.com
PRG 410 Teaching Effectively-- snaptutorial.com
Using Turnitin.com.
Powerschool for Parents
Office 365 Login Instructions
Homework #1 Chap. 1, 3, 4 J. H. Wang Oct. 2, 2018.
LOOPS The loop is the control structure we use to specify that a statement or group of statements is to be repeatedly executed. Java provides three kinds.
Types of loops definite loop: A loop that executes a known number of times. Examples: Repeat these statements 10 times. Repeat these statements k times.
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, 2012

Programming Exercises 1.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 minimum and maximum; [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 2.Write a C++ program that asks the user to input an integer n and computes the value of n! = n*(n-1)*…*2*1. [Note: Please inform the user if the output value would be out of range for the data type that you used (i.e., int or long int ).]

3.You have r identical prizes to give away and a pool of n finalists. The finalists are assigned numbers from 1 to n. Write a function to randomly select the numbers of r finalists to receive a prize from n finalists. Make sure not to pick the same number twice. For example, given n =25 and r =4, picking finalists 3, 15, 22, and 14 would be valid but picking 3, 3, 31, and 17 would be invalid, because finalist number 3 is listed twice and 31 is not a valid finalist number. [Hint: input - n & r, output - a list of r numbers]

Homework Submission Due: 2 weeks (Mar. 27, 2012) Submission instructions: –Homework submission Web site at: – Account : Please use your student ID as the username and password to login the Web site. – File names : Please name your file according to our homework. For example, HW1.zip or quiz2.rar.