# Register now to access 7 million high quality study materials (What's Course Hero?) Course Hero is the premier provider of high quality online educational resources. With millions of study documents, online tutors, digital flashcards and free courseware, Course Hero is helping students learn more efficiently and effectively. Whether you're interested in exploring new subjects or mastering key topics for your next exam, Course Hero has the tools you need to achieve your goals.

2 Pages

### quiz8_sol

Course: CS 010, Spring 2008
School: UC Riverside
Rating:

Word Count: 602

#### Document Preview

010 CS Intro to Computer Science I Spring - 2008 Quiz 8 Friday 5/30 SOLUTION 1. What is the value of inner_count after the following code executes? (Assume n and m have been previously declared and assigned values, and inner_count &amp; outer_count declared &amp; initialized to 0). for (int i = 0; i &lt; n; i++){ outer_count++; for (int j = 0; j &lt; m; j++){ inner_count++; } } a. 0 b. n c....

Register Now

#### Unformatted Document Excerpt

Coursehero >> California >> UC Riverside >> CS 010

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.
010 CS Intro to Computer Science I Spring - 2008 Quiz 8 Friday 5/30 SOLUTION 1. What is the value of inner_count after the following code executes? (Assume n and m have been previously declared and assigned values, and inner_count & outer_count declared & initialized to 0). for (int i = 0; i < n; i++){ outer_count++; for (int j = 0; j < m; j++){ inner_count++; } } a. 0 b. n c. m d. n + m e. n * m f. n + m + 1 2. Which of the following statements has a syntax error, given n1 is an integer variable, d1 is a double variable, and s1 is a string variable? a. n1 = func1(10, 20.0, "abc"); b. cout << func1(func2(n1),d1,s1); c. if (func3(n1)) cout << s1; d. func2(n1); e. func2(func1(n1, d1, s1)); f. b) and e) 3. Which is the BEST choice for the declaration of a function which raises the salary of an Employee object by raise %? a. b. c. d. e. f. Employee raise_sal(double); void raise_sal(Employee&, double); void raise_sal(const Employee&, double); Employee raise_sal(Employee&, double); void raise_sal(Employee&, double&); int raise_sal(Employee, double); 4. Which of the following conditional expressions is exactly equivalent to: ( !(country == "USA" and state != "AK" and state != "HI") ) a. b. c. d. e. f. ( ( ( ( ( ( country country country country country country != == != == == == "USA" "USA" "USA" "USA" "USA" "USA" or state == "AK" or state == "HI" ) or state == "AK" or state == "HI" ) and state == "AK" and state == "HI" ) and state == "AK" and state == "HI" ) or state != "AK" or state != "HI" ) and state != "AK" and state != "HI" ) 5. The function rand(), defined in the <cstdlib> library, generates "pseudo-random" numbers. Which of these expressions would return a value random in the range (0.000, 0.999)? a. ( rand() % 1000 ) / 1000 b. ( rand() % 1 ) / 1000 c. ( rand() / 1000 ) d. ( rand() % 1 ) e. ( rand() % 1000 ) / 1000.0 f. ( rand() / 1000.0 ) % 1000 6. A function that is effectively empty and returns a trivial value is often used to allow a program to compile while testing the main or other parts of the program. It is called: a. an algorithm b. an abstraction c. a black box d. a driver e. a stub f. a unit test 7. A "test harness" is used to perform unit tests on a program. Which of the following can provide appropriate test coverage? a. Keyboard input b. File input c. Sequential values generated in a loop d. Randomly generated values e. All of the above f. None of the above 8. If x is negative, the statement assert(x >= 0); a. does nothing. b. outputs a warning and continues executing the program. c. outputs a warning, sets x equal to 0 and continues executing the program. d. terminates the program, and displays the file name, line number, and expression. e. returns the value false. f. aborts the function in which the statment occurs 9. Which of the following expressions would you use to test input from the keyboard for validity? a. valid(cin) b. cin.valid() c. fail(cin) d. cin.fail() e. cin << fail f. either c) or d) 10. A global variable is: a. a variable that is declared in the main function b. a variable that is declared as datatype "global" c. a variable that is declared inside a function of global scope d. a variable that is declared outside of any function e. available to all functions declared after it f. both d) and e) 11. What level of programming experience did you have coming into this course? (Note: please answer ALL that apply) a. b. c. d. e. f. Basic computer literacy, no programming knowledge at all HTML JavaScript Visual Basic or MatLab (High School course or equivalent) Java (High School course or equivalent) C++ (High School course or equivalent)
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:

