Week 2
PRG 218 Variables and Input and Output Operations
You will Write eight assignment 70- to 100-word response to the following:
Supporting Activity: Small Program
Create a small program that:
1) Prompts the user for a positive integer.
2) Prints out 0 if the number is ODD or 1 if the number is EVEN.
Did you encounter compiler errors? How did you test your code?
Are there multiple ways to write this program? Explain.
Supporting Activity: Code Exercise
2 Type in the code and run any 3 of the "Try It Out" exercises in Ch. 2.
Which exercises did you select? Why? What did you learn?
3 What is the purpose of the document template in an MFC Windows program?
5 Why do you need to be careful, and plan your program structure in advance, when using the Application Wizard?
6 Code up the simple text editor program. Build both debug and release versions, and examine the types and sizes of the fi les produced in each case.
7 Generate the text editor application several times, trying diff erent project styles from the Application Type in Application Wizard.
8 Program Input and the Software Design Process" of Programming and Problem Solving with C++: Comprehensive
Overtime Pay Compile Errors
Use the code in Appendix B for this assignment.
Correct the compile errors to arrive at the following output.
•Sample output:
Enter the Employee Name = Mary
Enter the hours worked = 43
Enter his or her hourly wage = 3.00
Employee Name ............. = Mary
Base Pay .................. = 120
Hours in Overtime ......... = 3
Overtime Pay Amount........ = 13.5
Total Pay.................. = 133.5
Appendix B
Overtime Pay Compile Errors
Instructions
Material
Use the following code to complete your Overtime Pay Compile Errors assignment.
#include <io>
#include <string>
#include <iomanip>
using namespace std;
//Global Declarations of Variables
double iovertime_hours=0, iovertime pay=0, iovertime_extra=0;
int ihours, iwage ;
string cname ;
int main ()
{
//Enter Employee Information
cout << "\n\nEnter the employee name = ";
cin >> cname ;
cout << "Enter the hours worked = "
cin >> ihours;
cout << "Enter his or her hourly wage = "
cin >> iwage
// Determine if hours are greater than 40
if (ihours < 40)
{
//Do Calculations
iovertime_hours=ihours+40;
iovertime_pay=iwage-1.5 ;
iovertime_extra=iovertime_hours*iovertime_pay;
/ Display Employee Details
cout >> "\n\n";
cout << "Employee Name ............. = ' << cname << endl ;
cout << "Base Pay .................. = " << iwage*40 << endl
cout << "Hours in Overtime ......... = " << iovertime_hours << endl ;
cout << "Overtime Pay Amout......... = " << iovertime_extra << endl ;
cout << Total Pay ................. = " << iovertime_extra+(40*iwage) << endl;
}
else // Else hours are less than 40 hours
{
cout << "\n\n";
cout << "Employee Name ............. = " << cname << endl ;
cout << Base Pay ...
Week 2PRG 218 Variables and Input and Output OperationsYou w.docx
1. Week 2
PRG 218 Variables and Input and Output Operations
You will Write eight assignment 70- to 100-word response to
the following:
Supporting Activity: Small Program
Create a small program that:
1) Prompts the user for a positive integer.
2) Prints out 0 if the number is ODD or 1 if the number is
EVEN.
Did you encounter compiler errors? How did you test your
code?
Are there multiple ways to write this program? Explain.
Supporting Activity: Code Exercise
2 Type in the code and run any 3 of the "Try It Out" exercises
in Ch. 2.
Which exercises did you select? Why? What did you learn?
3 What is the purpose of the document template in an MFC
Windows program?
5 Why do you need to be careful, and plan your program
structure in advance, when using the Application Wizard?
6 Code up the simple text editor program. Build both debug and
release versions, and examine the types and sizes of the fi les
produced in each case.
7 Generate the text editor application several times, trying diff
erent project styles from the Application Type in Application
Wizard.
8 Program Input and the Software Design Process" of
2. Programming and Problem Solving with C++: Comprehensive
Overtime Pay Compile Errors
Use the code in Appendix B for this assignment.
Correct the compile errors to arrive at the following output.
•Sample output:
Enter the Employee Name = Mary
Enter the hours worked = 43
Enter his or her hourly wage = 3.00
Employee Name ............. = Mary
Base Pay .................. = 120
Hours in Overtime ......... = 3
Overtime Pay Amount........ = 13.5
Total Pay.................. = 133.5
3. Appendix B
Overtime Pay Compile Errors
Instructions
Material
Use the following code to complete your Overtime Pay Compile
Errors assignment.
#include <io>
4. #include <string>
#include <iomanip>
using namespace std;
//Global Declarations of Variables
double iovertime_hours=0, iovertime pay=0, iovertime_extra=0;
int ihours, iwage ;
string cname ;
int main ()
{
//Enter Employee Information
cout << "nnEnter the employee name = ";
cin >> cname ;
cout << "Enter the hours worked = "
cin >> ihours;
cout << "Enter his or her hourly wage = "
cin >> iwage
// Determine if hours are greater than 40
if (ihours < 40)
{
//Do Calculations
iovertime_hours=ihours+40;
iovertime_pay=iwage-1.5 ;
iovertime_extra=iovertime_hours*iovertime_pay;
/ Display Employee Details
cout >> "nn";
cout << "Employee Name ............. = ' << cname <<
endl ;
cout << "Base Pay .................. = " << iwage*40 <<
endl
cout << "Hours in Overtime ......... = " <<
iovertime_hours << endl ;
5. cout << "Overtime Pay Amout......... = " <<
iovertime_extra << endl ;
cout << Total Pay ................. = " <<
iovertime_extra+(40*iwage) << endl;
}
else // Else hours are less than 40 hours
{
cout << "nn";
cout << "Employee Name ............. = " << cname <<
endl ;
cout << Base Pay .................. = " << iwage*40 <<
endl ;
cout << "Hours in Overtime ......... = " <<
iovertime_hours << endl ;
cout << "Overtime Pay Amout......... = " <<
iovertime_extra << endl ;
cout << "Total Pay ................. = " <<
iovertime_extra+(40*iwage) << endl;
} // End of the primary if statement
} //End of Int Main
Week
2
PRG 218
Variables and Input and Output Operations
You will
Write
eight assignment
7
0
-
6. to 100
-
word response to the following:
Supporting Activity:
Small Program
Create
a small program that:
1)
Prompts the user for a positive integer.
2)
Prints out 0 if the number is ODD or 1 if the number is EVEN.
Did you encounter compiler errors? How did you test your
code?
Are there multiple ways to write this program? Explain
.
Supporting Activity:
Code Exercise
2
Type
in the code and run
any 3 of the "Try It Out" exercises in Ch. 2.
7. Which exercises did you select? Why? What did you learn?
3
What is the purpose of the document template in an MFC
Windows program?
5
Why do you need to be careful, and plan your program structure
in advance,
when using the
Application Wizard?
6
Code up the simple text editor program. Build both debug and
release versions, and examine the
types and sizes of the fi les produced in each case.
7
Generate the text editor application several times, trying diff
ere
nt project styles from the Application
Type in Application Wizard
.
8
Program Input and the Software Design Process" of
Programming and Problem Solving with
C++: Comprehensive
8. Week 2
PRG 218 Variables and Input and Output Operations
You will Write eight assignment 70- to 100-word response to
the following:
Supporting Activity: Small Program
Create a small program that:
1) Prompts the user for a positive integer.
2) Prints out 0 if the number is ODD or 1 if the number is
EVEN.
Did you encounter compiler errors? How did you test your
code?
Are there multiple ways to write this program? Explain.
Supporting Activity: Code Exercise
2 Type in the code and run any 3 of the "Try It Out" exercises
in Ch. 2.
Which exercises did you select? Why? What did you learn?
3 What is the purpose of the document template in an MFC
Windows program?
9. 5 Why do you need to be careful, and plan your program
structure in advance, when using the
Application Wizard?
6 Code up the simple text editor program. Build both debug and
release versions, and examine the
types and sizes of the fi les produced in each case.
7 Generate the text editor application several times, trying diff
erent project styles from the Application
Type in Application Wizard.
8 Program Input and the Software Design Process" of
Programming and Problem Solving with
C++: Comprehensive
Title
ABC/123 Version X
1
Supply and Demand Curves
ECO/365 Version 7
2
University of Phoenix Material
10. Economics - Definitions
Complete the following. Include your references using APA
formatting.
Write the definition for each of the following:
1. Law of Demand
2. Law of Supply
3. Price Elasticity of Demand
4. Macroeconomics
5. Microeconomics
Identify 2 Products whose demand is price elastic.
Identify 2 products whose demand is price inelastic.