CMPSC 101 Programming Assignments
Since the main course objective of CMPSC 101 is to use certain computer programming techniques to solve problems, you will have to complete a number of programs throughout the semester. It is essential that you follow the Programming Process. Write a test plan and pseudocode before you begin to write or type out the actual C++ code. It is also important that you follow the course Coding Standards when you write each program so that it is easy to read your program and so that others can understand your code.
The Programming Process - You must conscientiously follow these steps in order to be successful in writing programs efficiently. Students who do not have the patience to follow the steps WILL have difficulty completing the assignments.
1. Define the problem and understand the
given specifications. Create a test plan.
2. Develop an algorithm by writing pseudocode.
3. Code the program by writing it out on paper first.
4. Test and debug the program.
5. Document and maintain the program.
Coding Standards - Hopefully, you will become a better problem-solver throughout this course. However, even if you write a program that displays the proper results, you may miss many points if you do not follow the Coding Standards even to the point of receiving a lower letter grade. Read these guidelines thoroughly. If you have any questions, be sure to consult the instructor and your textbook. Be sure to read the common errors that former CMPSC 101 students have made in the past on their programming assignments.
For each assignment below, be sure to immediately ask the instructor about the specifications if you have any questions. You must choose the proper variable data types for your variables so that the final answer is accurate. Include explanatory input prompt messages where appropriate so that the user knows exactly what to type as inputs. Make sure that your outputs are clearly explained with a word or phrase. Make sure that a dollar symbol is displayed in front of amounts of money.
This rubric will be used to grade your programs.
Assignment #1:
Follow the compiler
instructions to create your first C++ source file named a1.cpp. Type
the code below exactly as it appears.
// Type your name here
// CMPSC 101
// a1.cpp
// Type today's date here
// Purpose - This program displays a hello world message.
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
cout << "hello world" <<
endl;
system("PAUSE");
return 0;
}// end of main
Compile and debug the program if necessary. Execute the program. Print the source file by clicking the Visual C++ File/Print... menu command and submit it by the due date.
You must also upload copies of the source file (.cpp) and executable file (.exe) to the appropriate drop box in Angel (look under the Lessons tab) by the beginning of the class period on the due date. You will lose points if any file is named incorrectly.