HW4 Explanation. Problem 1 You should write maxv() function (Exercise 11 on page 297). Testcase: – Testcase 1: Input : 1 2 3 4 5 -1 Output : maximum value.

Slides:



Advertisements
Similar presentations
Pattern Association.
Advertisements

Computer Hardware 4 Main Types.
ST3236: Stochastic Process Tutorial 3 TA: Mar Choong Hock Exercises: 4.
Overview Reference parameters Documenting functions A game of craps. Design, code, test and document.
1. (-5) + 5 = ______ (-9) = ______ 3.Justify your answer using the number line above. 4.On the number line above, place the number 7 and it’s opposite.
Nonlinear & Neural Networks LAB. CHAPTER 19 State Machine Design with SM charts 19.1 State Machine Charts 19.2 Derivation of SM Charts 19.3 Realization.
Matlab tutorial course Exercises 4:. Exercises – for loops Download the scripts loops_example.m and if_else_example.m, run the code Download the function,
1 9/29/06CS150 Introduction to Computer Science 1 Loops Section Page 255.
Exercise Exercise3.1 8 Exercise3.1 9 Exercise
1 ICS102: Introduction To Computing King Fahd University of Petroleum & Minerals College of Computer Science & Engineering Information & Computer Science.
Exercise Exercise Exercise Exercise
Exercise Exercise Exercise Exercise
Exercise Exercise6.1 7 Exercise6.1 8 Exercise6.1 9.
Determine whether the sequence 6, 18, 54, is geometric. If it is geometric, find the common ratio. Choose the answer from the following :
By Asma Khalil.  As now a days world is known as the global village. We can share our ideas through out the world and in this mean computer helps us.
Elements of Multiple Regression Analysis: Two Independent Variables Yong Sept
COMPE 111 Introduction to Computer Engineering Programming in Python Atılım University
PYTHON PROGRAMMING Week 10 – Wednesday. TERMS – CHAPTER 1 Write down definitions for these terms:  Computation  Computability  Computing  Artificial.
* What kind of loop would I use to complete the following: A. Output all of the prime numbers that are less than 100,000 B. Output the Fibonacci sequence.
KINDY 500 RACE TO THE FINISH USING MENTAL MATH & MATH TOOLS Created by Matt Cash
MOM! Phineas and Ferb are … Aims:
Geometric Sequences and Series Unit Practical Application “The company has been growing geometrically”
TODAY IN ALGEBRA 1…  Return and review exit slips  Learning Goal: Review Ch.1 for Ch.1 Test.
You are going to work in pairs to produce a Maths board game.
computer
CSC Intro. to Computing Lecture 13: PALGO. Announcements Midterm is in one week  Time to start reviewing  We will do more review in class Tuesday.
Do Now 9/28/10 Take out your HW from last night. Take out your HW from last night. Textbook page 31-32, #3-11, all Textbook page 31-32, #3-11,
Do Now 10/3/11 Take out your HW from Wednesday. Take out your HW from Wednesday. Textbook page 54, #1-4 all, all, all, 56 Textbook page 54,
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.
More While Loop Examples CS303E: Elements of Computers and Programming.
Practice with Lists and Strings CS303E: Elements of Computers and Programming.
Logic Gates It’s Only Logical. Logic Gates Are the switches that computers and similar devices use. They hold their state until something changes. Are.
How computers work The CPU & Memory. The parts of a computer.
Computer Science Department LOOPS. Computer Science Department Loops Loops Cause a section of your program to be repeated a certain number of times. The.
THE DIFFERENCE BETWEEN INPUT AND OUTPUT. BY FRASER HINE.
CE 525 January 31, HW#4 Were the modules helpful in learning how to do this exercise? Were any steps unclear? Questions? Good examples…
Source Page US:official&tbm=isch&tbnid=Mli6kxZ3HfiCRM:&imgrefurl=
National Tsing Hua University ® copyright OIA National Tsing Hua University HSA HW1.
8-6: Geometric Sequences Objectives: 1.To form geometric sequences 2.To use formulas when describing geometric sequences.
Computer Parts And Components PERIPHERALS. Definition of Peripherals External hardware devices attached to the computer are called peripheral devices.
For loop. Exercise 1 Write a program to have the user input three (3) numbers: (f)rom, (t)o, and (i)ncrement. Count from f to t in increments of i, inclusive.
EENG 751 3/16/ EENG 751: Signal Processing I Class # 9 Outline Signal Flow Graph Implementation l Fundamentals l System Function l Graph Construction.
Путешествуй со мной и узнаешь, где я сегодня побывал.
Python Programming Adventure Game Instruction Start.
Name 8/29/17.
Exercise : Write a program that print the final price of purchase at a store where everything costs exactly one dollar. Ask for the number of items purchased.
Homework 3 (due:May 27th) Deadline : May 27th 11:59pm
ELG5377 Adaptive Signal Processing
PROGRAM CONTROL STRUCTURE
4A Estimate & Measure Inches
LESSON 3.
Homework 3 (due:June 5th)
Page 1. Page 2 Page 3 Page 4 Page 5 Page 6 Page 7.
For Monday Read WebCT quiz 18.
The Maker.
Notes Over 2.1 Function {- 3, - 1, 1, 2 } { 0, 2, 5 }
Final Exam on 6/20.
CS322D Tutorials.
Function Notation “f of x” Input = x Output = f(x) = y.
Common Errors for HW4.
Turn in your Homework to the box before the tardy bell rings.
Suppose I want to add all the even integers from 1 to 100 (inclusive)
6.1 – Identifying and Representing Functions
IE 214: Operations Management
Click to add Text Computers & Instructions. Computers are given instructions in the form of computer programs that are created through the development.
Lets Play with arrays Singh Tripty
Subject’s, Predicates & Sentences
The Game of Estimation point 3 points 2 points
Functions – Composite – Substitution – Chief Cards
Matlab tutorial course
Presentation transcript:

HW4 Explanation

Problem 1 You should write maxv() function (Exercise 11 on page 297). Testcase: – Testcase 1: Input : Output : maximum value was v[4] = 5 – Testcase 2: Input : Output : maximum value was v[0] = 5

Problem 2 Test case – Input You can create your own test case using the form in g/vectors.htm. g/vectors.htm Output

Problem 3 Input – Output – The matrix is Transpose of matrix is Determinant of matrix is 0

Problem 4 The first player to get to 50 points wins. Human player enters R or H to signal whether to Roll or to Hold. The computer player will always hold after 4 rolls unless its turn ends early due to a 1. After each roll, print the current sequence of scores and the current sum. If the player rolls a 1, the program prints "1 rolled, turn is over" and then the current score for both players.

Problem 4 PlayerDice outputScore Computer2C=2, P=0 Computer1C=0, P=0 Player, R4C=0, P=4 Player, R5C=0, P=9 Player, R6C=0, P=15 Player, R3C=0, P=18 Player, H-C=0, P=18 Computer3C=3, P=18 Computer4C=7, P=18 Computer2C=9, P=18 Computer2C=11, P=18 Player, R2C=11, P=20 Player, R1C=11, P=18