CS111
Kazumi Slott
Intro to C+ programming Assignment operator, arithmetic operators, mixed datatypes
Assignment operator =
= puts a new value into a box/variable
A variable = A combination of constant values, variables, functions, and operators;
e.g. 10,
CS111
Kazumi Slott
Algorithms - repetition
Reminder
True on the right and False on the left.
F
average >= 75
T
Output Proceed to the next class
Problem solving and algorithm development
<Problem 1>
Make an algorithm for a program that will let a teacher e
CS111
Lecture 3-1: if, nested if
Kazumi Slott
Selection
Use a selection (if-else) when we want the computer to choose between alternative actions.
e.g.
Make an algorithm for the program to read 2 numbers from keyboard and output the larger number.
Start
I
CS111
Kazumi Slott
Introduction to C+ programming
You have learned to solve problems and make algorithms over the past four lectures. When you are given a
problem, you need to come up with an algorithm/flowchart first (90% of your work) then you convert y
CS111 Spring 2015
Kazumi Slott
WK 1-2
1-28-16
Problem solving and algorithm development
We are going to do more practice on solving problems and making algorithms. Making algorithms is like
solving math problems. You should see a lot of examples and work
CS111
Kazumi Slott
Reminder
Windows user: install Putty
Mac users: SSH (you dont need to download Putty)
Open terminal, ssh [email protected]
To download C+ program files onto a local computer, download FileZilla watch out for freeware
To print a
CS111 Lab
Written By Kazumi Slott
Due at the end of todays lab
craps.cpp
Make a program that will simulate the game of craps.
Roll a pair of dice first_roll
If first_ roll is 7 or 11, win
If first_ roll is 2, 3, or 12, lose
If first_ roll is something els
CS111
Kazumi Slott
Assignment 5
Programs on functions
Absolutely NO late submissions will be accepted.
DO NOT forget to print out your runs using the test cases provided in
the instructions for submission. You would lose 50 points if you didnt
give me any
CS111 Spring 2015
Kazumi Slott
WK 1-1
1-21-15
Problem solving and algorithm development
The following shows the flow of making a program.
Given a problem
Analyze it
90%
Come up with a general solution (algorithm = a step by step procedure) Design phase
Co
.data
str: .asciiz "How many numbers would you like to add together?: "
str1: .asciiz "\n"
str2: .asciiz "The sum of the numbers is: "
str3: .asciiz "Please enter an integer: "
.text
main:
#LOADING STRING HEADER QUESTION
li $v0,4
la $a0, str
syscall
li $s
.data
str: .asciiz
"Program Description:" "\t\t\t\t" " This program is written to
mimic a very basic calculator"
str1: .asciiz "Author:"
"\t\t\t\t" "Brandon Cain"
str2: .asciiz "Creation date:" "\t\t\t\t" "02/01/2017"
str3: .asciiz "Please enter an intege
Time Complexity
CS 311 Data Structures
Math and Computer Science
Mathematics play an important role in
computer science.
In array-based queues, we use the mod
operation to update the index.
The hashing that we will cover later relies on
mathematical pr
Queue
CS 311 Data Structures
Queue Overview
Queue is like a line of people waiting to be served.
Queue Overview
You can add an element to the rear of the Queue.
You can remove an element from the front of the
Queue.
Queue Overview
It's not possible to
MIPS Arithmetic
Instructions
Sahar Mosleh
California State University San Marcos
Page
1
# This program will take input (integer) from user and print the message input value is
# plus the integer that is input by user. By looking at system call table we wi
Continue on
Machine Language
Representation of Instruction
Sahar Mosleh
California State University San Marcos
Page
1
What happens if we have immediate in the instruction
I-Type layout is used for instruction that uses one of the following:
registers wi
Chapter 8 Example
Given the population is normal or near-normal, assume = 30,
sample size n = 16, s = 6.
Compute P (xBar > 34.2)
CSUSM, Math 242, L Chen
Solution:
1) Calculate t-score = (xBar - ) / (s / sqrt(n) = (34.2 30) / ( 6/4 ) =
2.8
2) Calculate df:
Stack
CS 311 Data Structures
Stack
Stack is a very common data structure that you will
use again and again in your future courses to solve a
variety of problems.
You have to be able to:
implement it (easy)
analyze a problem and see if a stack is the r
CS571 Yoshii Homework 2 - Searching the Problem Space Based on Weeks 3-4 (Solving Puzzles)
Due: Week 5 Wednesday: Type your answers in black into this file. Submit a Word file or .rtf
Total: 52
Your score:-8.5 = 42.5+3 = 45.5
Your name:
LAXMI SUBHAMKAR AN
CS571 Yoshii Homework 7.2 on Deep Understanding NLP Based on week 12B
Due: Week 13 Wednesday: Type your answers in black into this file.
Total:
40 points
Your name:
Your score:
LAXMI SUBHAMKAR ANNAPRAGADA
=
REVIEW QUESTIONS from the notes[10pts]:
1) "Frui
CS571 Yoshii Homework 8.2 on Machine Learning and ITS - Based on weeks 14-15
Due: Week 16 Monday: Type your answers in black into this file. Submit this Word file.
Total:
25 points
Your name:
Your score:
LAXMI SUBHAMKAR ANNAPRAGADA
=
MACHINE LEARNING AND
CS571 Yoshii Homework 6 on Knowledge Representation Beyond Logic Based on Weeks10-11
Due: Week 12 Wednesday: Type your answers in black into this file. Submit a Word or .rtf file.
Total:
52 points
Your score:-4 = 48
Identical answers to another student. M
CS571 Yoshii Homework 4 on Logic for Knowledge Representation Based on Weeks 7-8
Due: Week 9 Wednesday: Type your answers in black into this file. Submit a Word or .rtf file.
Total: 52
Your score:
Your name:
LAXMI SUBHAMKAR ANNAPRAGADA
=
PART 1: DISCUSSIO
CS571 Yoshii Homework 6 on Knowledge Representation Beyond Logic Based on Weeks10-11
Due: Week 12 Wednesday: Type your answers in black into this file. Submit a Word or .rtf file.
Total:
52 points
Your score:
Your name:
=
DISCUSSION QUESTION (100 words or
CS571 Yoshii Homework 5 on IMPLEMENTATION: Prolog Based on Week 9
Due: Week 10 Wednesday
Total: 25
Always logout from empress before closing the putty window!
=
Note: There are two useful functions in Prolog.
One is write.
This is used to display variable
Rika Sensei
CS571
Your syllabus and all other files for the class are available in Cougar Courses
http:/cc.csusm.edu
You should download the files to your hard drive or H: (your campus drive)
from the above site.
You should submit homework assignments at
CS571 Yoshii Homework 7.1 on Lisp Based on Week 12A
Due: Week 13 Wednesday
Total:
12 points
Always logout from empress before closing the putty window!
GETTING USED TO LISP [13pts]
1) In clisp, load and run the interleave function.
Submit a screen dump/sc
CS571 Yoshii Homework 8.1 on Probabilities Based on Week 13
Due: Week 14 Wednesday: Type your answers in black into this file. Submit this file plus Program and
Test Results.
Total:
40 points
Your score:
Your name:
=
REVIEW QUESTIONS from the notes[15pts]
Overview of programing
languages, Representation
Of
Numbers
Sahar Mosleh
California State University San Marcos
Page
1
High-level
language
program (in C)
Swap (int v[]m int k)
cfw_ int Temp;
temp = v[k];
v[k] = v[k+1];
v[k+1] = temp;
C Compiler
Assembly