<< Chapter < Page Chapter >> Page >
Questions, exercises, problems, etc. that support this chapter in the "Programming Fundamentals - A Modular Structured Approach using C++" collection/textbook.

Learning objectives

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

  1. Define the terms on the definitions as listed in the modules associated with this chapter.
  2. Be able to list the categories and give examples of errors encountered when using an Integrated Development Environment (IDE).
  3. 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

    Answer the following statements as either true or false:

  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
Got questions? Get instant answers now!

Miscellaneous items

None at this time.

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 // Author: Ken Busbee; © Kenneth Leroy 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 answear;//****************************************************** // main//****************************************************** int main(void){ // Inputcout<<"\nEnter the age of the first person --->: "; cin>>age1; cout<<"\nEnter the age of the second person -->: "; cin>>age2; // Processanswer = (age1 + age2) / 3.0; // Outputcout<<"\nThe average of their ages is -------->: "; cout<<answer; pause();return 0; }//****************************************************** // End of Program//******************************************************

Got questions? Get instant answers now!

Questions & Answers

Why is b in the answer
Dahsolar Reply
how do you work it out?
Brad Reply
answer
Ernest
heheheehe
Nitin
(Pcos∅+qsin∅)/(pcos∅-psin∅)
John Reply
how to do that?
Rosemary Reply
what is it about?
Amoah
how to answer the activity
Chabelita Reply
how to solve the activity
Chabelita
solve for X,,4^X-6(2^)-16=0
Alieu Reply
x4xminus 2
Lominate
sobhan Singh jina uniwarcity tignomatry ka long answers tile questions
harish Reply
t he silly nut company makes two mixtures of nuts: mixture a and mixture b. a pound of mixture a contains 12 oz of peanuts, 3 oz of almonds and 1 oz of cashews and sells for $4. a pound of mixture b contains 12 oz of peanuts, 2 oz of almonds and 2 oz of cashews and sells for $5. the company has 1080
ZAHRO Reply
If  , , are the roots of the equation 3 2 0, x px qx r     Find the value of 1  .
Swetha Reply
Parts of a pole were painted red, blue and yellow. 3/5 of the pole was red and 7/8 was painted blue. What part was painted yellow?
Patrick Reply
Parts of the pole was painted red, blue and yellow. 3 /5 of the pole was red and 7 /8 was painted blue. What part was painted yellow?
Patrick
how I can simplify algebraic expressions
Katleho Reply
Lairene and Mae are joking that their combined ages equal Sam’s age. If Lairene is twice Mae’s age and Sam is 69 yrs old, what are Lairene’s and Mae’s ages?
Mary Reply
23yrs
Yeboah
lairenea's age is 23yrs
ACKA
hy
Katleho
Ello everyone
Katleho
Laurene is 46 yrs and Mae is 23 is
Solomon
hey people
christopher
age does not matter
christopher
solve for X, 4^x-6(2*)-16=0
Alieu
prove`x^3-3x-2cosA=0 (-π<A<=π
Mayank Reply
create a lesson plan about this lesson
Rose Reply
Excusme but what are you wrot?
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Programming fundamentals - a modular structured approach using c++. OpenStax CNX. Jan 10, 2013 Download for free at http://cnx.org/content/col10621/1.22
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Programming fundamentals - a modular structured approach using c++' conversation and receive update notifications?

Ask