User Tools

Site Tools


notes:cprog

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
notes:cprog [2018/11/07 14:51] – [URLs] sdiarranotes:cprog [2018/11/20 08:24] (current) – [Other] sdiarra
Line 29: Line 29:
  
 ===oop0=== ===oop0===
 +<color #ed1c24>**CALCULATOR::Object-Oriented Programming**</color>
 +
 +**Objective**
 +
 +The objective of this project is to get a stronger grasp of object-oriented programming, get a better understanding of inheritance, and classes and their properties.
 +
 +**Background**
 +
 +Over the last few weeks we have covered multiple ways of implementing object oriented model; using the single file method of doing things, and multiple files method of doing things. Using that skill-set, you(we) must implement a program that will replicate the functions of a calculator.
 +
 +**Scope**
 +
 +For the scope of this project, as long as you implement a program that adopt the object-oriented methodology in C++ - there are no other particular restrictions.
 +
 +**Program**
 +
 +Replicate the functionality of a calculator, with the ability to accomplish multiple mathematical functions. Given a set of inputs the program must have the capability to compute the numbers based on the functions.
 +
  
 ======URLs====== ======URLs======
 **String Formating(fprintf)** **String Formating(fprintf)**
 http://www.cplusplus.com/reference/cstdio/fprintf/ http://www.cplusplus.com/reference/cstdio/fprintf/
 +
 +**Standard Template Library**
 +http://www.cplusplus.com/reference/stl/
 +
 +
 +**Vector Reference**
 +http://www.cplusplus.com/reference/vector/vector/
 ======Notes====== ======Notes======
 <color #ed1c24>**TYPEDEF**</color> <color #ed1c24>**TYPEDEF**</color>
Line 55: Line 80:
 Although **typedef** appears to be defining only types, it removes some overheads down the road as a developer,it provides consistency, and clarity when used effectively. Although **typedef** appears to be defining only types, it removes some overheads down the road as a developer,it provides consistency, and clarity when used effectively.
  
 +-------
 +<color #ed1c24>**UNDEF**</color>
 +
 +Undef is a directive in that is available in C and C++. It as the form of #undef when called. Undef is used as a complement to the #define, as a preprocessor directive it is used to enclosed a #define statement to make sure there is no naming conflict and constrict one's logic within a set of code. Let's take a macro for example it is efficient for macros primarily because of the fact that it does common tasks such print, as many modules take have various print functions, the ideal way to make sure there is no conflict is to use undef. This is how it is used:
 +
 +<code>
 +    #define pprintf1() //for pretty-printf
 +    #undef pprintf1()
 +</code>
 +
 +easy peasy! 
 ======Other====== ======Other======
 +-------
 +<color #ed1c24>**Quick Tip:** </color>
 +
 +Recently I have discovered a trick that could help run scripts much quicker with direct access to one's lab46 account, without working only on a single machine at a time. Ultimately, I had to ssh into my account, and whenever I left the terminal open for a few minutes, it would go offline - or had to share scripts between my personal laptop and lab46 machines, and work on projects on one machine at a time(fairly painful). With this method one can easily call commands anywhere, that are otherwise only available on the lab46 account. Here is how it is accomplished: 
 +<code>
 +    system("ssh account@lab47.corning-cc.edu command_here");
 +</code>
 +A working example would be the following:
 +<code>
 +     //From my own laptop
 +     system("ssh user@lab46.corning-cc.edu status cprog")
 +     
 +     //This example would return grades from the user.
 +
 +</code>
 +**Note that the script would prompt you to enter your <color #ed1c24>password</color>.**
notes/cprog.1541620314.txt.gz · Last modified: 2018/11/07 14:51 by sdiarra