Skip to content

Commit

Permalink
Initial code commit
Browse files Browse the repository at this point in the history
  • Loading branch information
phillf committed May 12, 2012
1 parent 94d92a9 commit a2e4ad6
Show file tree
Hide file tree
Showing 15 changed files with 431 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/nbproject/private/
75 changes: 75 additions & 0 deletions nbproject/Package-Default.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#!/bin/bash -x

#
# Generated - do not edit!
#

# Macros
TOP=`pwd`
CND_PLATFORM=GNU-MacOSX
CND_CONF=Default
CND_DISTDIR=dist
CND_BUILDDIR=build
NBTMPDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
TMPDIRNAME=tmp-packaging
OUTPUT_PATH=MissingOutputInProject
OUTPUT_BASENAME=MissingOutputInProject
PACKAGE_TOP_DIR=areacalc/

# Functions
function checkReturnCode
{
rc=$?
if [ $rc != 0 ]
then
exit $rc
fi
}
function makeDirectory
# $1 directory path
# $2 permission (optional)
{
mkdir -p "$1"
checkReturnCode
if [ "$2" != "" ]
then
chmod $2 "$1"
checkReturnCode
fi
}
function copyFileToTmpDir
# $1 from-file path
# $2 to-file path
# $3 permission
{
cp "$1" "$2"
checkReturnCode
if [ "$3" != "" ]
then
chmod $3 "$2"
checkReturnCode
fi
}

# Setup
cd "${TOP}"
mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
rm -rf ${NBTMPDIR}
mkdir -p ${NBTMPDIR}

# Copy files and create directories and links
cd "${TOP}"
makeDirectory "${NBTMPDIR}/areacalc"
copyFileToTmpDir "${OUTPUT_PATH}" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755


# Generate tar file
cd "${TOP}"
rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/areacalc.tar
cd ${NBTMPDIR}
tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/areacalc.tar *
checkReturnCode

# Cleanup
cd "${TOP}"
rm -rf ${NBTMPDIR}
39 changes: 39 additions & 0 deletions nbproject/configurations.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<configurationDescriptor version="80">
<logicalFolder name="root" displayName="root" projectFiles="true" kind="ROOT">
<df name="areacalc" root=".">
<df name="bin">
</df>
<df name="src">
</df>
<in>areacalc.cpp</in>
</df>
<logicalFolder name="ExternalFiles"
displayName="Important Files"
projectFiles="false"
kind="IMPORTANT_FILES_FOLDER">
<itemPath>src/Makefile</itemPath>
</logicalFolder>
</logicalFolder>
<sourceFolderFilter>^(nbproject)$</sourceFolderFilter>
<sourceRootList>
<Elem>.</Elem>
</sourceRootList>
<projectmakefile>src/Makefile</projectmakefile>
<confs>
<conf name="Default" type="0">
<toolsSet>
<remote-sources-mode>LOCAL_SOURCES</remote-sources-mode>
<compilerSet>default</compilerSet>
</toolsSet>
<makefileType>
<makeTool>
<buildCommandWorkingDir>src</buildCommandWorkingDir>
<buildCommand>${MAKE} -f Makefile</buildCommand>
<cleanCommand>${MAKE} -f Makefile clean</cleanCommand>
<executablePath></executablePath>
</makeTool>
</makefileType>
</conf>
</confs>
</configurationDescriptor>
23 changes: 23 additions & 0 deletions nbproject/project.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.cnd.makeproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/make-project/1">
<name>areacalc</name>
<c-extensions/>
<cpp-extensions>cpp</cpp-extensions>
<header-extensions/>
<sourceEncoding>UTF-8</sourceEncoding>
<make-dep-projects/>
<sourceRootList>
<sourceRootElem>.</sourceRootElem>
</sourceRootList>
<confList>
<confElem>
<name>Default</name>
<type>0</type>
</confElem>
</confList>
</data>
</configuration>
</project>
2 changes: 2 additions & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
all:
g++ main.cpp -o ../bin/areacalc
8 changes: 8 additions & 0 deletions src/areacalc.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* File: areacalc.cpp
* Author: Phill Fernandes <pfernandes@techweekmedia.com>
*
* Created on May 11, 2012, 9:43 PM
*/
#include "header.h"
#include "calculations.h"
18 changes: 18 additions & 0 deletions src/calculations.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* calculations.h
* dev-xcode
*
* Created by Phillip Fernandes on 11/11/10.
* Copyright 2010 TechWeek Media, Inc. All rights reserved.
*
*
* This file includes all the shape calculation header files.
*
*/

