|
|
Hello, Guest! Welcome to Symbianize forums.
Most of our features and services are available only to our members. So we encourage you to login or join us by registering a new account. Registration is free, fast, and simple. You only need to provide a valid email address so we can minimize spammers. As a Symbianize member you'll have the following privileges:
- Gain access to private forums and restricted features
- Reply and create new topics or polls
- Download free applications, games, themes, graphics, tones, videos, etc.
- Ask question or support related to mobile phone, computer, game console, and multimedia
- Private messaging (PM) with fellow members
- Communicate instantly or real-time with currently online members via Shout Box
All that and more, so what are you waiting for, join us now! Ito ang website na ginawa ng pinoy para sa pinoy!
| |
| Programming Discussions related to C++, HTML, PHP, ASP, ColdFusion, JavaScript, Perl, Phyton, Ruby, WML, SQL, XML, and other programming languages. |
 |
|

4th Aug 2012 Sat, 03:32
|
 |
Forum Master
|
|
Join Date: Mar 2010
Posts: 2,061
Reputation:
|
|
Re: -= Having Difficulty in C++? Be a Part of This Thread =-
@ezroot
yes sir parang ganun na nga opensource naman siya medyo di nga lang umaandar utak namin nung nakita namin yung loob
Quote:
Originally Posted by Asaman83687
Motion Detecting Webcam Software Ba? Na'implement ko na to before at madali lang. All you need is yung SDK for connecting sa WebCam at Algorithm ng Magcacalculate ng Differences per Frame ng ifenifeed ng webcam. Bali depende sa Amount of Motion/Difference Per Frame at threshold na ispespecify nyu, dun mag'rereact accordingly yung program nyu.
*Note: Kung Pwede kayo mg'rely sa third party library at c++ kayo, you can check OpenCV. Pero kung from scratch yung algorithm nyu, madali lng naman
|
Talaga sir? Sige willing akong pag aralan yan from scratch basta hindi matatagalan yung paggawa ng program kasi naghahabol na rin kami sa document + ang dami pa naming ginagawa school ngayon...
Tsaka sir willing din ang group namin na i-hire ka bilang programmer (if may time ka or kung ok lang sa inyo) babayaran ka na lang namin pero as of now, ayokong isipin mo na hindi kami gumagawa kaya malaking tulong sir kung maishashare mo samin yung paggawa ng motion detecting software.
And also sir by that you mean "SDK" ok lang ba gumamit niyan? kasi baka sabihin nanaman ng prof namin copyright yung ginagawa namen tulad nung dorgem app na nakuha namin sa internet
Last edited by notevirus7; 4th Aug 2012 Sat at 03:35..
|

4th Aug 2012 Sat, 17:17
|
 |
Forum Master
|
|
Join Date: Nov 2011
Posts: 2,238
Reputation:
|
|
Re: -= Having Difficulty in C++? Be a Part of This Thread =-
help niyo naman po ako
panu ko po ito gagawin na ganito?
Code:
Sample Input
3
3 5 4
1 2 1
3 3 1
Sample Output
3 5 4 : RIGHT TRIANGLE WITH AREA 6.00000 UNITS SQUARED
1 2 1 : NOT A TRIANGLE
3 3 1 : TRIANGLE WITH AREA 1.47902 UNITS SQUARED
eto po yung nagawa kong code.baka matulungan niyo po ako..bawal pong gumamit ng array
Code:
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int main()
{
double x,y,z;
int N;
float Area,s;
cin >> N;
if (N > 1000)
return 0;
for (int i = 1; i <= N;i++)
{
cin >> x;
if ( x > 5000)
return 0;
cin >> y;
if ( y > 5000)
return 0;
cin >> z;
if ( z > 5000)
return 0;
}
for (int j = 1; j <= N;j++)
{
s = ( x + y + z ) / 2;
Area = sqrt ( s * ( s - x ) * ( s - y ) * ( s - z ));
int B = Area;
if ( (B % 3) == 0 && ( x != y != z))
{
cout << x << " " << y << " " << z ;
printf (" : RIGHT TRIANGLE WITH AREA %1.5f UNITS SQUARED\n",Area);
}
if ( Area == 0)
{
cout << x << " " << y << " " << z ;
cout << " : NOT A TRIANGLE" << endl;
}
else if ( (B % 3) > 0)
{
cout << x << " " << y << " " << z ;
printf (" : TRIANGLE WITH AREA %1.5f UNITS SQUARED\n",Area);
}
}
return 0;
}
Last edited by raymundpogi; 4th Aug 2012 Sat at 17:18..
|

