32 Pages

notes2

Course: ENGR 3, Fall 2006
School: UCSB
Rating:
 
 
 
 
 

Word Count: 1770

Document Preview

weve What learned so far Basic structure of a C program Printing output: printf Reading in input: scanf Basic arithmetic operations Decision making: if statements Debugging programs Algorithms Reading for this week Chap. 3 Section 4.10 Additional Options for printf / scanf We used the following scanf and printf statements last week: scanf( %d, &integer1 ); printf( Sum is %d\n\n, sum ); Here...

Register Now

Unformatted Document Excerpt

Coursehero >> California >> UCSB >> ENGR 3

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
weve What learned so far Basic structure of a C program Printing output: printf Reading in input: scanf Basic arithmetic operations Decision making: if statements Debugging programs Algorithms Reading for this week Chap. 3 Section 4.10 Additional Options for printf / scanf We used the following scanf and printf statements last week: scanf( %d, &integer1 ); printf( Sum is %d\n\n, sum ); Here integer1 and sum were variables, and %d indicated the format of the data (we used %d for integer). Other format types: %d = decimal integer (can also be of the form %.3d, %5d or %5.3d) %f = floating point number (can also be of the form %.2f or %6.2f) %lf = double (use %f in printf statement, %lf in scanf statement) %c = character %s = string (in printf only) Example Program 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 /* More on printf */ #include <stdio.h> /* function main begins program execution */ int main() { float pie = 3.1416; printf( "\n%.3d is an integer.", 15 ); printf( "\n%.3f is a floating point number.", pie ); printf( "\n%s is a string\n", "aabbbcc" ); return 0; /* indicate that program ended successfully */ } /* end function main */ Example Program Output Output for program on previous page: % a.out 015 is an integer. 3.142 is a floating point number. aabbbcc is a string. % Flow chart for an if statement if (num1 % 7 == 0 ) printf( %d is divisible by 7.\n, num1 ); true num1 % 7 == 0 print num1 is false The ifelse Selection Statement if Only performs an action if the condition is true if...else Specifies an action to be performed both when the condition is true and when it is false. Pseudocode If ( num1 mod 7 ) is equal to 0 Print num1 is divisible by 7 else Print num1 is not divisible by 7 Flow chart for an ifelse statement if (num1 % 7 == 0 ) printf( %d is divisible by 7.\n, num1 ); else printf(%d is not divisible by 7.\n, num1 ); print num1 is not false true num1 % 7 == 0 print num1 is The ifelse Selection Statement C code: if ( num1 % 7 == 0 ) { printf( %d is divisible by 7\n, num1 ); } else { printf( %d is not divisible by 7\n, num1 ); } Ternary conditional operator (?:) Takes 3 arguments ( condition ? value if true : value if false ) Examples: printf( %s\n, grade >= 60 ? Passed : Failed ); grade >=60 ? printf( Passed\n ) : printf( Failed\n ); C Program: ifelse 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 /* decision making: using the if...else statement*/ #include <stdio.h> /* function main begins program execution */ int main() { int num1; /* declare variables */ printf( "\nEnter an integer, and I will tell you\n" ); printf( "if it is divisible by 7: " ); scanf( "%d", &num1 ); /* read integer */ if ( num1 % 7 == 0 ){ printf( "%d is divisible by 7.\n", num1 ); } else { printf( "%d is not divisible by 7.\n", num1 ); } return 0; /* indicate that program ended successfully */ } /* end function main */ C Program: nested ifelse 1 2 3 4 5 6 7 8 9 10 11 12 13 /* using nested if...else statements*/ #include <stdio.h> /* function main begins program execution */ int main() { int score; /* declare variables */ printf( "\nEnter your score, and I will tell you\n" ); printf( "your grade: " ); scanf( "%d", &score ); /* read integer */ C Program: nested ifelse if ( score >= 90 ) 14 printf( "You got an A.\n" ); 15 else 16 if ( score >= 80 ) 17 printf( "You got a B.\n" ); 18 else 19 if ( score >= 70 ) 20 printf( "You got a C.\n" ); 21 else 22 if ( score >= 60 ) 23 printf( "You got a D.\n" ); 24 else 25 printf( "You got an F.\n" ); 26 27 return 0; /* indicate that program ended successfully */ 28 29 30 } /* end function main */ C Program: ternary conditional operator 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 /* using the ternary conditional operator */ #include <stdio.h> /* function main begins program execution */ int main() { int score; /* declare variables */ printf( "\nEnter your score, and I will tell you\n" ); printf( "if you passed: " ); scanf( "%d", &score ); /* read integer */ printf( "%s\n", score >= 60 ? "You passed!!!" : "You failed." ); return 0; /* indicate that program ended successfully */ } /* end function main */ Logical Operators && ( logical AND ) Returns true if both conditions are true || ( logical OR ) Returns true if either of its conditions are true ! ( logical NOT, also called logical negation ) Reverses the truth/falsity of a statement Example Program 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 /* logical operators, using the ternary conditional operator */ #include <stdio.h> int main() { int num1, num2, num3, num4; printf( "\nEnter two integers, and I will tell you\n" ); printf( "if they are both even: " ); scanf( "%d%d", &num1, &num2 ); /* read integer */ /* check if both integers are even */ num1 % 2 == 0 && num2 % 2 == 0 ? printf( "\nBoth integers are even.\n\n" ) : printf( "\nAt least one integer is not even.\n\n" ); Example Program 19 20 21 22 23 24 25 26 27 28 29 30 31 32 printf( "\nEnter two integers, and I will tell you\n" ); printf( "if at least one is even: " ); /* check if at least one integer is even */ scanf( "%d%d", &num3, &num4 ); /* read integer */ num3 % 2 == 0 || num4 % 2 == 0 ? printf( "\nAt least one integer is even.\n\n" ) : printf( "\nNeither integer is even.\n\n" ); return 0; /* indicate that program ended successfully */ } /* end function main */ Example Program with Logical NOT 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 /* example with logical NOT */ #include <stdio.h> /* function main begins program execution */ int main() { int num1; /* declare variables */ printf( "\nEnter a positive integer, and I will tell you\n" ); printf( "if it is divisible by 7: " ); scanf( "%d", &num1 ); /* read integer */ if ( !( num1 > 0) ) printf( "\nThe integer you entered is not positive.\n" ); else printf( "\n%d is%sdivisible by 7.\n", num1, num1 % 7 == 0 ? " " : " not " ); return 0; /* indicate that program ended successfully */ } /* end function main */ The while Repetition Statement Repetition statement Programmer specifies that an action is to be repeated while some condition remains true while statement Pseudocode While there are more items on my shopping list, Purchase next item and cross it off my list. while loop repeated until condition becomes false The while Repetition Statement Example int product = 1; while ( product < 1000 ) { printf( %d\n, product ); product 2 = * product; } product < 1000 true print product; product = 2*product; false Formulating program with a while loop Program with a while loop (and many other programs as well) have 3 phases: Initialization: define and initialize program variables Processing: input data values and perform all processing of data Termination: Calculate and print final results Counter-Controlled Repetition Counter-controlled repetition Loop repeated until counter reaches a certain value Example: A class of n students took a quiz. The grades for this quiz are available to you. Determine the class average on the quiz. Pseudocode Set total to zero. Set counter to one. User inputs number of students in class. While counter is less than or equal to number of students, Input the next grade. Add the grade to the total. Add one to the grade counter. Set average to the total divided by the number of students. Print the class average. Ex. Prog. Counter-controlled repetition 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 /* class average program with counter-controlled repetition */ #include <stdio.h> int main() { /* define variables */ int students; /* number of students in the class */ int counter; /* grade number to be entered */ int grade; /* grade value */ float total; /* sum of all grades that have been input */ float average; /* average of grades */ /* initialize variables */ total = 0; /* initialize total */ counter = 1; /* initialize loop counter */ /* initialize students */ printf( "\nEnter the total number of students in the class: " ); scanf( "%d", &students ); Ex. Prog. Counter-controlled repetition 20 /* process while loop */ 21 while ( counter <= students ) { /* set up loop */ 22 printf( "Enter grade %d: ", counter ); /* ask for input */ 23 scanf( "%d", &grade ); /* read grade from user */ 24 total = total + grade; /* add grade to total */ 25 counter = counter + 1; /* increment counter */ 26 } /* end while */ 27 28 /* perform calculations */ 29 average = total / students; 30 31 /* display results */ 32 printf( "The class average is %.2f.\n\n", average ); 33 34 return 0; 35 36 37 } /* end function main */ Program Output % a.out Enter the total number of students in the class: 4 Enter grade 1: 56 Enter grade 2: 68 Enter grade 3: 98 Enter grade 4: 47 The class average is 67.25. % Prog. 2 Counter-controlled repetition 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 /* example of a while repetition statement*/ #include <stdio.h> int main() { /* convert 10 angles from degrees to radians */ /* initialize variables */ int counter = 1; float angle; /* process while loop */ while ( counter <= 10 ) { printf( "Enter angle %d in degrees: ", counter ); scanf( "%f", &angle ); printf( "Angle %d in radians is %.2f.\n", counter, angle*3.1416/180); counter = counter + 1; } return 0; } /* end function main */ Sentinel-Controlled Repetition Sentinel-controlled repetition Loop repeated until user enters a sentinel value (also called a flag value) Flag value indicates end of data entry End loop when user enters flag value Flag value chosen so that it cannot be confused with a regular input (such as -1 in the following example) Example: A class of students took a quiz. The grades for this quiz are available to you. Determine the class average on the quiz. Sentinel-Controlled Repetition Pseudocode Set total to zero and counter to zero. Input the first grade (possibly the flag value). While grade not equal to sentinel, Add the grade to the total. Add 1 to counter Input the next grade (possibly the flag value). If counter is not equal to zero, Set average to the total divided by the counter. Print the average. Else Print No grades were entered. Ex. Prog. Sentinel-controlled repetition 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 /* class average program with sentinel-controlled repetition */ #include <stdio.h> int main() { /* define and initialize variables */ int counter = 0; /* grade number to be entered */ int grade; /* grade value */ float total = 0; /* sum of all grades that have been input */ float average; /* average of grades */ /* get first grade from user */ printf( "\nEnter grade (enter -1 to end): " ); scanf( "%d", &grade ); Ex. Prog. Sentinel-controlled repetition 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 /* process while loop */ while ( grade != -1 ) { /* set up loop */ total = total + grade; /* add grade to total */ counter = counter + 1; /* increment counter */ printf( "Enter grade (enter -1 to end): " ); scanf( "%d", &grade ); } /* end while */ /* termination phase */ if (counter != 0 ) { average = total / counter; printf( "The class average is %.2f.\n\n", average ); } /* end if */ else /* if no grades were entered, output message */ printf( "No grades were entered.\n\n" ); return 0; } /* end function main */ Program Output % a.out Enter grade (enter -1 to end): Enter grade (enter -1 to end): Enter grade (enter -1 to end): Enter grade (enter -1 to end): Enter grade (enter -1 to end): The class average is 67.25. % % a.out Enter grade (enter -1 to end): -1 No grades were entered. % 56 68 98 47 -1 Nested Control Structures - Example Problem A college has a list of test results (1 = pass, 2 = fail) for 10 students Write a program that allows the user to enter each students results and then prints how many passed and how many failed Output should look like: % a.out Enter result Enter result Enter result Enter result Enter result Enter result Enter result Enter result Enter result Enter result Passed: 6 Failed: 4 % (1=pass, (1=pass, (1=pass, (1=pass, (1=pass, (1=pass, (1=pass, (1=pass, (1=pass, (1=pass, 2=fail): 2=fail): 2=fail): 2=fail): 2=fail): 2=fail): 2=fail): 2=fail): 2=fail): 2=fail): 1 2 2 1 1 1 2 1 1 2 Ex. Prog. Nested control structures 1 2 3 4 5 6 7 8 9 10 11 /* example with nested control structures: exam results */ #include <stdio.h> int main() { /* define and initialize variables */ int passes = 0; /* number of passes */ int failures = 0; /* number of failures */ int student = 1; /* student counter */ int result; /* one exam result */ Ex. Prog. Nested control structures 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 /* process 10 students using counter-controlled loop */ while ( student <= 10 ) { /* set up loop */ printf( "Enter result (1=pass, 2=fail): "); scanf( "%d", &result ); /* if result = 1, increment passes. else, increment failures */ if ( result == 1 ) passes = passes + 1; else failures = failures + 1; student = student + 1; } /* end while */ /* display number of passes and failures */ printf( "Passed: %d\n", passes ); printf( "Failed: %d\n\n", failures ); return 0; } /* end function main */
Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

