1 / 28

Objectives

Tutorial 1 – Car Payment Calculator and Guess the Number Application: Introducing Computers, the Internet and C++ Programming.

Télécharger la présentation

Objectives

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. Tutorial 1 – Car Payment Calculator and Guess the Number Application: Introducing Computers, the Internet and C++ Programming Outline1.1 What Is a Computer?1.2 Computer Organization1.3 The Internet and the World Wide Web1.4 Machine Languages, Assembly Languages and High- Level Languages1.5 C++1.6 Java1.7 Fortran, COBOL, Pascal and Ada1.8 BASIC, Visual Basic, Visual C++ and .NET1.9 Key Software Trend: Object Technology1.10 Compiling and Running C++ Applications1.11 Test-Driving the Car Payment Calculator and Guess the Number Applications1.12 Internet and Web Resources1.13 Wrap-Up

  2. Objectives • In this tutorial, you will learn to: • Identify the characteristics of low-level and high-level programming languages. • Apply the basics of object-oriented programming. • Run your first C++ application. • Locate additional C++ information using the Internet.

  3. 1.1 What Is a Computer? • Computers • Perform arithmetic calculations much faster than people can • Computer programs and applications • Instructions for a computer’s actions • Also known as software • Computer devices (also known as hardware) • Examples include keyboard, screen, mouse, hard drive, memory, etc.

  4. 1.2 Computer Organization • Six units in a computer • Input Unit • Obtains information from various input devices such as keyboard or mouse • Output Unit • Places computer-processed information on output devices (making it available for use outside of the computer) • Memory Unit or Primary Memory • Usually volatile (data is lost after computer shuts off)

  5. 1.2 Computer Organization (Cont.) • Arithmetic Logic Unit • Performs arithmetic calculations and determines logic • Central Processing Unit • Oversees all computer activities • Secondary Storage Unit • Nonvolatile(data is retained after computer shuts off) • Long term

  6. 1.3 The Internet And the World Wide Web • ARPANET • Set up by the Advanced Research Projects Agency to network university research computers • Enabled quick and easy communication via e-mail • TCP/IP • Transmission Control Protocol • Rules for transferring data over the ARPANET • Ensured that “packets” of information were sent and received correctly • Internet Protocol • Rules for intercommunication between networks

  7. 1.3 The Internet And the World Wide Web (Cont.) • World Wide Web (WWW) • Hardware and software associated with Internet communication • HyperText Markup Language (HTML) • Communications format developed by Tim Berners-Lee • World Wide Web Consortium (W3C) • Founded by Berners-Lee to develop Internet technologies

  8. 1.4 Machine Languages, Assembly Languages and High-Level Languages • Machine Languages • Machine dependent “natural language” • Assembly Languages • Machine language is too slow • Assemblers convert assembly languages to machine languages • High-Level Languages • Compilers convert to machine languages • Linkers package machine language files • Interpreters run high-level programs directly • Instructions look like everyday English

  9. 1.5 C++ • Evolved from C • C evolved from B and BCPL • Developed by Bjarne Stroustrup in early 1980s • Widely used for operating systems • Originally used to create UNIX • Provides capabilities for object-oriented programs • Hybrid language • C style • Object-oriented style

  10. 1.6 Java • Designed by Sun Microsystems • For intelligent consumer-electronic devices • Gained popularity with the World Wide Web • Used for dynamic content and animation on Web Pages • Now used for large scale enterprise applications development, enhances functionality of Web servers, provide applications for consumer devices and more • Widely used object-oriented language

  11. 1.7 Fortran, COBOL, Pascal and Ada • Fortran (FORmula TRANslator) • Developed by IBM • Still used in engineering community • COBOL • Still used in business software • Pascal • Designed for teaching structured programming

  12. 1.7 Fortran, COBOL, Pascal and Ada (Cont.) • Ada • Sponsored by the Department of Defense • Named after Lady Ada Lovelace • First computer programmer

  13. 1.8 BASIC, Visual Basic, Visual C++ and .NET • BASIC • Beginner’s All-Purpose Symbolic Instruction Code • For simple programs and teaching novices • Visual BASIC • Simplified development of Windows applications • VB.NET, Visual C++ .NET and C# • Framework Class Library (FCL) • Designed for Microsoft’s .NET platform • Object-oriented languages • Visual C++ .NET is derived from C++

  14. 1.9 Key Software Trend: Object Technology • Objects • Represent real-world nouns • Attributes (properties) • Actions (behaviors or functions) • Procedural Programming Languages • Focus on actions instead of objects

  15. 1.10 Compiling and Running C++ Applications • Files • Source code files (.cpp) • Header files (.h) • Executable files (.exe) • Compilation • Turns high-level source code into machine language code • Command prompt • Allows text instructions to be given to the computer

  16. Beginning directory for Windows 2000 1.10 Compiling and Running C++ Applications (Cont.) Figure 1.1 Command Prompt window in Windows 2000.

  17. Beginning directory for Windows XP 1.10 Compiling and Running C++ Applications (Cont.) Figure 1.2 Command Prompt window in Windows XP.

  18. 1.11 Test-Driving the Car Payment Calculator and Guess the Number Applications • Open Command Prompt • Start > All Programs > Accessories > Command Prompt • Change directories • Type cd C:\Examples\Tutorial01\CarPayment • Type cd C:\Examples\Tutorial01\GuessNumber • Run an application • Type CarPayment • Type GuessNumber

  19. Note that the current directory changed 1.11 Test-Driving the Car Payment Calculator and Guess the Number Applications (Cont.) Figure 1.3 Changing to the Car Payment Calculator application’s directory.

  20. Executing the CarPayment application 1.11 Test-Driving the Car Payment Calculator and Guess the Number Applications (Cont.) Figure 1.4 Running the Car Payment Calculator application.

  21. 1.11 Test-Driving the Car Payment Calculator and Guess the Number Applications (Cont.) Figure 1.5 Car Payment Calculator with data entered.

  22. Close box Results displayed in tabular format 1.11 Test-Driving the Car Payment Calculator and Guess the Number Applications (Cont.) Figure 1.6 Car Payment Calculator application displaying calculation results.

  23. Note that the current directory changed 1.11 Test-Driving the Car Payment Calculator and Guess the Number Applications (Cont.) Figure 1.7 Changing to the Guess the Number application’s directory.

  24. Executing the GuessNumber application 1.11 Test-Driving the Car Payment Calculator and Guess the Number Applications (Cont.) Figure 1.8 Running the Guess the Number application.

  25. 1.11 Test-Driving the Car Payment Calculator and Guess the Number Applications (Cont.) Figure 1.9 Entering an initial guess.

  26. Application displays whether your guess is too high or too low 1.11 Test-Driving the Car Payment Calculator and Guess the Number Applications (Cont.) Figure 1.10 Entering a second guess and receiving feedback.

  27. Entering additional guesses Entering the correct guess 1.11 Test-Driving the Car Payment Calculator and Guess the Number Applications (Cont.) Figure 1.11 Guessing the correct number.

  28. 1.12 Internet and Web Resources • www.deitel.com • www.prenhall.com/deitel • www.softlord.com/comp • www.elsop.com/wrc/h_comput.htm • www.w3.org/History.html • www.netvalley.com/intval.html • www.ansi.org • www.cuj.com

More Related