4th Aug 2012 Sat, 22:31
|
 |
Forum Master
|
|
Join Date: Mar 2010
Posts: 2,061
Reputation:
|
|
Re: -= Having Difficulty in C++? Be a Part of This Thread =-
up for the thread.
|

5th Aug 2012 Sun, 09:54
|
 |
Professional
|
|
Join Date: Feb 2012
Posts: 106
Reputation:
|
|
Re: -= Having Difficulty in C++? Be a Part of This Thread =-
Quote:
Originally Posted by notevirus7
@ezroot
yes sir parang ganun na nga opensource naman siya medyo di nga lang umaandar utak namin nung nakita namin yung loob
Talaga sir? Sige willing akong pag aralan yan from scratch basta hindi matatagalan yung paggawa ng program kasi naghahabol na rin kami sa document + ang dami pa naming ginagawa school ngayon...
Tsaka sir willing din ang group namin na i-hire ka bilang programmer (if may time ka or kung ok lang sa inyo) babayaran ka na lang namin pero as of now, ayokong isipin mo na hindi kami gumagawa kaya malaking tulong sir kung maishashare mo samin yung paggawa ng motion detecting software.
And also sir by that you mean "SDK" ok lang ba gumamit niyan? kasi baka sabihin nanaman ng prof namin copyright yung ginagawa namen tulad nung dorgem app na nakuha namin sa internet
|
Consult nyu nalang sa Prof nyu kung pwede gumamit ng Framework, Kasi yung OpenCV is Framework lng, building blocks kung baga and/or abstraction layer sa pag'connect to webcams, image processing, and ... , unlike sa dorgem na COMPLETE APP na talaga
Stupid question with obvious answer is stupid... and obvious.
#############
# Facebook Profile #
#############
Last edited by Asaman83687; 5th Aug 2012 Sun at 10:34..
|

5th Aug 2012 Sun, 10:31
|
 |
