/*
* valentine2.cpp
* Interactive animated Valentine's Day card.
* Shows growing hearts at position given by user.
* This is example 1 give in HW4 instructions.
* Todd Wittman, 2/9/07
*/
#include "ccc_win.h"
#include <time.h>
void drawHeart (Point center,
/
/
/
/
/
/
/
/
Johnathan Lovett
Professor DeSalvo
Pic 10a
10/21/16
main.cpp
hw4
Created by Johnathan Lovett on 10/20/16.
Copyright 2016 Johnathan Lovett. All rights reserved.
/ This program has the user input their order(s) for organic frozen yogurt.
The
/
/
/
/
/
/
Johnathan Lovett
Homework 5
10 / 28 / 16
Professor DeSalvo
Created by Johnathan Lovett on 10/27/16.
Copyright 2016 Johnathan Lovett. All rights reserved.
/ This code has the user select their desired function, input the bounds for
integration,
/ Johnathan Lovett
/ Pic 10a Professor Desalvo
/ 10/14/16
/ main.cpp
/ hw 3.cpp
/ This code has the user input the amount of scoops sold for each icecream
type, Vanilla, Chocolate, and Strawberry, in a single day of business. The code
then calculates the
/
/ Johnathan Lovett
/ 30 September 2016
/
/
/ Created by Johnathan Lovett on 9/29/16.
/ Copyright 2016 Johnathan Lovett. All rights reserved.
/
/
/ This code displays three text paragraphs about myself, each separated by a
blank line.
#include <iostream>
/ Johnathan Lovett
/ 10/07/16
/
/ Created by Johnathan Lovett on 10/6/16.
/
/
/
/ This code takes an amount of change and sorts it into dollars, quarters,
dimes, nickels, and pennies, starting with the largest currency.
#include <iostream>
using namespace
D1- Homework - convert from base 2 number to base ten then go backwards
10001=17(10)
13(10)= 01101
Review fundamental data types (except for string)
Int- any whole number
unsigned int- whole positive number
double- represents decimals
char - represe
Strings: an introduction to the string class
D. Balagu
UCLA
PIC 10A
Todays outline (Sections 2.6 of Big C+):
What is a class?
What is a string?
The string class
String member functions:
substr(start, length)
substr(start)
length()
More string member funct
rand
srand
Random Numbers
D. Balague
UCLA
PIC 10A
More examples
rand
srand
Outline for Today:
(Section 3.11 of Big C+)
1
rand
2
srand
3
More examples
More examples
rand
srand
More examples
Motivation
When working with problems that come from real life, on
Boolean Operators, Logic
D. Balague
UCLA
PIC 10A
Questions youll learn the answer to today:
(Sections 3.5 of Big C+)
Boolean Operators
Definition: An operation that combines conditions is called a
Boolean operator.
Boolean Operators
Definition: An operati
Formatting Numeric Output and Stream
Manipulators
D. Balagu
UCLA
PIC 10A
Todays outline (Section 2.6.4 (and 9.3) of Big C+):
setw
left and right
fixed and setprecision
SETW
The command setw is a stream manipulator that helps us to
format the output in cou
Psychology 112A
Winter 2016
Motivated Behavior
Kate M. Wassum
Syllabus
Lectures:
Tuesdays and Thursdays 2:00-3:15PM
Franz 3534
Instructor:
Dr. Kate M. Wassum
Office: Franz 8548
Office Hours: Wednesday 3-4PM
Email: kwassum@ucla.edu
In this course we will e
Arithmetic
D. Balagu
UCLA
PIC 10A
Todays outline (Sections 2.5 of Big C+):
Variable types
Basic arithmetic (you dont need to include a header file to do
these)
More advanced mathematical operations (youll need to
include a header to use these)
How to turn
ECON 41 - STATISTICS FOR ECONOMISTS
(Winter, 2016)
UCLA Department of Economics
Denis Chetverikov
Contact: Instructors contacts are (310) 825-4521 and chetverikov@econ.ucla.edu.
E-Mails: Please make sure that your full name with proper capitalization and
How to redirect input/output
in MS Visual Studio
By: Michael Puthawala, mputhawala@g.ucla.edu
This is what I get without any redirection. Entering input is tedious
and error prone if I run the program more than a few times!
In order to redirect input you
Data structures:
Stacks & Queues
Lesson 8
PIC 10B, Ricardo Salazar
The concept of a Stack
A stack is a data structure that follows 2 rules:
1. Data can only be accessed by removing the top:
pop()
2. A new data element can only be added to the top of the
Pic 10B
Fall 2016
Midterm 1
Intermediate programming
October 21, 2016
Directions:
You have 50 minutes to complete this exam.
You are not allowed to use any books, notes, calculators, or electronic devices.
Answer the questions in the spaces provided. If y
Pic10B
Fall2015
Midterm1
Intermediateprogramming
October22,2015
Directions:
Youhave90minutestocompletethisexam.
Youarenotallowedtouseanybooks,notes,calculators,orelectronicdevices.
Answer the questions in the spaces provided. If you run out of room us
Data
structures:
Binary Search Trees
Lesson 9
PIC 10B, Ricardo Salazar
Note: BST's are not discussed in detail in our textbook.
Binary Search Trees (BST's)
A BST is an ordered collection of items.
They are organized into nodes which have two
pointers:
4
:
s
e
r
u
t
c
u
Data str
s
p
a
e
H
&
s
e
u
e
u
Priority q
Lesson 10
zar
la
a
S
o
d
r
a
ic
R
,
B
0
PIC 1
s
e
u
e
u
q
y
t
i
r
Prio
Suppose you want to enroll in a UCLA class
but the class is already full.
You are then placed into the waitlist a priority
Template functions
&
Template classes
Lesson 4
PIC 10B, Ricardo Salazar
Important: This presentation corresponds
to the way I used to teach Pic10B prior to
2016. See class notes (last slide) to get a
better idea of
how the material was
presented.
The need
Sorting algorithms
Lesson 11
PIC 10B, Ricardo Salazar.
Why sorting?
Sorting a list of items from smallest to largest is a very
common programming task.
It helps for organizing data
Entering midterm scores at CCLE or My.ucla
Sorting can also improve se
LESSON 12: RANDOM NUMBERS AND
USER-DEFINED CLASSES
PIC 10A, Lecture 4, Fall 2016
Prof. Eric M. Radke
(3.11) RANDOM NUMBERS
C+ has a random number generator that generates random integers between 0
and RAND_MAX.
The value of RAND_MAX depends on the compile
LESSON 8: LOOPS (CONTINUED),
SWITCH
PIC 10A, Lecture 4, Fall 2016
Prof. Eric M. Radke
RECALL: THE FOR LOOP
for (i = 0; i < 10; i+)
cfw_
/do some things
There are three parts of the argugment in parentheses():
The first part assigns an initial value of th
PIC 10A-4, Fall 2016
Midterm 1 Practice Problems
Disclaimer: The following problems are given for practice only. This should not be considered a
comprehensive study guide, nor should it be assumed that the midterm questions will resemble these.
1. Short a
LESSON 10: FUNCTIONS (CONTINUED)
PIC 10A, Lecture 4, Fall 2016
Prof. Eric M. Radke
RECALL: FUNCTIONS
A function is a set of instructions, separated from the main routine, that can perform tasks on its on and
can be called at any time.
Functions can receiv