1 / 24

Chapter 1

Chapter 1. Visual Logic. Computer Program. Solution to a problem. How can my customer purchase products from the Internet? Most do 3 things Input data Process data Output data. Writing a Computer Program. Determining what the problem is Creating a logical solution to solve a problem

arav
Download Presentation

Chapter 1

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. Chapter 1 Visual Logic

  2. Computer Program • Solution to a problem. • How can my customer purchase products from the Internet? • Most do 3 things • Input data • Process data • Output data

  3. Writing a Computer Program • Determining what the problem is • Creating a logical solution to solve a problem • Implementing that solution • Verify the solution is correct • Everyday examples of algorithms • Directions to bake a cake • Direction for game

  4. Difference Between Data and Information • 500 • Data is numbers, character, and/or images without context • Order 500 t-shirts • Information is data that has been processed

  5. Logic and Syntax • Compare building software application to a house. • What are the requirements • Design • Construct • Check • Algorithm – logical blueprint for software • Visual Logic • Graphics of flowcharts (graphical representation of algorithm • Utility of pseudo code ( min. syntax description of algorithm)

  6. Errors • Two Kinds • Syntax • Violate the rules of the language • More difficult to do with Visual Logic than Java • Begin with the easy more to more difficult • Logic • Violate the rules of the problem • Your thinking is off • You can do this anytime

  7. First Program Hello World

  8. Flowchart Symbols

  9. Creating Hello World

  10. Next Step Type “Hello World” When finished hit OK

  11. Almost There

  12. You Did It

  13. Input • Input Statement • Accepts data and stores into a variable • Variable • Storage location • Can be accessed and changed by developer code • Has a name and a value

  14. Second Program Hello Name

  15. Program Formats

  16. Weekly Paycheck Program

  17. Weekly Paycheck Program Specifics • Accepts the hours worked • Accepts the hourly rate for an employee • Will calculate and display the appropriate pay amount due • Step 1: Input What is the input needed • Hours and Rate • Step 2: Processing What calculation must be performed • Hours * Rate • Step 3: Output

  18. Expressions • A value-returning code element • X = A + B • Assignment statements are use to perform calculations and store the results • Expression is evaluated and stored in a variable

  19. Operator Precedence Java will handle exponentiation and division differently

  20. Weekly Paycheck Program

  21. Intrinsic Functions • Predefined commands that provide developers with common, helpful functionality

  22. Function for Visual Logic Java handles these differently

  23. Rose by Any Other Name • Paulette has just planted a large rose garden that she wants to fertilize. She knows the area of her rose garden in square feet, but the fertilizer is measured by the square yard. Write a program that converts square feet to square yards.

More Related