Programming Fundamentals/Practice: Introduction to Programming
Appearance
Chapter Summary
[edit | edit source]- Systems Development Life Cycle - a process for planning, creating, testing, and deploying an information system.
- Program Design - consists of the steps a programmer should take before they start coding a program.
- Program Quality - describes basic properties of the program’s source code and executable code
- Pseudocode- modeling/planning tool written in English statements to convey the steps of an algorithm
- Flowcharts- are a type of diagram that represents an algorithm, workflow, or process.
- Software Testing - involves the execution of a software component or system component to evaluate one or more properties of interest.
- Integrated Development Environment - is a software application that provides comprehensive facilities to computer programmers for software development.
- Version Control - is the management of changes to documents, computer programs, large websites, and other collections of information.
- Input and Output - are how an information processing system communicates with the outside world, a human, or another information processing system.
- Hello World - is a computer program that outputs or displays “Hello, world!” to a user.
Review Questions
[edit | edit source]True / False:
- Coding the program in a language like C++ is the first task of planning. You plan as you code.
- Usability is the single most important fundamental property in the development process of a new program.
- Pseudocode has a strict set of rules and is the same everywhere in the computer programming industry.
- Test data is developed for testing the program once it is coded into a language like C++.
- Commit is to write or merge the changes made in the working copy back to the repository.
- Not writing down your vision of a program could lead to problems further down the coding process.
- IDE "compile and run" is a five (5) step process.
- Git is a version control system for tracking changes in computer files and coordinating work on those files among multiple people.
- Printing "Hello World" on screen is the same for Python as is in Pseudocode.
- The robustness of a program is its ability to work around bugs in the code and still function as intended.
- Psuedocode can help increase the maintainability of a program.
- The reliability of a program refers to how often the results of a program are correct.
Answers:
- False - It is important to plan out your code first before jumping into the act of coding, especially when you are starting out in a new language you aren't fully familiar with.
- False
- False
- False
- True
- True
- True
- True
- False - Although they may seem similar no two programming languages are exactly the same.
- False
- True
- True
Short Answer:
- List the steps of the Systems Development Life Cycle and indicate which step you are likely to work in as a new computer professional.
- List and describe what might cause the four (4) types of errors encountered in a program using a compiler and an Integrated Development Environment software product.
- List and describe seven (7) properties that are evaluated when determining the quality of a program's source code.
- List three (3) errors that you may encounter when testing a coded program using test data that outputs the wrong values.
- List the elements which determine a program's quality.
Activities
[edit | edit source]Pseudocode and Flowcharts
[edit | edit source]The following activities focus on software planning and testing using pseudocode and / or flowcharts.
- Search the Internet for pseudocode for making a peanut butter and jelly sandwich. Based on the examples you find, create pseudocode to make your own favorite sandwich or other non-prepackaged meal. Note: Because peanut butter and jelly sandwich examples are already available, you must select something else for your pseudocode. Test your pseudocode by reading the instructions out loud as someone else follows your directions.
- Search the Internet for a flowchart for making a peanut butter and jelly sandwich. Use a free online or downloadable flowchart tool to create a flowchart that describes how to make your favorite sandwich or other non-prepackaged meal. Note: Because peanut butter and jelly sandwich examples are already available, you must select something else for your flowchart. Test your flowchart by reading the instructions out loud while someone else follows your directions.
- Create pseudocode or a flowchart for a program that would interact with bank customers and help them determine the value of a bag or jar of coins brought in for deposit. Include counts for pennies, nickels, dimes and quarters and calculate the total value of all of the coins deposited. Test your program by having someone else follow the instructions and guide them as they use your program.
- Create pseudocode or a flowchart for a program that allows the user to enter gallons of gas and converts it to liters (metric system). NOTE: One US gallon equals 3.7854 liters. Test your program by having someone else follow the instructions and guide them as they use your program.
- A major restaurant sends a chef to purchase fruits and vegetables every day. Upon returning to the store the chef must enter two pieces of data for each item purchased: the quantity (Example: 2 cases) and the price paid (Example: $4.67). The program has a list of 20 items and after the chef enters the information, the program provides a total for the purchases for that day. Prepare test data for five (5) items: apples, oranges, bananas, lettuce, and tomatoes.
Programming Languages and Integrated Development Environments
[edit | edit source]The following activities focus on selecting a programming language and testing integrated development environments.
- Research different programming languages and select a programming language to use with this textbook. Copy the Hello World example code for your selected programming language and use one of the free cloud-based IDEs to try running the Hello World program.
- Modify the example Hello World program to instead display
Hello <name>!
, where<name>
is your name. Include comments at the top of the program and test the program to verify that it works correctly. - Research free downloadable tools for your selected programming language (interpreter/compiler, IDE, etc.). Consider downloading and installing a development environment on your system. If you set up your own development environment, test the environment using your Hello Name program written above.