1 / 11

CS 108 Computing Fundamentals May 1, 2014

CS 108 Computing Fundamentals May 1, 2014. Finishing Strong. Exam #4 is worth 250 points Use end-of-chapter material Chapters 10, 11, 12, 14, and 16 will be the focus I will e-mail an answer key to Exam #2 and #3 The open-book will not be a complete program

louvain
Télécharger la présentation

CS 108 Computing Fundamentals May 1, 2014

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS 108 Computing Fundamentals May 1, 2014

  2. Finishing Strong • Exam #4 is worth 250 points • Use end-of-chapter material • Chapters 10, 11, 12, 14, and 16 will be the focus • I will e-mail an answer key to Exam #2 and #3 • The open-book will not be a complete program • Instead, I will ask you to develop several function prototypes, calls, and declarations (one at a time) • Exam Date: Tuesday, May 6th • Exam Time: 8:00 AM – 10 AM • Exam Location: Kunsela A112 (Lecture Hall)

  3. Preparing For CS 240 • Be very comfortable with pointers and structures • Don't forget everything else we covered!! • Review using your textbook or online sources such as: http://www.howstuffworks.com/c.htm http://www.iu.hio.no/~mark/CTutorial/CTutorial.html • Get the CS 240 textbook before going home • Read CS 240 textbook chapter 1 and 2 prior to attending the first class

  4. Preparing For CS 240 (continued) • Familiarize yourself with C++ • Review Chapter 16 in our textbook • Check online sources such as: http://www.4p8.com/eric.brasseur/cppcen.html (excellent!!) http://www.cprogramming.com/tutorial.html#c++tutorial http://www.cprogramming.com/tutorial.html http://cpp-tutorial.cpp4u.com/ http://gd.tuwien.ac.at/languages/c/c++oop-pmueller/node9.html http://www.intap.net/~drw/cpp/ http://www.icce.rug.nl/documents/cplusplus/cplusplus.html http://www.cs.wustl.edu/~schmidt/C++/ http://www.functionx.com/cpp/index.htm

  5. Preparing For CS 240 (continued) • Get an additional C++ resource such as: http://www.bestwebbuys.com/books/compare/isbn/0672315165 http://www.bestwebbuys.com/books/compare/isbn/0672302004 • Get an additional Data Structures resource and teach yourself data structures over the break (jump-start): http://www.bestwebbuys.com/books/compare/isbn/0672316331 http://www.bestwebbuys.com/Data-Structures-and-Their-Algorithms-ISBN-9780673397362?isrc=-rd http://www.bestwebbuys.com/Data-Structures-In-C-ISBN-9781438253275?isrc=-rd http://www.bestwebbuys.com/Data-Structures-Using-C-ISBN-9780131997462?isrc=-rd http://www.bestwebbuys.com/Understanding-Pointers-in-C-ISBN-9788176563581?isrc=-rd http://www.bestwebbuys.com/books/compare/isbn/0534491820 http://www.mathtools.net/C_C__/Algorithms_and_Data_structures/index.html

  6. Preparing For CS 240 (continued) • Last homework assignment • Use chapter 16 and the following Web page as a source: http://www.4p8.com/eric.brasseur/cppcen.html • Convert any GHP that required use of printf( ) and scanf( ) calls (GHP #3 – GHP # 13) to C++ • Use cin( ) and cout( ) insteadof printf( ) and scanf( ) • Replace header files, too • Compile and test • Due no later than Friday, May 9th at 11 AM (for full credit) • Remember: all GHPs must be submitted… see syllabus for specifics… if I don't have them by noon on Dec 11th then I'll record an "I" grade (I will change "I" grades when I receive all missing GHPs… grade changes will be made after June 1, 2014)

  7. Introduction to C++ • C++ is a superset of C • Plenty of C source code can be compiled and run using a C++ compiler • The C++ compiler I like: g++ • Let's take 1.c from the following slide and make the minimum changes necessary to convert it to C++

  8. #include <stdio.h> // 1.c #include <string.h> typedef struct student { char first_name[20]; char last_name[20]; char ssn[10]; int *student_ptr ; } student ; int main (void) { student student_1; int birdhouse = 357 ; strcpy(student_1.first_name, "Chris"); strcpy(student_1.last_name, "Urban"); strcpy(student_1.ssn, "111223333"); student_1.student_ptr = &birdhouse; printf("\n\nLast name: %s", student_1.last_name); printf("\nSSN: %s \n\n\n", student_1.ssn); printf("\nAddress of birdhouse: %p", &birdhouse); printf("\nAddress that student_ptr holds: %p", student_1.student_ptr); printf("\nStudent_ptr points to the value: %d \n\n\n", * student_1.student_ptr); return (0) ; }

  9. Introduction to C++ • Copy the contents of 1.c to 1.cpp ( .cpp file type necessary for g++ compiler) • Compile 1.cpp using g++ compiler g++ 1.cpp • ./a.out

  10. Introduction to C++ • Let's wander through this great little tutorial: http://www.4p8.com/eric.brasseur/cppcen.html

  11. Idea Forms • The definitive sign that we have no more regular class meetings

More Related