DOC PREVIEW
SJSU ME 30 - lab5_functions_1_F09

This preview shows page 1-2-3 out of 9 pages.

Save
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

SAN JOS STATE UNIVERSITY Department of Mechanical and Aerospace Engineering ME 30 Computer Applications Lab Project 5 Functions Part 1 Introduction In this lab session we ll learn about functions and how they can be used to modularize programs Objectives Following completion of today s lab you should be able to Describe the structure of a function including its return type and argument data types Describe what is meant by calling a function and returning from a function call Write and use a function in a C program Procedure The procedure for submitting your report will like the previous lab see below Fill out the answer sheets by typing your work in the soft copy version of this document Note everyone must turn in an individual lab report at the end of the session Download a copy of this document and fill out the cover sheet completely before starting on your answer sheets Points will be deducted if the cover sheet is not completely filled out When you complete your laboratory report save the file in pdf form and upload the pdf to the Lab 5 Assignment in Blackboard Cut and paste your source code into the table below in the cell denoted Implementation Put a cropped screenshot of the output window below your code If your program is too long to fit in the table cell put it on its own page with results below it Example File hello c Print Hello world on the screen include stdio h int main printf Hello world n return 0 When you write your programs use the structure shown in lecture and also demonstrated in the miles to kilometers c program available on the ME 30 website http www engr sjsu edu bjfurman courses ME30 source miles to kilometers c Under the section of the cover sheet labeled Description summarize the problem s you solved You must also include a summary of the strategy you used as well as the methods you employed and any observations or conclusions about what you learned from the laboratory This is perhaps the most important part of the lab so do a good job on it Note that you are not limited to fitting the summary on the cover sheet You can expand the summary to another sheet if needed Save your work on your own USB storage device before you leave the lab The hard drives on the computers in the lab are frequently refreshed so you ought not rely on them for saving your work from session to session BJ Furman ME 30 Computer Applications Week4Labproject 12SEP2009 doc 20SEP2009 Page 1 of 9 SAN JOS STATE UNIVERSITY Department of Mechanical and Aerospace Engineering ME 30 Computer Applications To get credit for this lab project you must also save your work on the desktop of the computer you used in the E407 lab using the following procedure Save your report using the following naming convention all lower case lastname firstinitial sec n lab5 report pdf where n is your lab section number Tues 2 Wed 3 Thurs 4 so if your name is John Smith and you are in section 3 you must name your file smith j sec 3 lab5 report pdf Upload your report and any related files to Blackboard under the Lab 4 Assignment IMPORTANT Try to complete the lab project by the end of the laboratory session If you are unable to complete it by then you can submit it via Blackboard by midnight on the day of your lab and not be penalized for being late If you are unable to submit by midnight on the day of your lab you will be allowed to submit via Blackboard until the cutoff date but only for a possible maximum of half credit Assignments will not be accepted beyond the cutoff date time set in Blackboard References Cheng H H 2010 C for Engineers and Scientists An Interpretive Approach McGraw Hill New York ISBN 978 0073376059 BJ Furman ME 30 Computer Applications Week4Labproject 12SEP2009 doc 20SEP2009 Page 2 of 9 First Initial Last Name SAN JOS STATE UNIVERSITY Department of Mechanical and Aerospace Engineering ME 30 Computer Applications Proj Lab Project Report Cover Sheet Date Name print Last Name First Name Partners Project Title Description BJ Furman ME 30 Computer Applications Week4Labproject 12SEP2009 doc 20SEP2009 Page 3 of 9 Last Name First Initial SAN JOS STATE UNIVERSITY Department of Mechanical and Aerospace Engineering ME 30 Computer Applications 1 Functions Exercise 1 Continuation from 9 21 09 lecture 1 1 Write a program to print out two happy or sad faces depending on input from the user The program specifications are Continuously prompts the user for input unless a q or a Q is entered at the keyboard in which case the program stops Prints two happy faces if the user enters Prints two sad faces if the user enters Program must handle the printing of the faces using calls to two functions happy face for the two happy faces sad face for the two sad faces Demonstrate that it works Don t forget to enter your pseudocode for the table entry Algorithm No Problem Description and Analysis type below Data Requirements type below Problem Inputs Problem Outputs Algorithm type below BJ Furman ME 30 Computer Applications Week5Labproject 20SEP2009 doc 21SEP2009 Page 4 of 9 Last Name First Initial SAN JOS STATE UNIVERSITY Department of Mechanical and Aerospace Engineering ME 30 Computer Applications No Implementation your program and output Score for Grader s use Specifications Readability Documentation BJ Furman ME 30 Computer Applications Week5Labproject 20SEP2009 doc 21SEP2009 Page 5 of 9 Last Name First Initial SAN JOS STATE UNIVERSITY Department of Mechanical and Aerospace Engineering ME 30 Computer Applications 2 Functions Exercise 2 2 1 Write a program named my initials that prints your first and last initials using the letters to form the characters in the order selected by the user So if your first and last initials are JF and the user selects the order first last your program would print J J J J JJ FFFF F FF F Your program should call two functions one that prints out your first initial and the second that prints out your last initial Your program does not need to accept arbitrary character input defining your initials but it needs to get input from the user to determine the order that the two characters are printed Demonstrate that it works Don t forget to enter your pseudocode for the table entry Algorithm No Problem Description and Analysis type below Data Requirements type below Problem Inputs Problem Outputs Algorithm type below BJ Furman ME 30 Computer Applications Week5Labproject 20SEP2009 doc 21SEP2009 Page 6 of 9 Last Name First Initial SAN JOS STATE UNIVERSITY Department of Mechanical and Aerospace


View Full Document

SJSU ME 30 - lab5_functions_1_F09

Download lab5_functions_1_F09
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view lab5_functions_1_F09 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view lab5_functions_1_F09 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?