#include "square.h"
#include "rectangle.h"
#include "triangle.h"
#include "paralellogram.h"
#include "rhombus.h"
#include "trapezoid.h"
15 changes: 15 additions & 0 deletions src/compile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
clear
echo "Compiling main.cpp"
g++ *.cpp -c
echo " "
echo "Linking Libraries"
g++ *.o -ldl -lpthread -o a2manager
echo " "
echo "Cleaning Up"
rm usefulFuncs.o vhostMgmt.o specialDeployments.o main.o startStop.o
echo " "
echo "DONE"
echo " "
sleep 3
clear
18 changes: 18 additions & 0 deletions src/header.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* header.h
* dev-xcode
*
* Created by Phillip Fernandes on 11/19/10.
* Copyright 2010 TechWeek Media, Inc. All rights reserved.
*
*/
//#include "GfdOogleTech.h"
#include<iostream>
using namespace std

int header()
{
cout << "Area Calculator" << endl << endl;

return 0;
}
36 changes: 36 additions & 0 deletions src/paralellogram.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* paralellogram.h
* dev-xcode
*
* Created by Phillip Fernandes on 11/11/10.
* Copyright 2010 TechWeek Media, Inc. All rights reserved.
*
*/

int paralellogram()
{

system(clearcommand);
header();

double base;
double height;
double area;

cout << "Base: ";
getnum(base, ;);

cout << "Height: ";
getnum(height, ;);

area = base * height;

cout << "Work: " << base << " * " << height << " = " << area << endl;
cout << "Final " << area << endl;

system(sleepcommand);

system(clearcommand);

return 0;
}
36 changes: 36 additions & 0 deletions src/rectangle.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* rectangle.h
* dev-xcode
*
* Created by Phillip Fernandes on 11/11/10.
* Copyright 2010 TechWeek Media, Inc. All rights reserved.
*
*/

int rectangle()
{

system(clearcommand);
header();

double base;
double height;
double area;

cout << "Base: ";
getnum(base, ;);

cout << "Height: ";
getnum(height, ;);

area = base * height;

cout << "Work: " << base << " * " << height << " = " << area << endl;
cout << "Final " << area << endl;

system(sleepcommand);

system(clearcommand);

return 0;
}
36 changes: 36 additions & 0 deletions src/rhombus.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* rhombus.h
* dev-xcode
*
* Created by Phillip Fernandes on 11/11/10.
* Copyright 2010 TechWeek Media, Inc. All rights reserved.
*
*/

int rhombus()
{

system(clearcommand);
header();

double d1;
double d2;
double area;

cout << "Diagonal 1: ";
getnum(d1, ;);

cout << "Diagonal 1: ";
getnum(d2, ;);

area = d1 * d2;

cout << "Work: " << d1 << " * " << d2 << " = " << area << endl;
cout << "Final " << area << endl;

system(sleepcommand);

system(clearcommand);

return 0;
}
36 changes: 36 additions & 0 deletions src/square.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* square.h
* dev-xcode
*
* Created by Phillip Fernandes on 11/11/10.
* Copyright 2010 TechWeek Media, Inc. All rights reserved.
*
*/

int square()
{

system(clearcommand);
header();

double base;
double height;
double area;

cout << "Base: ";
getnum(base, ;);

cout << "Height: ";
getnum(height, ;);

area = base * height;

cout << "Work: " << base << " * " << height << " = " << area << endl;
cout << "Final " << area << endl;

system(sleepcommand);

system(clearcommand);

return 0;
}
Loading

0 comments on commit a2e4ad6

Please sign in to comment.