<< Chapter < Page | Chapter >> Page > |
With 100% accuracy during a: memory building activity, exercises, lab assignment, problems, or timed quiz/exam; the student is expected to:
Link to: MBA 06
None at this time.
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:
If you have not done so, please create the folder(s) and/or sub-folder(s) as appropriate.
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_01.cpp
Download from Connexions: Solution_Lab_01_Pseudocode.txt
Download from Connexions: Solution_Lab_01_Test_Data.txt
Download from Connexions: Solution_Lab_01m_with_Program_Control.cpp
Download from Connexions: Solution_Lab_01m_Pseudocode_with_Program_Control.txt
Download from Connexions: Solution_Lab_01m_Hierarchy_Chart.jpg
Download from Connexions: Solution_Lab_03.cpp
Download from Connexions: Solution_Lab_03_Pseudocode.txt
Download from Connexions: Solution_Lab_03_Test_Data.txt
Read and follow the directions below carefully, and perform the steps in the order listed.
Create a hierarchy chart for the following pseudocode example.
******************************************************
Filename: Average_IQ.txtPurpose: Average the IQs of two people
Author: Ken Busbee; © Kenneth Leroy BusbeeDate: Jan 17, 2009
******************************************************Function main
Pass In: nothingCall: get_iqs
Call: process_iqsCall: show_average
Pass Out: zero to the OSEndfunction
********************Function get_iqs
Pass In: nothingdisplay a message asking user for the IQ of the first person
get the IQ of the first person from the keyboarddisplay a message asking user for the IQ of the second person
get the IQ of the second person from the keyboardPass Out: nothing
Endfunction********************
Function process_iqsPass In: nothing
calculate the answer by adding the two IQs anddividing by 2.0
Pass Out: nothingEndfunction
********************Function show_average
Pass In: nothingdisplay the answer with an appropriate message
Call: pausePass Out: nothing
Endfunction********************
Function pausePass In: nothing
direct the operating system to pause the programPass Out: nothing
Endfunction******************************************************
Potential VariablesData Type Identifier Name
********* ***************integer iq1
integer iq2double answer
******************************************************End of file
Identify some problems that make this code "undocumented", "unreadable" or wrong in some other way.
//******************************************************
// Author: Ken Busbee; © 2009 Kenneth Leroy Busbee// Date: Jan 17, 2009
//******************************************************#include<iostream>using namespace std;void pause(void);
int age1, age2;double xx;
//******************************************************// 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;
// Processxx = (age1 + age2) / 2.0;
// Outputcout<<"\nThe average of their ages is -------->: ";
cout<<xx;
pause();return 0;
}void pause(void)
{ cout<<"\n\n";
system("PAUSE");cout<<"\n\n";
return; }//******************************************************
// End of Program//******************************************************
Notification Switch
Would you like to follow the 'Programming fundamentals - a modular structured approach using c++' conversation and receive update notifications?