UCSB - ENGR - 3
What we learned recently ifelse selection statements Ternary conditional operator Logical Operators while repetition statement Nested control structures Reading for this week and next week: Chap. 4 (skip 4.7)Assignment Operators Assignment
UCSB - ENGR - 3
What we learned last week Assignment/increment operators (a+,+a,) for statement Generating tables, etc. break and continue statements Reading for this week and next week: Chap. 5 and Chap. 6 This week: FUNCTIONS and MATH LIBRARYAdditional no
UCSB - ENGR - 3
Arrays New topic: ARRAYS Reading for this week: CHAPTER 6Arrays Arrays Structures of related data items Group of consecutive memory locations Same name and type Name Type of array Number of elements Examples:int b[ 3 ]; float myArray[ 27
UCSB - ME - 104
HW #1 ME104 Due Friday 10/3 at 9pm (in box outside of CAD Lab) Problems from Text: 2.2, 2.9, 2.12, 2.27 Prob. 5. Using the Taylor series for e x , show that e j = cos + j sin (Eulers formula, pronounced oilers) Prob. 6. Solve the following equation
UCSB - ME - 104
HW #2 ME104 Due Friday 10/10 at 9pm (in box outside of CAD Lab) Prob. 1. 2.28 from the text Prob. 2. 2.28 from the text, but set Vs = 1 + cos(100,000t) (hint: use superposition) Prob. 3. Read the notes on phasor analysis of mechanical systems (posted
UCSB - ME - 104
HW #3 ME104 Due Friday 10/7 at 9pm (in box outside of CAD Lab) Problems 2.29, 2.31, 2.35 from the text Problem 4 from the phasor notes on mechanical systems Problems 3.2, 3.6 from the text Problem 3.11 from the text (real transistor means the base-em
UCSB - ME - 104
Midterm Practice and HW#4 ME104Problem 1. Compute the magnitude and phase of1+ j 3 1+ jProblem 2.29 where Vs is the squarewave of figure 4.3. (Use superposition) Problems 2.32, 3.4, 3.14, 4.3, 4.5
UCSB - ME - 104
HW #5 ME104 Due Friday 10/31 at 9pm (in box outside of CAD Lab)From the Text: 4.6, 8.2, 8.6, 8.8, 8.9
UCSB - ME - 104
HW #6 ME104 Due Friday 11/7 at 9pm (in box outside of CAD Lab)From the Text: 9.1, 9.2, 9.5, 9.6, 9.7, 9.8
UCSB - ME - 104
HW #7 ME104 Due Friday 11/14 at 9pm (in box outside of CAD Lab)From the Text: 9.13, 9.15, 9.19 (use phasor analysis), 9.20
UCSB - ME - 104
HW #8 and Midterm Practice ME104 Due Friday 11/21 at 9pm (in box outside of CAD Lab)From the Text: 4.7, 8.4, 8.7, 9.4, 9.11 For the magnetic circuit below, find expressions for a) the flux b) inductance c) force in the air gapFor midterm review,
UCSB - ME - 104
HW #9 ME104 Due Thursday 12/4 at 9pm (in box outside of CAD Lab)Problem 1. A 3-phase variable reluctance motor has phase inductances as follows: LA ( ) = 2 + cos ( 4 ) 2 LB ( ) = 2 + cos 4 + 3 4 LB ( ) = 2 + cos 4 + 3 The currents appl
UCSB - ME - 104
Phasor Analysis of Linear Mechanical Systems and Linear Differential Equations ME104, Prof. B. Paden In this set of notes, we aim to imitate for linear mechanical systems and linear differential equations, the phasor analysis we learned for electric
UCSB - ME - 104
UCSB - ME - 104
UCSB - ME - 104
UCSB - ME - 104
UCSB - ME - 104
UCSB - ME - 104
UCSB - ME - 104
Michigan State University - HNF - 150
HNF 150 Fall 2008 - Thurston Week 5 Reading: Chap 5 and 11; Myturn Video Exam 1 Study Topics Lipids and CVD (part 1-week 4, part 2-week 5) Understand the following terms/concepts: -Satiety: the perception of fullness in the hours after a meal and inh
UNC - BIOL - 201
What is Science? and Forward GeneticsJ. Lieb Feb 29, 2008Image from http:/bio.owu.edu/genhom.htmSome administrative notesLectures and Notes: Lectures for the week will be posted on Sunday Notes will be posted after each lecture (by the next S
UNC - BIOL - 201
RNA and TranscriptionJ. Lieb March 03, 2008A representation of Phage T7 RNA Polymerase (blue) making RNA (red) from a DNA template (strands colored yellow and orange).In your book: Chapter 8In biology, information flows fromDNATranscriptio
UNC - BIOL - 201
Biology 202 - LiebProkaryotic Gene RegulationIntroductionIn both prokaryotes and eukaryotes, transcription proceeds in stages called Initiation, Elongation, and Termination. You should be able to describe what each stage involves, and what prote
UNC - BIOL - 201
Biology 202- LiebEukaryotic Gene RegulationIntroductionThere are major differences between prokaryotic and eukaryotic transcriptional regulation. You should know what these are.I. Cis-acting sequencescore promoter: This refers to the area ver
UNC - BIOL - 201
Biology 202-LiebChromatin and Eukaryotic Gene Regulation III. Genomes, genes, and chromosomes (review from first half) The genome is all of the DNA in an organism. In eukaryotes, the genome is organized into chromosomes. Before replication, a
UNC - BIOL - 201
Biology 202- LiebRNA ProcessingI. RNA processing in eukaryotesTranscription takes place in the nucleus, but translation occurs in the cytoplasm. RNAs undergo several processing steps before being sent to the cytoplasm. The RNA synthesized by RNA
UNC - BIOL - 201
Lieb- Biology 202Translation &amp; Protein StructureI. PolypeptidesAmino acids have a central (alpha) carbon atom attached to an amino group (NH2) a carboxyl group (COOH) a side chain (R, for reactive group).H HNR C H C O OHIn a polypeptide, a
UNC - BIOL - 201
Biology 202-LIEB I. Classification of mutationsDNA DamageA. At the DNA level point mutation = the general term for a single base change o transition = purine to purine or pyrimidine to pyrimidine o transversion = purine to pyrimidine or pyrimidi
UNC - BIOL - 201
Biology 202-LiebDNA RepairI. Cellular responses to DNA damage In addition to repair or reversal of damage (II and III below), other mechanisms exist: bypass DNA polymerase is blocked by many types of damage; special bypass polymerases can synthe
UNC - BIOL - 201
Biology 202- LiebEnzymatic Manipulation of DNAI. Restriction endonucleasesProkaryotic enzymes that make double-stranded cuts in DNA. Name = 1st letter of Genus + two letters of species (+ strain) + roman numeral: EcoRI KpnI HindIII Escherichia c
東京大学 - MATH - gcse
UNIVERSITY OF CAMBRIDGE INTERNATIONAL EXAMINATIONS International General Certificate of Secondary Education ADDITIONAL MATHEMATICS Paper 2 May/June 2005 2 hoursAdditional Materials: Answer Booklet/Paper Electronic calculator Graph paper Mathematical
東京大学 - MATH - gcse
UNIVERSITY OF CAMBRIDGE INTERNATIONAL EXAMINATIONS International General Certificate of Secondary Education ADDITIONAL MATHEMATICS Paper 1 May/June 2006 2 hoursAdditional Materials: Answer Booklet/Paper Electronic calculator Graph paper Mathematical
東京大学 - MATH - gcse
UNIVERSITY OF CAMBRIDGE INTERNATIONAL EXAMINATIONS International General Certificate of Secondary Education ADDITIONAL MATHEMATICS Paper 2 May/June 2006 2 hoursAdditional Materials: Answer Booklet/Paper Electronic calculator Mathematical tables060
東京大学 - MATH - gcse
UNIVERSITY OF CAMBRIDGE INTERNATIONAL EXAMINATIONS International General Certificate of Secondary EducationADDITIONAL MATHEMATICSPaper 10606/01October/November 20052 hoursAdditional Materials: Answer Booklet/Paper Electronic calculator Graph
東京大学 - MATH - gcse
0580 Mathematics June 2008Location Entry CodesAs part of CIEs continual commitment to maintaining best practice in assessment, CIE has begun to use different variants of some question papers for our most popular assessments with extremely large a
東京大学 - MATH - gcse
MATHEMATICSGrade thresholds taken for Syllabus 0580/0581 (Mathematics) in the May/June 2008 examination. maximum mark available Component 11 Component 12 Component 21 Component 22 Component 3 Component 4 56 56 70 70 104 130 minimum mark required for
東京大学 - MATH - gcse
UNIVERSITY OF CAMBRIDGE INTERNATIONAL EXAMINATIONSInternational General Certificate of Secondary EducationMARK SCHEME for the May/June 2008 question paper0580 and 0581 MATHEMATICS0580/03 and 0581/03 Paper 3 (Core), maximum raw mark 104This ma
東京大学 - MATH - gcse
UNIVERSITY OF CAMBRIDGE INTERNATIONAL EXAMINATIONS International General Certificate of Secondary EducationMATHEMATICS Paper 4 (Extended) Additional Materials: Answer Booklet/Paper Geometrical instruments Mathematical tables (optional) Electronic c
東京大学 - MATH - gcse
Location Entry CodesAs part of CIEs continual commitment to maintaining best practice in assessment, CIE has begun to use different variants of some question papers for our most popular assessments with extremely large and widespread candidature, The que
東京大学 - MATH - gcse
Location Entry CodesAs part of CIEs continual commitment to maintaining best practice in assessment, CIE uses different variants of some question papers for our most popular assessments with large and widespread candidature. The question papers are
Cornell - AEM - 2200
AEM220 Introduction to Business ManagementSpring 2006 Pedro David PrezPractice Prelim #1 This exam is composed of a mixture of multiple choice, matching, and true/false questions. 1. According to Max Weber, the basis of the authority of a manager
Cornell - AEM - 2200
Chapter 1 Online and Notes 1. Business- any activity that seeks to provide goods and services to others while operating at profit. 2. Profit- the amount of money a business earns above and beyond what it spends for salaries and other expenses. 3. Ent
Cornell - AEM - 2200
Chapter 7 Outline and Notes Managerial Challenges 1. Managers roles are changing in the terms that they now have to be more skilled and educated than in the past. 2. Management- the process used to accomplish organizational goals through planning, or
Cornell - AEM - 2200
Chapter 18 Outline Accounting is the recording, classifying, summarizing, and interpreting of financial events and transactions to provide management and other interested parties the information they need to make good decisions. The accounting profes
Cornell - AEM - 2200
Chapter 19 Outline Finance is the function in business that acquires funds for the firm and manages those funds within the firm. Financial Managers plan, audit, budget, manage taxes, obtain funds, control funds, collect funds and advise top managers
Cornell - GOVT - 2827
About Face, James Mann outline China was important to the US not because of the help during the cold war anymore but, because of the potential harm it may do. (pg. 228) China was granted MFN most-favorable-nation status, allowing trade and exports
Cornell - GOVT - 2827
Chapter 6 1. Public Opinion in Policy Making should be looked on at three main levels for a. Elite i. Differences of opinions among elite political actors. Such differences mean that the preferences of supreme leaders are subject to change. Elite con
Cornell - GOVT - 2827
Same Bed, Different Dreams Turning Point 1: Tiananmen The president generally feels the same way about the Tiananmen incident as much as the people but, he also believes deeply in preserving the relationship between the two countries The president
Cornell - GOVT - 2827
Suisheng Zhao Outline Nationalism is indispensable and a rational choice for advancing Chinas national interest. Almost all powerful Chinese were nationalist in the sense that they all shared a bitterness of the past and wanted to rejuvenate
Cornell - GOVT - 2827
The Struggle for Mastery in Asia By: Aaron Friedberg First No matter how china does economically or its political system changes, over the next couple of decades they will not collapse. Second China wants to become the preeminent Asian power, wh
Cornell - GOVT - 2827
Trouble in Taiwan By: Michael Swaine Having pledged in April 200l to do &quot;whatever it takes&quot; to help Taiwan defend itself, Bush changed tack, reaffirming U.S. support for maintaining the status quo in the Taiwan Strait. The Chinese government bel
Bryant - MKT - mkt 461
Ch 1: Product Manager o (Book)Term applies to different kinds of organizational structures and different kinds of companies, whether they provide consumer goods, industrial products, or services. o In charge of a single product or closely related pr
UCSB - ECE - 15A
Solutions to Homework #1ECE 15a 1. (a) (ab+bc)(ab+ac+bc) = ab(ab+ac)+bc = aab+abc+bc = abc+bc = abc+(a+1)bc = a(b+b)c+bc = ac+bc (b) (x+y)(x+y)(x+y)(x+y) = (xx+y)(xx+y) = yy = 0 2. (a) xy+zw = (xy+z)(xy+w) = (x+z)(y+z)(x+w)(y+w) (b) ax+ay(x+z) = a(x
UCSB - ECE - 15A
Solutions to Homework #2ECE 15a 1. x+xy = x.1+xy = x(1+y) = x.1 =x (2-4D) (2-11) (2-5) (2-4D) Winter 20092. x y: 0 0 = 0, 0 1 = 1, 1 0 = 1 and 1 1 = 0. (a) x y = (x+y)(xy)? x, y (x+y) (xy) (x+y)(xy) x y 00 0 1 0 0 01 1 1 1 1 10 1 1 1 1 11 1
UCSB - ECE - 15A
Homework #3 SolutionsECE 15a Winter 2009Solution 1: (a). f = (u+v) (uv + uw) = (u+v) [ ( u+v ) ( u+w) ] = (u+v) (u+v) (u+w) = (uv + uv) (u+w) = v (u+w) = uv(w+w) + (u+u)vw = uvw + uvw + uvw + uvw = uvw + uvw + uvw(b). g = xyz + (x+y) (x+z) = xyz
UCSB - ECE - 15A
Homework #6 SolutionsECE 15A, Winter 2009 1) Z = BF + CEF + ACDF= B F E C A D2) NAND Onlya b c d e g hz3) NOR Onlya b c d e g hz4) Realize Z=A[BC+D+E(F+GH)] using NOR gates.A B C D E F G HZ5) F(a,b,c,d) = m(0,1,5,7,10,11,14,15)
UCSB - ECE - 15A
Homework #4ECE 15a1. p q = pq + pqWinter 2009pqpqpqpqpqpq + pq2. a. Expand the following diagram (only XOR and AND) to obtain the expression for p + q:pqThe above diagram can be expressed as, [p (pq) ] q - 1 It can be
UCSB - ECE - 15A
Homework#5SolutionsECE15A,Winter2009 1)F(a,b,c,d)=m(2,3,4,5,6,7,9,12,15)+d(1,10,13) abcd F m0 0000 m1 0001 x m2 0010 1 m3 0011 1 m4 0100 1 m5 0101 1 m6 0110 1 m7 0111 1 m8 1000 m9 1001 1 m10 1010 x m11 1011 m12 1100 1 m13 1101 x m14 1110 m15
UCSB - ECE - 2B
UCSB - ECE - 2B