Professional
|
|
Join Date: Feb 2012
Posts: 106
Reputation:
|
|
Re: -= Having Difficulty in C++? Be a Part of This Thread =-
Quote:
Originally Posted by raymundpogi
help niyo naman po ako
panu ko po ito gagawin na ganito?
Code:
Sample Input
3
3 5 4
1 2 1
3 3 1
Sample Output
3 5 4 : RIGHT TRIANGLE WITH AREA 6.00000 UNITS SQUARED
1 2 1 : NOT A TRIANGLE
3 3 1 : TRIANGLE WITH AREA 1.47902 UNITS SQUARED
eto po yung nagawa kong code.baka matulungan niyo po ako..bawal pong gumamit ng array
Code:
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int main()
{
double x,y,z;
int N;
float Area,s;
cin >> N;
if (N > 1000)
return 0;
for (int i = 1; i <= N;i++)
{
cin >> x;
if ( x > 5000)
return 0;
cin >> y;
if ( y > 5000)
return 0;
cin >> z;
if ( z > 5000)
return 0;
}
for (int j = 1; j <= N;j++)
{
s = ( x + y + z ) / 2;
Area = sqrt ( s * ( s - x ) * ( s - y ) * ( s - z ));
int B = Area;
if ( (B % 3) == 0 && ( x != y != z))
{
cout << x << " " << y << " " << z ;
printf (" : RIGHT TRIANGLE WITH AREA %1.5f UNITS SQUARED\n",Area);
}
if ( Area == 0)
{
cout << x << " " << y << " " << z ;
cout << " : NOT A TRIANGLE" << endl;
}
else if ( (B % 3) > 0)
{
cout << x << " " << y << " " << z ;
printf (" : TRIANGLE WITH AREA %1.5f UNITS SQUARED\n",Area);
}
}
return 0;
}
|
Mejo madumi ang code kung hindi gagamit ng array since hindi fixed yung num of inpus mo at ganyan yung style ng output mo. Pero ito yung implementation ko. Try mo kung pwedeng ipilit, modify mo nalang if ever
Code:
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int main()
{
double x,y,z;
char choice;
float Area,s;
bool istriangle, isright;
cout << "Triangle Checker and Area Solver" << endl << endl;
do {
cout << "Enter 3 sides of a triangle, space-separated (e.g 3 5 4): ";
cin >> x;
if ( x > 5000)
return 1;
cin >> y;
if ( y > 5000)
return 1;
cin >> z;
if ( z > 5000)
return 1;
//check if triangle using rules given: x, y, z, then x+y>z, x+z>y, and y+z>x
if ((x+y>z) && (x+z>y) && (y+z>x)) {
istriangle = true;
//solve for area
s = ( x + y + z ) / 2;
Area = sqrt ( s * ( s - x ) * ( s - y ) * ( s - z ));
//checl if right
if ((x*x) + (y*y) == (z*z)) {
isright = true;
} else {
isright = false;
}
} else {
istriangle = false;
isright = false;
}
if ( istriangle){
if (isright) {
cout << x << " " << y << " " << z ;
printf (" : RIGHT TRIANGLE WITH AREA %1.5f UNITS SQUARED\n",Area);
} else {
cout << x << " " << y << " " << z ;
printf (" : TRIANGLE WITH AREA %1.5f UNITS SQUARED\n",Area);
}
} else {
cout << x << " " << y << " " << z ;
cout << " : NOT A TRIANGLE" << endl;
}
cout << "\nRepeat [y/n] : ";
cin >> choice;
} while (choice == 'y'|| choice == 'Y');
return 0;
}
Stupid question with obvious answer is stupid... and obvious.
#############
# Facebook Profile #
#############
|

5th Aug 2012 Sun, 10:53
|
 |
