I have this working code but my teacher wants really specific things. codes always have to be OOP, and this needs to to have no more then 2 cout. i have 3 but cant seem to find away to take one out. my friend told me i should do this in arrays, but honestly im not really good at this so im really confused about what to do. again sorry if im posting this in the wrong place or posting it in a bad way. thanx u in advance. here is the code,
// DiamondLoop.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <string>
#include<iostream>
using namespace std;
class Diamond
{
private:
public:
Diamond(){
int i=0, j=0, NUM=3;
for(i=-NUM; i<=NUM; i++)
{
for(j=-NUM; j<=NUM; j++)
{
if( abs(i)+abs(j)<=NUM)
{ cout<<"*"; }
else { cout<<" ";}
}
cout <<endl;
}
}
};
int _tmain(int argc, _TCHAR* argv[])
{
Diamond shape;
return 0;
}