Skip to main content
Engineering LibreTexts

6.4: Practice 5 Integrated Development Environment

  • Page ID
    10271
  • Learning Objectives

    With 100% accuracy during a: memory building activity, exercises, lab assignment, problems, or timed quiz/exam; the student is expected to:

    Define the terms on the definitions as listed in the modules associated with this chapter.

    Be able to list the categories and give examples of errors encountered when using an Integrated Development Environment (IDE).

    Write the C++ code for a program using appropriate planning documentation that you or another has designed.

    Memory Building Activities

    Link to: MBA 05

    Exercises

    Question (T/F)
        1. IDE means Integer Division Expression.
        2. Most modern compilers are really an IDE type of software, not just a compiler.
        3. cin and cout are used for the standard input and output in C++.
        4. Programming errors are extremely easy to understand and fix.
        5. All C++ programs will have at least one include type of compiler directive.
    Answers
        1. False
        2. True
        3. True
        4. False
        5. True
    

    Lab Assignment

    Creating a Folder or Sub-Folder for Chapter 05 Files

    Depending on your compiler/IDE, you should decide where to download and store source code files for processing. Prudence dictates that you create these folders as needed prior to downloading source code files. A suggested sub-folder for the Bloodshed Dev-C++ 5 compiler/IDE might be named:

    • Chapter_05 within the folder named: Cpp_Source_Code_Files

    If you have not done so, please create the folder(s) and/or sub-folder(s) as appropriate.

    Download the Lab File(s)

    Download and store the following file(s) to your storage device in the appropriate folder(s). You may need to right click on the link and select "Save Target As" in order to download the file.

    Download from Connexions: Solution_Lab_02_Pseudocode.txt

    Download from Connexions: Solution_Lab_02_Test_Data.txt

    Detailed Lab Instructions

    Read and follow the directions below carefully, and perform the steps in the order listed.

    • Copy into your sub-folder: Chapter_05 one of the source code listings that we have used. We suggest the Lab 01 source code and rename the copy: Lab_05.cpp
    • Modify the code to follow the Solution_Lab_02_Pseudocode.txt file.
    • Build (compile and run) your program. You have successfully written this program if when it runs and you use the test data [use the test data as supplied as the solution for Lab 02] it gives the predicted results.
    • After you have successfully written this program, if you are taking this course for college credit, follow the instructions from your professor/instructor for submitting it for grading.

    Problems

    Problem 05a - Instructions

    List and describe what might cause the four (4) types of errors encountered in a program using an Integrated Development Environment software product.

    Problem 05b - Instructions

    Identify four (4) problems with this code listing (HINT: The four (4) types of errors encountered in a program using an Integrated Development Environment software product).

    C++ Source Code Listing
    //******************************************************
    // Filename: Compiler_Test.cpp
    // Purpose: Average the ages of two people
    // Ken Busbee;
    // Date: Jan 5, 2009
    // Comment:    Main idea is to be able to debug and run a program on your compiler.
    //******************************************************
    
    // Headers and Other Technical Items
    
    #include <iostrern>
    using namespace std;
    
    // Function Prototypes
    
    void pause(void);
    
    // Variables
    
    int    age1;
    int    age2;
    double    answer;
    
    //******************************************************
    // main
    //******************************************************
    
    int main(void)
        {
        // Input
        cout << "\nEnter the age of the first person --->: ";
        cin >> age1;
        cout << "\nEnter the age of the second person --->: ";
        cin >> age2;
        
    // Process
        answer = (age1 + age2)/3.0;
    
    // Output
        cout << "\nThe average of their ages is --->: ";
        cout << answer;
    
        pause();
        return 0;
        }
    //******************************************************
    // End of Program
    //******************************************************