# 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

### Structure of C and Functions

Course: CSCI 3133, Fall 2008
School: UH Clear Lake
Rating:

Word Count: 297

#### Document Preview

of Structure a C Program and Functions Q1. Given the following pseudocode, write a program that executes it. Use floatingpoint types for all values. Algorithm Problem1 1. Read x 2. Read y 3. Compute p = x * y 4. Compute s = x + y 5. Total = s2 + p * (s x) * (p + y) 6. Print the total End Problem1 Q2. If originally, x = 2, y = 3 and z = 1, what is the value of each of the following expressions? a) printf( the...

Register Now

#### Unformatted Document Excerpt

Coursehero >> Texas >> UH Clear Lake >> CSCI 3133

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.
of Structure a C Program and Functions Q1. Given the following pseudocode, write a program that executes it. Use floatingpoint types for all values. Algorithm Problem1 1. Read x 2. Read y 3. Compute p = x * y 4. Compute s = x + y 5. Total = s2 + p * (s x) * (p + y) 6. Print the total End Problem1 Q2. If originally, x = 2, y = 3 and z = 1, what is the value of each of the following expressions? a) printf( the value is : %d , x++ + y++ ); b) printf( the value is : %d , ++x - --z ); c) printf( the value is : %d , --x + y++ ); d) printf( the value is : %d , x-- + x-- - y-- ); e) printf( the value is : %d , x + y-- - x + x++ - --y ); f) printf( the value is : %d , x + 2 / 6 + y ); g) printf( the value is : %d , y - 3 * z + 2); h) printf( the value is : , %d z - (x + z ) % 2 + 4); i) printf( the value is : %d , x - 2 * ( 3 + z) + y ); j) printf( the value is : %d , y % 2 * z % x ); Find any errors in the following function definition: int ( fun( int x, y ) { int z; return z; } Q3. Q4. Find any errors in the following function calls: a) void fun(); b) fun(void); c) int fun( int x, int y ); d) fun(); Q5. Write a function to convert inches into centimeters (one inch is 2.54 centimeters). Then write ...

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:

UH Clear Lake - CSCI - 3133
Logical Data in CData is called logical if it conveys a value of true or false. If a data value is zero, it is considered false. If a value is non-zero, it is considered true.1Logical operatorsThe relational operators are the Logical AND, Logic
UH Clear Lake - CSCI - 3133
Selection Making DecisionsQ1. Evaluate the following expressions to true or false. Show how you arrived at your answer by first adding the default parentheses. a) b) c) d) Q2. !( 3 + 3 &gt;= 6) 1 + 6 = 7 | 3 + 2 = 1 1 &gt; 5 | 6 &lt; 50 &amp; 2 &lt; 5 6&lt;7&gt;5If ori
UH Clear Lake - CSCI - 3133
Programming Assignment 2Write a C program to calculate the parking fare for customers who park their cars in a parking lot when the following information is given: a) b) c) d) e) A character showing the type of vehicle: C for car, B for bus and T fo
UH Clear Lake - CSCI - 3133
Repetition in Programming1Concept of a LoopThe following is a concept of a loop:Series of actionsThis a a continuous loop. To make sure that it ends, we put conditions to control the loop.2Pre-Test and Post-Test LoopsIn a pre-test loop,
UH Clear Lake - CSCI - 3133
RepetitionQ1. What will be printed from each of the following program segments? a) int x = 12; while ( x &gt; 7 ) { printf( &quot;%d\n&quot;, x ); } b) for ( int x = 12; x&gt; 7; ) printf( &quot;%d\n&quot;, x ); c) int x = 12; while ( x&gt; 7 ) { printf( &quot;%d\n&quot;, x ); x-; } d) i
UH Clear Lake - CSCI - 3133
Recursion1RecursionA function is said to be recursive if it calls itself, either directly or indirectly. void repeat( int n ) { cout &lt; n &lt; &quot; &quot;; repeat( -n ); }Recursion contd.Simple recursive routines follow a standard pattern. Typically ther
UH Clear Lake - CSCI - 3133
CSCI3133CProgramming Prof.KAbeysekera Tutorialonhowtowrite,compileandrunaC programinVisualStudio2008. 1)Start&gt;Programs&gt;MicrosoftVisualStudio2008&gt;VisualStudio 2)3)ClickonFile&gt;New&gt;Project4)ProjectTypeshouldbe:VisualC+&gt;General&gt;EmptyProject
Oregon State - BA - 372
BA372 Team Project Peer EvaluationPlease assign a 0-10 grade to the members of your team reflecting their contribution to the team's accomplishments in the BA372 team project (0: no contribution; 10: perfect contribution) ! Do not grade yourself !
Oregon State - BA - 372
Vision &amp; Scope (Template)5/13/2009Business Solutions Group1T able of ContentsRevision SheetDate Author Version Comment21. BackgroundA description of the current state and pertinent history of where the business is today.2. Driving F
University of Hawaii - Hilo - BIOLOGY - 101
Causes of Death United States Lecture 31Natural Causes 48% 41%Genetics &amp; MedicineLifestyle &amp; Environmental19902000Lifestyle &amp; Environmental - 2000firearms 3% motor vehicle crashes 4% toxic agents 5% microbial agents 6% alcohol consumption
University of Hawaii - Hilo - BIOLOGY - 101
Lecture 31Causes of Death 199059% 41%Natural Natural causes causesGenetics &amp; MedicineLifestyle &amp; Lifestyle &amp; Environmental EnvironmentalFirearms 4% Alcohol 11%Unsafe Sex 3% Drugs 2%Lifestyle &amp; Environment1 out of 4 people alive today
American - MP - 7645
NonImmigrant Visa Refusal Rate: The Making of a 214(b)Michael Pannone1 SIS, American University 3829 Warren Street N.W. Washington, DC 20016 michael.pannone@gmail.comAbstract It is the responsibility of American consular officers worldwide to det
American - MP - 7645
NonImmigrant Visa Refusal Rate: The Making of a 214(b)Michael Pannone1 SIS, American University 3829 Warren Street N.W. Washington, DC 20016 michael.pannone@gmail.comAbstract It is the responsibility of American consular officers worldwide to det
American - MP - 7645
Democracy in the Middle EastImages from bertrandrussell.blogspot.com, AP photo and AFP.History 1970s: U.S. main interest: access to petroleum required stable political situation however, no formal policy of democratization was implemented 19
American - MP - 7645
Michael PannoneThe Limited Prospects of Exporting Kuwaiti Democratic Reform to QatarIntroduction and Overview It is a common misperception to observe the parliamentary developments in postliberation Kuwait as an anomaly. Kuwaits geographic locatio
UC Riverside - PDF - 0708
IMPORTANT OPPORTUNITY TO AFFECT DECISION MAKING FOR CALIFORNIAS HEALTH CARE REFORMIf you would like the chance to let legislators and the governor know what you think about the current health care system, including rising costs and access issues, th
UC Riverside - PDF - 0708
UC Riverside - PDF - 0708
Objectives: ScheduleBring various API youth groups together throughout California. To hear each others voices within the youth API communities. To celebrate our similarities and diversities. To identify issues within the youth API communities. To e
UC Riverside - PDF - 0708
Objectives: - Bring various API youth groups together throughout California. - To hear each others voices within the youth API communities. - To celebrate our similarities and diversities. - To identify issues within the youth API communities. - To e
UC Riverside - PDF - 0708
The conference will be an important dialogue concerning the place of the Asian American and Pacific Islander community in education policy discourse. As a growing minority population in the state of California and the nation, Asian American and Pacif
UC Riverside - PDF - 0708
UC Riverside - PDF - 0708
WOMEN of COLOR PanelHearing Our VoicesThe issues that affect queer women of color are rarely heard about outside of the LGBT community. Join us as we have an open discussion and hear from panelists about how such an identity affects a woman's perso
UC Riverside - PDF - 0708
UC Riverside - PDF - 0708
APSP Student Coordinator Job Descriptions244 Costo Hall, University of California, Riverside Riverside, CA 92521 951-827-7272The Asian Pacific Student Programs Office is currently searching for student coordinators for the 2008-2009 academic year.
UC Riverside - PDF - 0708
2007 Southwest Regional Women of Color and Allies Summit Registration FormWho: Individuals and organizations interested in diversityand working more effectively with communities of color Where: Cal Poly Pomona, Recital Hall When: November 17, 2007
UC Riverside - PDF - 0708
Asian Pacific Student ProgramsAPIWMP APIWMP GoalsPERSONAL: KNOW YOURSELF.Student Coordinators (2007 - 2008) Ashley Jo Navarro Hue NguyenAsian Asian &amp; Pacific Islander Womens Mentor ProgramAPIWMPs MissionTo provide a network of resources and
UC Riverside - PDF - 0708
Student Program Coordinators Alex Kou Frank HiroyasuLisa ChanLorraine ChanAPSP also co-sponsors a variety of cultural and educational programs that celebrate and raise awareness of current and historical Asian and Pacific Islander experiences.
UC Riverside - PDF - 0708
Manzanar The Legacy Continues39th AnnualManzanar PilgrimageSaturday, April 26, 2008Program starts at 12 noonManzanar At Dusk starts at 5:00 pmFor pilgrimage information, see reverse side, or visit: www.manzanarcommittee.org For bus informat
Delaware - COMM - 245
Columbia - WW - 3106
IEOR 3106: Introduction to Operations Research: Stochastic Models Fall 2006, Professor Whitt Class Lecture Notes: Tuesday, October 24. Continuous-Time Markov Chains, Ross Chapter 6 Problems for Discussion and Solutions1. Pooh Bear and the Three Hone
UCSB - CREATE - 240
ProjectMidi file inTempo ChangerMidi file outMidi FileMidi EventAcoustic InfoTempo InfoScrew the acoustic info Get and alter the tempo infoJava MidiHow does Java Store midiSequence Tracks Midi EventAcoustic InfoTempo InfoJav
Cameron University - MAC - 3013
vti_encoding:SR|utf8-nl vti_title:SR|Numerical Problems vti_cachedlinkinfo:VX| vti_cachedhastheme:BR|false vti_cachedhasborder:BR|false vti_filesize:IX|29696 vti_cacheddtm:TX|28 Oct 2002 12:27:28 -0600 vti_backlinkinfo:VX|mac3013/assignment.htm vti_c
Cameron University - MAC - 3013
vti_encoding:SR|utf8-nl vti_author:SR|abduls vti_title:SR|Numerical Problems vti_cachedlinkinfo:VX| vti_cachedhastheme:BR|false vti_cachedhasborder:BR|false vti_timecreated:TR|28 Oct 2002 12:27:27 -0600 vti_filesize:IX|29696 vti_modifiedby:SR|abduls
Mt. Holyoke - POL - 116
WorldPolitics116 Fall2000 WebPagesNameAbbasi Hiba Anderson E. Barry Hope Barwick Ruth Belmase Sonam Boadi Tina Boisseau Michelle Branisteanu Lleana Cafa Raluca Catalano Claudia Chan Grace Colburn Omalene Dean Katie Dudczak Becky Duertg Kerry Dulami
Uni. Westminster - WVJ - 0805
l
Uni. Westminster - WVJ - 0805
DO NOT MAIL THIS WORKSHEET.You must complete and submit a Free Application for Federal Student Aid (FAFSA) to apply for federal student aid and to apply for most state and college aid. Applying online with FAFSA on the Web at www.fafsa.ed.gov is fas
Uni. Westminster - IRM - 0805
cashflowcomparisonbudgetedvs.actualJune budgeted actualcashbalance(startofmonth) cashreceipts cashsales cashexpenditures advertising wages supplies totalcashexpenditures netcahflow cashflow(endofmonth)\$4,500 \$12,600 1,200 7,200 3,600 \$12,000 \$6
Uni. Westminster - IRM - 0805
ID# YEAR MAKE TYPE ODOMETER DEPARTMENTASSIGNED PRICE&quot; MAINTENANCE COSTANNUAL&quot; 87 1991 FORD SEDAN 37780 Police&amp;Security 195 1995 FORD TRUCK 19870 Telecomm 503 1999 CHEVROLETSEDAN 8900 Police&amp;Security 678 1981 FORD PICKUP 73419 Housing&amp;ResidentialLife
Uni. Westminster - IRM - 0805
Sales and Expense Summary - East Region 2005 Beginning Week Ending Meals Telephone Hotel Airfare Car Rental Gas Miscellaneous Mileage 1/1/05 161.73 83.89 523.16 0 0 91.82 153.96 16153 1/8/05 255.89 50.89 653.09 0 0 38.54 119.85 16940 1/15/05 343.07 1
Uni. Westminster - IRM - 0805
caridmake model odomet purchased 112 toyota camry 35650 May02 7May 114 toyota camry 34560 Sep07 12Sep 115 mazda 626 30128 Jan03 8Jan 117 toyota tercel 28900 Mar03 8Mar 118 lexus infinity 26546 Jan04 9Jan averagedriven 600 cost perform tuneups 185 1
Uni. Westminster - IRM - 0805
Town of BalticAuthor Date Purpose: William Jemison 10/3/2007 To record and summarize vacation and family leave data for employees of Town of BalticName Abba Abbot Adtkins Andrews Baker Berg Bergeman Blake Bliss Borchardt Captian Carey Chi Chou Chr
Uni. Westminster - IRM - 0805
Bowls Department Store Author Date William Jemison 9/17/2007Purpose To manage total sales more effectively.Year2010ProductGroup Automotive Automotive Automotive Automotive Automotive Automotive Automotive Automotive Automotive Automotive Auto
Uni. Westminster - IRM - 0805
Inputarea Rexincome annual mitsyincometeaching mitsyincomeswimmingsup rent carpymnts gas utilities(Nov,Dec,Jan,Feb,Mar) utilities(Apr,May,June,July,Aug,Sept,Oct) taxes(paidinmay) schoolloans tuition/books(paidinAug,Nov,Feb,May) food entertainment clo
Uni. Westminster - IRM - 0805
Input areaDate Expense Type 6/1/06 Meals 6/5/06 Travel 6/6/06 Meals 6/6/06 Entertainment 6/7/06 Travel 6/7/06 Meals 6/8/06 Travel 6/8/06 Meals 6/15/06 Meals 6/15/06 Entertainment 7/2/06 Meals 7/5/06 Entertainment 7/7/06 Entertainment 8/1/06 Meals 8/
Uni. Westminster - IRM - 0805
TalentTracs Author Date Purpose TotrackemployeedataoncompensationandbenefitsAdd Job ID LastName 1024 Hovey 1025 Overton 1026 Fetherston 1027 Lebrun 1028 Hanson 1029 Philo 1030 Stolt 1031 Akhalaghi 1032 Vankeuren 1033 Mccorkle 1034 Nightingale 1035
Uni. Westminster - IRM - 0805
IRM200 - Group Member Participation FormNAME: _ Student Name Will JemisonParticipation Level (see scalebelow)Comments I worked in my own group.4Participation Level Scale 4 - Student Contributed Greatly to the Group 3 - Student Contributed So
Uni. Westminster - IRM - 0805
InBurger Author Date Purpose WillJemison 9/23/2007InBurger'sSalesbyStoreandProduct CasesSoldProducts Popgo DietPopgo Mt.Spring RedBurst DrSelsa SunMaid Totals Elteron 515 435 235 125 160 325 1795 Mesa Franklin Grant Grover Totals 545 560 670 510 2
Uni. Westminster - IRM - 0805
InBurger Author Date PurposeJanuary February March April May June July August September October November DecemberWillJemison 9/23/2007In Burger's Sales by Store and Product Cases SoldBreakdownbyProducts products casessold percent Popgo 9865 29%
Uni. Westminster - IRM - 0805
Town of BalticAuthor Date Purpose: To record and summarize vacation and family leave data for employees of Town of BalticName Abba Abbot Adtkins Andrews Baker Berg Bergeman Blake Bliss Borchardt Captian Carey Chi Chou Christain Clarke Crawford Cze
Uni. Westminster - IRM - 0805
Prime Realty Author: Date: Purpose: Carol Malloy 6/19/2009 To calculate loan information assuming a constant yearly rateMortgage Analysis WorksheetSummary Information Loan \$250,000 Rate 7.50% Years 20 Per Year 12 Total Payments 240 Monthly Paymen
Uni. Westminster - IRM - 0805
input FebruaryMarch april may june \$400,000.00 \$500,000.00 \$600,000.00 \$700,000.00 \$800,000.00 SalesCollected1stmonth 20% Salescollected2ndmonth 50% Alsoallremainingrevenuescollected SalesCollected3rdmonth 30% rent \$10,000.00 Purchaseofsalespaid1mo
Uni. Westminster - IRM - 0805
inputarea sales variablecost fixedcost salesvolumeunits salesprice(each variablecost(each) salesvolumeincrease salespriceincrease variablecostincrease fixedcostincrease200000 150000 20000 1000 200 150 105% 103% 10.00 103%sales variablecost fixedc
Uni. Westminster - IRM - 0805
inputarea sales variablecost fixedcost salesvolumeunits salesprice(each variablecost(each) salesvolumeincrease salespriceincrease variablecostincrease fixedcostincrease200000 150000 20000 1000 200 150 5% 3% 10 3%sales variablecost fixedcost netin
Uni. Westminster - IRM - 0805
TalentTracs Author Date Purpose TotrackemployeedataoncompensationandbenefitsAdd Job ID LastName 1024 Hovey 1025 Overton 1026 Fetherston 1027 Lebrun 1028 Hanson 1029 Philo 1030 Stolt 1031 Akhalaghi 1032 Vankeuren 1033 Mccorkle 1034 Nightingale 1035
Uni. Westminster - IRM - 0805
INVOICEEugeneCommunityTheatre 800MonroeStreet Eugene,OR70777 Date: 7/15/2010 Subscriber Address CityStateZip Phone TicketQuantity Series Location TicketCost Handling Parking Donation Total KateHolland 186PinetopDrive Eugene,OR70777 (888)5551234 2 D
Uni. Westminster - WVJ - 0805
10/16/07 5:05PM - Today is this first day that I am going to write for twenty minutes. I have decided to write for twenty minutes everyday because of a book which I recently purchased at Borders this weekend. The book I purchased was for sales. For m
Uni. Westminster - WVJ - 0805
1:51 P.M 10/17/07- today I slept in because I was exhausted from working hard on my project in my computer class. I do have to admit I do not think I am enjoying the class as much as I thought. I have always thought I had a love for computers but thi
Uni. Westminster - WVJ - 0805
12:45- 10/18/07-Today is fall break for school. So I guess in theory I should not be working on homework and things of that nature like the traditional college student. But wait one minute. There is a problem. I am not the traditional student. When i
Uni. Westminster - WVJ - 0805
William Jemison Marketing 303 Chapter 5 Sales application question 6. 1-A) There are two non verbal signals that the buyer are engaging in, which are leaningback in their chair and having a puzzled look on their face. The buyer is using caution sig
Uni. Westminster - WVJ - 0805
William Jemison Marketing 303 Chapter 14Sales Application Question8. D. I believe this is the most appropriate action to take. The first reason why it is the most appropriate action to take is because Tom is expecting the good that very day, which
Uni. Westminster - WVJ - 0805
Will Jemison Marketing 303 Chapter 15Sales Application Question5A) Sales = \$500,000 Cost of Goods Sold-500,000*.65= 325,000 Gross Profit- (500,000- 325,000)= 175,000 Gross Profit percentage- 175,000/500,000= .35 Sales direct cost =35,000 Break eve