Forum Master
|
|
Join Date: Nov 2011
Posts: 2,238
Reputation:
|
|
Re: -= Having Difficulty in C++? Be a Part of This Thread =-
Quote:
Originally Posted by Asaman83687
Mejo madumi ang code kung hindi gagamit ng array since hindi fixed yung num of inpus mo at ganyan yung style ng output mo. Pero ito yung implementation ko. Try mo kung pwedeng ipilit, modify mo nalang if ever
Code:
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int main()
{
double x,y,z;
char choice;
float Area,s;
bool istriangle, isright;
cout << "Triangle Checker and Area Solver" << endl << endl;
do {
cout << "Enter 3 sides of a triangle, space-separated (e.g 3 5 4): ";
cin >> x;
if ( x > 5000)
return 1;
cin >> y;
if ( y > 5000)
return 1;
cin >> z;
if ( z > 5000)
return 1;
//check if triangle using rules given: x, y, z, then x+y>z, x+z>y, and y+z>x
if ((x+y>z) && (x+z>y) && (y+z>x)) {
istriangle = true;
//solve for area
s = ( x + y + z ) / 2;
Area = sqrt ( s * ( s - x ) * ( s - y ) * ( s - z ));
//checl if right
if ((x*x) + (y*y) == (z*z)) {
isright = true;
} else {
isright = false;
}
} else {
istriangle = false;
isright = false;
}
if ( istriangle){
if (isright) {
cout << x << " " << y << " " << z ;
printf (" : RIGHT TRIANGLE WITH AREA %1.5f UNITS SQUARED\n",Area);
} else {
cout << x << " " << y << " " << z ;
printf (" : TRIANGLE WITH AREA %1.5f UNITS SQUARED\n",Area);
}
} else {
cout << x << " " << y << " " << z ;
cout << " : NOT A TRIANGLE" << endl;
}
cout << "\nRepeat [y/n] : ";
cin >> choice;
} while (choice == 'y'|| choice == 'Y');
return 0;
}
|
hindi po sir..
yung first input..magdedetermine kung ilang x,y,z ang iinput..kaya..di na po kailangan na lagyan ng choice yung code kung want pang mag-input o hindi na
base dun sa sample input..3 ang nakalagay..
edi..sa susunod na line..mag - iinput sya ng x,y,z ng tatlong beses..
then..pagkatapos mainput yung 3 beses na x,y,z
mag-aoutput na sya sa baba nung result nung 3x inputted x,y,z
ahm..kung gagamit ng array...nasa baba yung code..kaso..bawal pong gumamit ng array
Quote:
#include <cstdlib>
#include <iostream>
#include <cmath>
#include <cstdio>
using namespace std;
int CheckIfRightTriangle(int x,int y,int z);
int CheckIfTriangle(int x,int y,int z);
float Area(int x,int y, int z);
int main(int argc, char** argv) {
int i,*x,*y,*z,N;
cin >> N;
if(N>1000) return 0;
x = new int[N];
y = new int[N];
z = new int[N];
for(i=0;i<N;i++)
{
cin >> x[i] >> y[i] >> z[i];
if((x[i]>5000)||(y[i]>5000)||(z[i]>5000))
return 0;
}
cout << endl;
for(i=0;i<N;i++)
{
if(CheckIfRightTriangle(x[i],y[i],z[i])==1) {
cout << x[i] << " " << y[i] << " " << z[i] ;
printf (" : RIGHT TRIANGLE WITH AREA %1.5f UNITS SQUARED\n",Area(x[i],y[i],z[i]));
continue;
}
if(CheckIfTriangle(x[i],y[i],z[i])==1) {
cout << x[i] << " " << y[i] << " " << z[i] ;
printf (" : TRIANGLE WITH AREA %1.5f UNITS SQUARED\n",Area(x[i],y[i],z[i]));
}
else {
cout << x[i] << " " << y[i] << " " << z[i] ;
cout << " : NOT A TRIANGLE" << endl;
}
}
return 0;
}
/*
return -1 if not triangle
return 1 if triangle
*/
int CheckIfTriangle(int x,int y,int z)
{
if(((x+y)>z) && ((x+z)>y) && ((y+z)>x))
return (1);
else
return (-1);
}
int CheckIfRightTriangle(int x,int y,int z)
{
int largest,temp,smallest,mid;
temp = x > y ? x:y;
largest = temp > z ? temp : z;
temp = x < y ? x : y;
smallest = temp < z ? temp : z;
mid = (x + y + z) - (smallest + largest);
if(largest * largest == mid * mid + smallest * smallest)
return 1;
else
return -1;
}
float Area(int x,int y, int z)
{
float s;
s = (float)( x + y + z ) / 2;
return (float)(sqrt ( s * ( s - x ) * ( s - y ) * ( s - z )));
}
|
Last edited by raymundpogi; 5th Aug 2012 Sun at 10:59..
|

5th Aug 2012 Sun, 11:48
|
 |