UC Riverside - CS - 010
CS 010 Intro to Computer Science ISpring - 2008Quiz 7 Friday 5/23SOLUTION1. What is the difference between a parameter and an argument, in the context of functions? a. The value of an argument must be known at compile time, the value of a p
UC Riverside - CS - CS10
CS 010 Intro to Computer Science I Midterm practice examEach question is worth 1 point.1. What will be output by the following code fragment?Fall - 2007SOLUTIONdouble f = 123.4567 cout &lt; fixed &lt; setprecision(5) &lt; f &lt; &quot; &quot; &lt; setprecision(1) &lt;
New Hampshire - HIST - 101
Chapter 3: Expansion &amp; Diversity: The Rise of Colonial America I. The New England Way A. Plymouth established in 1620 by Separatist Puritans (Pilgrims) 1. A City upon a Hill A. 1628: Puritan merchants get charter to settle North of Plymouth 1. 1629:
New Hampshire - HIST - 101
Chapter 4: Colonial Society Comes of Age 1660-1750 I. Restoration &amp; Rebellion 1. Stuart Policies A. Parliament passed Navigation Acts 1. 1660&amp;63: barred merchants from a. exporting except to England b. importing except from English ships 2. favored c
New Hampshire - HIST - 101
Chapter 5: The Road to Revolution 1744-1776 1 I. Imperial Warfare A. 1713-early 1740s: generation of peace B. 1740-1748: War of Austrian Succession C. 1758-1763: Seven Years' War D. Fused bonds between British &amp; Anglo-Americans 1. planted seeds of mi
New Hampshire - HIST - 101
I. Shakers A. Name derived from their convulsive religious dance B. Leader: Mother Ann Lee 1. 1774: emigrated to New Lebanon, NY 2. believed in: a. abstaining from sex b. the end of the world was imminent 3. got doctrine from trances &amp; heavenly visio
New Hampshire - HIST - 101
Chapter 15: Reforging the Union: Civil War I. Mobilizing for War A. Recruitment and Conscription 1. At first, army raising was local w/ elections a. informal/democratic technique conformed to national tradition but war put stress on tradition 2. Sout
New Hampshire - HIST - 101
Chapter 16: The Crises of Reconstruction, 1865-1877 A. Black Institutions 1. Freed blacks' desire for independence led to postwar black churches a. African Methodist Episcopal church 2. Churches provided relief, raised funds for schools, &amp; supported
New Hampshire - HIST - 101
Chapter 17: pg. 557-661 I. Cowboys and the Cattle Frontier A. Stories romanticized cowboy life 1. glorified cowboys as men of integrity &amp; self-reliant strength 2. transformed cattle industry in 1860s and 70s B. 1868: Joseph G. McCoy 1. Started a huge
New Hampshire - HIST - 101
Defending America's World Role Wilson's call for war in 1917 Intensified US involvement in Asia and Latin America After Spanish-American War and occupation of Philippines The Roosevelt Corollary in Latin America and the Balance of Power in As
New Hampshire - HIST - 101
11. Explain the structure of the European alliance system on the eve of World War I. Who were the member nations of the Central Powers and of the Allied Powers?The Central Powers were Germany and Austria-Hungary. The Allied Powers were Great Brita
New Hampshire - HIST - 101
1 IV. The Middle Colonies A. New Netherland &amp; New Sweden: small commercial outposts B. 1664: England seized New Netherland from Dutch C. 1681: King Charles II authorized new colony where New Sweden was 1. New York, New Jersey, Pennsylvania 1. Precurs
San Diego State - MATH - 534A
Suppose that S is a nonempty set of real numbers that is bounded and that inf(S) = sup(S). Prove that the set S consists of exactly one number. Proof: S is a nonempty set of real numbers that is bounded above and below. Therefor by the Completeness A
Mansfield - PHIL - any
Robert McLaughlinThe Four ParadigmsSince the beginning of time, people have been faced with ethical and moral choices that have tested their mental fitness in the ability to make the right choice. Sometimes it's a small choice like &quot;should I eat
Mansfield - PHIL - any
Robbie McLaughlin Philosophy Essay 2 November 7, 2007EvilsIn many religious faiths, the idea of God is of a higher infinite being of absolute good. God is supposedly a being of perfection, which never makes mistakes, and has a plan for every acti
USC - WRIT - 140
The U.S. believes (and rightly so) that America has one of the most effective, fair, and balanced legal systems in the world. Americans take great pride in their system's ability to resolve orderly dispute resolutions, protect the weak, and its abili
University of Texas - ENG - 316 K
Test 1 Lecture Notes: Lecture: 9-4-07Song: &quot;Desert Rose&quot; by Sting. His song brought Arabic history to present music. The native language is Iraqi Arabic, the language Gilgamesh was written in. &quot;I will proclaim to the world the deeds of Gilgamesh. Th
University of Texas - ENG - 316 K
Test 2 Lecture NotesLecture 10-11-07 &quot;Essays of Cannibals&quot; by Michael MontaigneThis text is about an aristocrat living in the southwest of France. He is a man of prestige identity. There is a place that belongs to him, a property holder. He misrepr
University of Texas - ENG - 316 K
Test 3 Lecture NotesLecture 11/8/07 &quot;The Queen of Spades&quot; by Alexander PushkinImages: A.S. Pushkins Petersburg: laborers dug canals at the edge of the city. St. Petersburg is a beautiful dangerous city. Founded in 1703, it is an ancient beautiful c
University of Texas - ENG - 316 K
E316K : FALL 2007 EXAM 2 CONCEPT REVIEW sxns 35515/35520 Thanks to the following folks for sharing their thoughts and ideas: Jessie Jang, Tracey Kaplan, Christine Wilson, Maria Barker, Jen Taylor, Karla Alba, Michelle Tan, Andy Lewis, Jessica Swengro
University of Texas - ENG - 316 K
Test 2 Lecture NotesLecture 10-11-07 &quot;Essays of Cannibals&quot; by Michael MontaigneThis text is about an aristocrat living in the southwest of France. He is a man of prestige identity. There is a place that belongs to him, a property holder. He misrepr
University of Texas - GOV - 310K
Two Kinds of Equality:Direct Democracy: The Citizens themselves are principal participants in making government decisions. Ex: Athens was rules by the assembly, a town-meting type of gathering that included all male citizens. The assembly met ten t
University of Texas - GOV - 310K
John Hibbing: 1991, a political scientists who conducted a comprehensive analysis of congressional careers. He found that the longer a representative serves in congress, the less attention he or she pays to constituency matters. The number of trips t
University of Texas - GOV - 310K
FROM LECTURE: Southern heritage Regionally, the South is more violent &amp; more religious, on social issues = more conservative in South; Since TX is a southern state, it is more violent &amp; more religious than other areas &amp; more conservative socially; c
Ramapo - HIST - 303
Nicole Peluso The Holocaust and the Media Dr. Michael A. Riff Film Critique The Diary of Anne Frank The Diary of Anne Frank was made in 1959 and directed by George Stevens. This movie derives from a true story of a German-Jewish girl, Anne Frank. Whe
Ramapo - ENGLISH - 101
Joseph F. Peluso Professor Gratale College English One 12/4/2007Five Hours of Credit For my first two hours of credit I watched A Bronx Tale. It related to class because one of the stories in the movie is about segregation. Cologero likes African A
Washington - STAT - 311
8-3 Testing a Claim Abt. A Proportion 17. In a study of store checkout scanners, 1234 items were checked and 20 checked items were found to be overcharges, and 1214 checked iterms were not overcharves. Use a .05 significance level to test the claim t
Washington - SIS - 200
Lecture V: Rise of Islam and Islamic CivilizationBISMILLAH IR-RAHMAN IR-RAHIM One of the most dramatic developments in the pre-1450post 800 world Middle East emerged as one of the key regions of the world Was Islamic civilization the ,first
Washington - SIS - 200
Lecture 10. AFRICA &amp; THE ATLANTIC WORLD: THE RISE OF THE PLANTATION SYSTEM/COMPLEXmost productive labor forced labor-i.e., slaves. Pop. not self-sustaining; Eu managerial staff &amp; Af. work force sustained by constant stream of new pop. 3. Agricultura
Washington - SIS - 200
CAPITALISM AND THE EXPANSION OF EUROPE, week 4, lecture 8Europe before European HegemonyEmergence in 14th-15th centuries Changes in Agriculture and Agrarian Economy Rise of Regional Monarchies Rise and Spread of Christianity Demographic Developmen
Washington - SIS - 200
10.1. Heyday of Imperialism: The Scramble for AfricaEra of &quot;High Imperialism,&quot; 1870-1914 All of Af, SEA, South Pacific colonized. Commerce, Civ, Christianity, Conquest Pre-1880 10% of Africa-coast W. Africa, S. Africa, Algeria; by 1900 onl
Washington - SIS - 200
The Challenge of the West?Facing the West. Not unidirectional move towards modernity or capitalist transformation. Relationship between European development and underdevelopment of colonized world? Did industrial development require slavery and colo
Washington - SIS - 200
Gender, States, and Capitalism, 1750-1914 Gender not sex or sexual difference because implicit in latter terms is a notion of biological determinism. Gender a social construction. Both men and women in their intimate and public relations are shaped
Washington - SIS - 201
Lecture 3: The International System th Century in the 19April 4, 2008Interaction Before 1914Politics: Balance of power, British supremacy, imperialism Economy: free trade, globalization, gold standard+ nationalismPoliticsCongress of Vi
Washington - SIS - 201
Lecture 10: The Cold War BeginsApril 21, 2008Bretton WoodsNew Institutions IBRD IMF ITOInternational Bank for Reconstruction and Development (IBRD)World Bank (loans for reconstruction and development) Lend to Europe at low rates Private lend
Washington - SIS - 201
Lecture 19: Triumphalism and the 1990sMay 12, 2008What now? Remake the world-again We won! Or they lost? Failure of Soviet political model Failure of empire Failure of Soviet economic model Stifle competition Misallocate resourcesTh
Washington - SIS - 201
Lecture 21: DemocratizationMay 16, 2008Democracies Today&quot;Waves of Democratization&quot; 1) 19th century (Western Europe, America) 2) Post-WWII (Africa, South Asia, Germany, Japan) 3) 1975-1992 (Southern Europe, Latin America, Eastern Europe) Re
Washington - SIS - 201
Lecture 7: WARApril 14, 2008End of Weimar &amp; Rise of the Nazis1924 Nazi vote 3.0 share1928 2.61930 18.31933 43.9Hitler's Ideology Racial superiority Living space (Lebensraum) Unswerving loyalty to the leader (fuhrerprincip) http:/ww
Washington - SIS - 201
Lecture 4: &quot;The War to End all Wars&quot;April 7, 2008Causes of WWI Power differentials Imperial rivalries Nationalism AlliancesHow the war started Assassination Alliances German war strategy (Schlieffen Plan)Sarajevo: June 28, 1914Results
Washington - SIS - 201
Lecture 14: The Third World in the Cold WarApril 30, 2008Background to InterventionsDecolonization Non-alignment (Bandung Conference, 1955)Bandung Conference, 1955Background to Interventions Decolonization Non-alignment (Bandung Co
Washington - SIS - 200
THEMES AND ISSUES Rise of states and capitalism Development of major civilizations and cultures and their increasing interactions thru economic, political, social, cultural, and religious contacts and exchanges. Differential rates of development
Washington - SIS - 200
SIS 200 States and Capitalism: The Origins of the Modern Global SystemFall 2007 Anand YangLecture II: Mongol EmpireBeginnings and Development Relationship between Nomadic and Sedentary Societies in Eurasia Climate Changes Role of founder, C
Washington - SIS - 200
SIS 200 Week 3: pre-1500 India, the Americas, and Early EuropeFall 2007 Anand YangDec. 2004 TsunamiLecture VI: Pre-1500 India and the Indian Ocean WorldEast-West trade network connecting the Mediterranean to the Pacific. Paralleled great ov
Washington - SIS - 200
NYT QUIZ, Oct. 10, 20071. Which country has recently increased its troops in Iraq in support of the U.S.? A. Georgia; B. Britain; C. Mongolia. 2. In which country will immigration feature as a major concern in national elections to be held later o
Washington - SIS - 201
Lecture 8: The War Ends-What Next?April 16, 2008Lend-Lease: The Garden Hose Parable&quot;Suppose my neighbors home catches fire and I have a length of garden hose four or five hundred feet away. If he can take my garden hose and connect it up with his
Washington - SIS - 201
Lecture 16: The Crisis-prone 1970sMay 5, 2008Detente Relaxation of tensions Arms reduction treaties Political and human rights agreements Helsinki Accords (1975) Jackson-Vanik Amendment (1975)Domestic CrisisThe Vietnam DebateConservative
Washington - SIS - 201
Lecture 25: The Post-Cold War World EndsMay 28, 2008A New Approach to Foreign Policy Realism-the old way Deal with the world as it is States seek security Domestic character of states not important Cautious in use of military International i
Washington - SIS - 201
Lecture 2 The International SystemApril 2, 2008Systemsan aggregation of units that interactComponents the units (states) relative power nature of interactionsUnitsStates: political units that maintain a monopoly of violence within the
Washington - SIS - 200
Please Note NEW YORK TIMES, Monday, Oct. 29thChandra Muzaffar, Noordin Sopiee Professor of Global Studies at the Science University of Malaysia and President of International Movement for a Just WorldMonday, October 29 Social Justice and Islam in S
Washington - SIS - 200
Gunpowder Empires: Ottoman, Mughal, Safavid, Russian, Ming-QingWeek 5Major Trends, 1500-1800Emergence of New Empires and Large States-gunpowder empires used naval and land based cannons to centralize control. Ref. originally to empires in Islami
Washington - SIS - 201
2 May 2008SIS 201The Making of the 21st CenturyThe Challenge of Postwar Development:Three ParadigmsWolfram Latsch, JSISThe Development ChallengeTimeline: 1947: Independence of India 1957-1980: African independenceChallenge:Industr
Washington - SIS - 201
D svidaniya ( ), Cold WarMay 9, 2008Victory Day http:/youtube.com/watch?v=LNSrDTJYjToWhy the Cold War Ended Structural factors Occupation of Eastern Europe Internal economic problems Afghanistan Oil prices Leadership: Gorbachev Reagan?
Washington - SIS - 201
Lecture 11: The Cold WarApril 23, 2008Extra Credit Opportunities! 2008 Spring Provost Distinguished Lecture Featuring Joel Migdal April 29, 7:00 pm - 9:00 pm Kane Hall Room 130 Fostering Democracy from the Ground Up: Combating World Poverty and t
Washington - SIS - 201
Lecture 9: Plans for a New OrderApril 18, 2008Taking stock Unprecedented levels of violence and scope of warTaking stock Unprecedented levels of violence and scope of war The &quot;paradox of modernity&quot;Number of Jews murderedTaking stock Unpr
Washington - SIS - 201
Extra Credit Opportunity! Read the two papers on the course website (http:/faculty.washington.edu/srad/sis201) Come to lecture on Friday Write a one-page (double-spaced) response paper Turn it in to your TA by 6/5/08How to Fix Failed States? S
Washington - SIS - 201
Lecture 26: Mission AccomplishedMay 30, 2008Significance of 9/11 for International System End of &quot;post-Cold War era&quot; Graduation of non-state actors into the system Symbolic strike for the &quot;rest&quot; against the &quot;west&quot; Radical attempt at US-dom
Washington - SIS - 201
Lecture 27: Things Fall ApartJune 2, 2008Questions That Should Have Been Asked Before the Invasion but Weren't Is Saddam deterrable? Is democracy so easy? What happens when a historically victimized group takes power? Effect on regional balan
Washington - SIS - 201
Making of 21st Century: View from Physics or Science, and Music (and International Relations) with Exuberance and Humility or Challenge for International Studies or What Is To Be Done?Guest Lecture for SIS201, May 23, 2008 Vladi Chaloupka, Professor
Washington - SIS - 201
Lecture 22: Failed StatesMay 19, 2008State Weber: legitimate monopoly of violence+ extract taxes provide public services 17th century: princes, war, taxes, consolidation Institutionalized at Westphalia Colonial boundaries retained after
Washington - SIS - 201
Lecture 5: The 1920sApril 9, 2008&quot;The Shi'i Crescent? Discordant Notes from the Field&quot;Augustus R. Norton, Professor of International Relations and Anthropology at Boston University220 Kane Hall Thursday, April 10 7:30 PM http:/www.youtube.com
Washington - SIS - 201
Lecture 6: The Lead-up to WarApril 11, 2008Implications of Bolshevik Revolution for the International System New ideology with state power New division in the world: class, not nation New kid on the block: the USSRThe Roaring Twenties Great D