User Tools

Site Tools


user:rrichar8:portfolio:project3

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
user:rrichar8:portfolio:project3 [2011/12/03 21:33] – [Prerequisites] rrichar8user:rrichar8:portfolio:project3 [2011/12/03 23:15] (current) – [Reflection] rrichar8
Line 1: Line 1:
 +======Project:Miles to Kilometers Conversion Program======
 +
 +A project in C++ Programming by RICH during the FALL SEMESTER OF 2011.
 +
 +This project was begun on November 15 and was anticipated to take only a few days, but I've been working on it for the past 3 weeks now. (Upon completion you can correct this with the actual length)
 +
 +=====Objectives=====
 +To better understand C++ programming syntax and implementation. I began this program as a very large program and have filter out everything possible to make it run efficiently and with minimum code.  I was having an enormous amount of error messages with the original program when compiling it. As I began to investigate the error messages, I found that much of the code was redundant and unnecessary to accomplish what should be a very easy task in arithmetic. Seems that simplicity sometimes works better.
 +=====Prerequisites=====
 +In order to successfully accomplish/perform this project, the listed resources/experiences need to be consulted/achieved:
 +
 +  * The first resource used was the C++ Pocket reference that contains syntax and fundamentals.
 +  * http://www.physicsforums.com/showthread.php?t=511237
 +  * http://oreilly.com/catalog/cplus/chapter/ch07.html
 +  * http://www.cplusplus.com/forum/beginner/48609/
 +  * http://books.google.com/books?id=wVlm5xwMp7YC&printsec=frontcover#v=onepage&q&f=false
 +=====Background=====
 +This will be the first project I've compiled in C++..I've been having a difficult time figuring out why I'm getting error messages all the time when I compile the program in Putty. I've named and renamed the file in various endings, and I've used various commands to compile.
 +
 +
 +=====Scope=====
 +I'm a attempting to do this project and another project using class. I'm am attempting this one first because it has a simple code and I want to make sure that I understand the exact syntax necessary to code and compile the program and make it WORK too.
 +=====Attributes=====
 +State and justify the attributes you'd like to receive upon successful approval and completion of this project.
 +
 +  * attribute1: why you feel your pursuit of this project will gain you this attribute
 +  * attribute2: why you feel your pursuit of this project will gain you this attribute
 +  * etc...
 +
 +=====Procedure=====
 +The actual steps taken to accomplish the project. Include images, code snippets, command-line excerpts; whatever is useful for intuitively communicating important information for accomplishing the project.
 +
 +=====Code=====
 +Upon completion of the project, if there is an applicable collection of created code, place a copy of your finished code within <nowiki><code> </code></nowiki> blocks here.
 +
 +<code c>
 +/*
 + * compile with:
 +   g++ miles.c -o miles
 +   
 + * execute with:
 +   ./miles
 + */
 +#include <iostream>
 +
 +using namespace std;
 +
 +int main()
 +
 +{
 +      double miles;
 +      double kilometers;
 +      const double kilometersPerMile = 1.609;
 +
 +      cout << "Input miles: " << endl;
 +      cin >> miles;
 +
 +      kilometers = kilometersPerMile * miles;
 +
 +      cout << "Kilometers = " << kilometers << endl << endl;
 +
 +return 0;
 +}
 +
 +</code>
 +
 +=====Execution=====
 +Again, if there is associated code with the project, and you haven't already indicated how to run it, provide a sample run of your code:
 +
 +<cli>
 +lab46:~/src/cprog$ g++ miles.c -o miles
 +lab46:~/src/cprog$ miles.c
 +lab46:~/src/cprog$ ./miles
 +Input miles:
 +654
 +Kilometers = 1052.29
 +
 +lab46:~/src/cprog$
 +</cli>
 +
 +=====Reflection=====
 +I've learned that C++ programming is actually easier to use than C programming ONCE you learn the proper syntax and procedures to compile properly. There is a wealth of good information available to help learning the usage and syntax online.
 +=====References=====
 +In performing this project, the following resources were referenced:
 +
 +  * http:www.cprogramming.com/tutorial/base_systems.html
 +  * http://en.wikibooks.org/wiki/C_Programming/Print_version#Introduction
 +  * http://www.intap.net/~drw/cpp/cpp02_02.htm
 +  * http://books.google.com/books?id=wVlm5xwMp7YC&printsec=frontcover#v=onepage&q&f=false
 +
 +
 +