Professional
|
|
Join Date: Feb 2012
Posts: 106
Reputation:
|
|
Re: -= Having Difficulty in C++? Be a Part of This Thread =-
Quote:
Originally Posted by raymundpogi
hindi po sir..
yung first input..magdedetermine kung ilang x,y,z ang iinput..kaya..di na po kailangan na lagyan ng choice yung code kung want pang mag-input o hindi na
base dun sa sample input..3 ang nakalagay..
edi..sa susunod na line..mag - iinput sya ng x,y,z ng tatlong beses..
then..pagkatapos mainput yung 3 beses na x,y,z
mag-aoutput na sya sa baba nung result nung 3x inputted x,y,z
ahm..kung gagamit ng array...nasa baba yung code..kaso..bawal pong gumamit ng array
|
Sabi mo eh. My point is hindi ko alam kung saan na kayo banda ng lessons nyu at kung saan ba nanggaling ang problem at solution. Kasi para sakin masyadong pinacomplicate mo yung solution mo at yung problem mo nalang naman ay kung papaano mo i'oouput sa ganyang form. Anyways
Code:
#include <iostream>
#include <cstdio>
#include <cmath>
#include <sstream>
using namespace std;
int main()
{
double x,y,z;
int n;
float Area,s;
bool istriangle, isright;
stringstream oss;
cout << "Triangle Checker and Area Solver" << endl << endl;
cout << "Enter no. of input/s: ";
cin >> n;
for (int i=0; i<n;i++) {
cout << "Enter 3 sides of a triangle, space-separated (e.g 3 5 4): ";
cin >> x;
if ( x > 5000)
return 1;
cin >> y;
if ( y > 5000)
return 1;
cin >> z;
if ( z > 5000)
return 1;
//check if triangle using rules given: x, y, z, then x+y>z, x+z>y, and y+z>x
if ((x+y>z) && (x+z>y) && (y+z>x)) {
istriangle = true;
//solve for area
s = ( x + y + z ) / 2;
Area = sqrt ( s * ( s - x ) * ( s - y ) * ( s - z ));
//checl if right
if ((x*x) + (y*y) == (z*z)) {
isright = true;
} else {
isright = false;
}
} else {
istriangle = false;
isright = false;
}
if ( istriangle){
if (isright) {
oss << x <<" " << y << " " << z ;
oss << " : RIGHT TRIANGLE WITH AREA " << Area << " UNITS SQUARED\n";
} else {
oss << x << " " << y << " " << z ;
oss << " : TRIANGLE WITH AREA " << Area << " UNITS SQUARED\n";
}
} else {
oss << x << " " << y << " " << z ;
oss << " : NOT A TRIANGLE" << endl;
}
}
cout << "\n" << oss.str();;
return 0;
}
Stupid question with obvious answer is stupid... and obvious.
#############
# Facebook Profile #
#############
Last edited by Asaman83687; 5th Aug 2012 Sun at 11:49..
|

5th Aug 2012 Sun, 12:10
|
 |
Forum Master
|
|
Join Date: Nov 2011
Posts: 2,238
Reputation:
|
|
Re: -= Having Difficulty in C++? Be a Part of This Thread =-
Quote:
Originally Posted by Asaman83687
Sabi mo eh. My point is hindi ko alam kung saan na kayo banda ng lessons nyu at kung saan ba nanggaling ang problem at solution. Kasi para sakin masyadong pinacomplicate mo yung solution mo at yung problem mo nalang naman ay kung papaano mo i'oouput sa ganyang form. Anyways
Code:
#include <iostream>
#include <cstdio>
#include <cmath>
#include <sstream>
using namespace std;
int main()
{
double x,y,z;
int n;
float Area,s;
bool istriangle, isright;
stringstream oss;
cout << "Triangle Checker and Area Solver" << endl << endl;
cout << "Enter no. of input/s: ";
cin >> n;
for (int i=0; i<n;i++) {
cout << "Enter 3 sides of a triangle, space-separated (e.g 3 5 4): ";
cin >> x;
if ( x > 5000)
return 1;
cin >> y;
if ( y > 5000)
return 1;
cin >> z;
if ( z > 5000)
return 1;
//check if triangle using rules given: x, y, z, then x+y>z, x+z>y, and y+z>x
if ((x+y>z) && (x+z>y) && (y+z>x)) {
istriangle = true;
//solve for area
s = ( x + y + z ) / 2;
Area = sqrt ( s * ( s - x ) * ( s - y ) * ( s - z ));
//checl if right
if ((x*x) + (y*y) == (z*z)) {
isright = true;
} else {
isright = false;
}
} else {
istriangle = false;
isright = false;
}
if ( istriangle){
if (isright) {
oss << x <<" " << y << " " << z ;
oss << " : RIGHT TRIANGLE WITH AREA " << Area << " UNITS SQUARED\n";
} else {
oss << x << " " << y << " " << z ;
oss << " : TRIANGLE WITH AREA " << Area << " UNITS SQUARED\n";
}
} else {
oss << x << " " << y << " " << z ;
oss << " : NOT A TRIANGLE" << endl;
}
}
cout << "\n" << oss.str();;
return 0;
}
|
ahm..eto plang po ang nadiscuss namin
Output statements (cout and cerr)
Input statements (cin)
Assignment statements
Operators and Expressions (+, -, *, /, %, ++, --, ? :, ()), and operator precedence
Relational Operators ( >, <, >=, <=, ==, != )
Library Functions (e.g., sqrt(), log(), exp(), pow(), cos(), sin())
And, Or, and Not operators (&&, ||, !)
Branching statements (if, if-else, switch-case)
Loop statements (for, while, do-while)
yung sa string..nadiscuss na namin..kaso..pag-input lang yun ng letter..exmple..name ng isang student..ganun lang po..pero yung ibang function pa ng sting..ay di pasamin dinidiscuss..at yung library na <sstream>...di pa po namin yan nadidiscuss
Last edited by raymundpogi; 5th Aug 2012 Sun at 12:12..
|

5th Aug 2012 Sun, 15:07
|
|
Forum Advisor
|
|
Join Date: Nov 2011
Posts: 508
Reputation:
|
|
Re: -= Having Difficulty in C++? Be a Part of This Thread =-
Quote:
Originally Posted by notevirus7
@ezroot
yes sir parang ganun na nga opensource naman siya medyo di nga lang umaandar utak namin nung nakita namin yung loob
Talaga sir? Sige willing akong pag aralan yan from scratch basta hindi matatagalan yung paggawa ng program kasi naghahabol na rin kami sa document + ang dami pa naming ginagawa school ngayon...
Tsaka sir willing din ang group namin na i-hire ka bilang programmer (if may time ka or kung ok lang sa inyo) babayaran ka na lang namin pero as of now, ayokong isipin mo na hindi kami gumagawa kaya malaking tulong sir kung maishashare mo samin yung paggawa ng motion detecting software.
And also sir by that you mean "SDK" ok lang ba gumamit niyan? kasi baka sabihin nanaman ng prof namin copyright yung ginagawa namen tulad nung dorgem app na nakuha namin sa internet
|
Asaman83687's suggestion is actually a better idea. If you think about it you barely know anything about dorgem. That means you have to learn its code base from scratch which could possibly cause more delays to your project. I can tell you, code maintenance is no fun and modifying/updating it always leads to more frustrations. That OpenCV is more promising than you could ever look for in an image processing library. I think almost all the algorithms you need are already in there, so you are only left to worry about the bigger picture of you project instead of the nitty-gritty details.
Remember, always start your project with a well designed and organized documentation before you even begin coding. Assign tasks to your group mates so they know where to focus their efforts. Follow a well structured design pattern and avoid creating functions that perform multiple tasks. Design with OOP in mind if you are already familiar with OOD/OOP concepts and principles. Doing so will not only make the project modular, manageable, extensible, readable, etc., but it'll save your group a lot of time in the long run.
Also, you might wanna register your project to an online repo such as Google Code or GitHub then either use git or svn to upload code so you and your group can update whenever you want. You can also use it as a reference you can attach to your resume when you start looking for work. Some employers actually scan through potential employee's repo projects as part of their hiring tactics.
... and if you get stuck you can always come back and ask questions.
|

5th Aug 2012 Sun, 19:20
|
 |
Forum Master
|
|
Join Date: Mar 2010
Posts: 2,061
Reputation:
|
|
Re: -= Having Difficulty in C++? Be a Part of This Thread =-
Salamat mga sir. Kaso so... itatanong ko muna sa prof namin kung ok lang ba gumamit ng framework pero, sariling software na yung gagawin namin? Pasensya na mga sir medyo wala pa kasi akong alam sa software development pero I will try my best.
|
 |
|
All times are GMT +8. The time now is 05:44.
|