Mike "Wuzzy121". Rest in peace, brother

Go Back   Tacoma World Forums > Off-Topic > Off-Topic Discussion

Notices

C++/Computer Programming

Reply
 
Thread Tools Search this Thread
Old 12-06-2012, 10:48 AM   #1
jeckel7234 [OP] jeckel7234 is offline
Senior Member
jeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shed
 
jeckel7234's Avatar
Air Force: Crew Chief 62 AMXS
Name: Drew
Joined: May 2011, #56533
Location: VA
Gender: Male
Posts: 878
jeckel7234's Tacoma Gallery
C++/Computer Programming

I would rather go to a Nicki Manaj concert with justin bieber, driving in a civic with a huge wing, wearing a polo (with collar popped), drinking a bud light, fitted turned to the side, and be raped by these people than ever do anything regarding c++ ever again.

http://www.youtube.com/watch?feature...&v=3zvTRQr7ns8


any professionals with c++ trying to help a bro out?
  Reply With Quote
Old 12-06-2012, 03:33 PM   #2
Senior Member
yarik83 is one of the sharper tools in the shedyarik83 is one of the sharper tools in the shedyarik83 is one of the sharper tools in the shedyarik83 is one of the sharper tools in the shedyarik83 is one of the sharper tools in the shedyarik83 is one of the sharper tools in the shedyarik83 is one of the sharper tools in the shedyarik83 is one of the sharper tools in the shedyarik83 is one of the sharper tools in the shedyarik83 is one of the sharper tools in the shedyarik83 is one of the sharper tools in the shed
Name: Yuri
Joined: May 2010, #38026
Location: Florida
Age: 31
Gender: Male
Posts: 218
yarik83's Tacoma Gallery
When I first went to college I was going to be a computer engineer. About 2nd year into it... after taking visual basic, java, c, c++, fortran... I quit trying and switched a different career field.

What happened to me was an atrocity. I was there to learn... everyone else was there to get credits because they were programming since age 4.

Computer programming language is about second most stupid thing that happened to computers. Every computer language is slightly different and they all have to be debugged and all it would take is missing one character somewhere and a space there and a quotation or asterisk there and pow... entire thing does not work.

I make my living using other people's code now. People right scripts which work with software packages I am using and that is so much easier.

Stay strong my friend.
  Reply With Quote
Old 12-06-2012, 03:55 PM   #3
There's an evil monkey in my truck
Evil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shed
 
Evil Monkey's Avatar
Navy: Tradevman (flight simulator tech), Aviation Electrician (F-14a), Computer Scientist(civ)
Name: Robert
Joined: Aug 2007, #2352
Location: Escondido, CA
Age: 52
Gender: Male
Posts: 8,377
Evil Monkey's Tacoma Gallery
Quote:
Originally Posted by yarik83 View Post
Computer programming language is about second most stupid thing that happened to computers.
Huh??!!
I don't know how you'd get a computer to do anything without computer programming. Ever tried programming a computer with ones and zeros? Programming languages make it easier.
  Reply With Quote
Old 12-06-2012, 03:55 PM   #4
There's an evil monkey in my truck
Evil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shed
 
Evil Monkey's Avatar
Navy: Tradevman (flight simulator tech), Aviation Electrician (F-14a), Computer Scientist(civ)
Name: Robert
Joined: Aug 2007, #2352
Location: Escondido, CA
Age: 52
Gender: Male
Posts: 8,377
Evil Monkey's Tacoma Gallery
Quote:
Originally Posted by jeckel7234 View Post
I would rather go to a Nicki Manaj concert with justin bieber, driving in a civic with a huge wing, wearing a polo (with collar popped), drinking a bud light, fitted turned to the side, and be raped by these people than ever do anything regarding c++ ever again.

http://www.youtube.com/watch?feature...&v=3zvTRQr7ns8


any professionals with c++ trying to help a bro out?
I know some. What's the issue?
  Reply With Quote
Old 12-06-2012, 05:21 PM   #5
Senior Member
yarik83 is one of the sharper tools in the shedyarik83 is one of the sharper tools in the shedyarik83 is one of the sharper tools in the shedyarik83 is one of the sharper tools in the shedyarik83 is one of the sharper tools in the shedyarik83 is one of the sharper tools in the shedyarik83 is one of the sharper tools in the shedyarik83 is one of the sharper tools in the shedyarik83 is one of the sharper tools in the shedyarik83 is one of the sharper tools in the shedyarik83 is one of the sharper tools in the shed
Name: Yuri
Joined: May 2010, #38026
Location: Florida
Age: 31
Gender: Male
Posts: 218
yarik83's Tacoma Gallery
If you learn computer programming language without paying $258/credit hour and learn it at your own leisure then you have nothing to worry about. If you are attending college full time, work full time, juggle homework and all that stuff and you are the only person in your class of 300 that actually needs to learn... you are in for a treat.

Do I think that computer language is necessary? Absolutely. Heck I use it daily at work in some capacity... but there is a significant disparity between syntax of programming languages. If you are learning for the first time try and learn Java, C++ at the same time and see how fun that experience will become. Both languages are essentially the same but ohh so much different. C++ flows with logic and simplicity while Java evokes feeling of "why is it.... ohh it can't possibly be the issue... doh... I missed a character".

Basic of programming is all about logic. You set your environment, set variables and parameters, write some call commands and then deeper you get into it... its pulling this script from here, that code from there, this command from there. But problem is that when you have to learn all that in a limited time frame under pressure of failure... learning programming will be a pain.

In my college flunk out rate for programming was pretty substantial. Every class started with 100-300 students in auditoriums then proceeded with 30 students in a class environment. Halfway through semester.... most of auditorium was empty.

But I am heavily biased because of my experiences so take my advise with a grain of salt.

90% of your errors are syntax.
9% of your errors are calling on a code/command/script that does not exist
1% of your errors are usually failure in logic.

Most of the time you know what needs to be done and how to do it and you write the code and it wont work... 3 days later with debugging it still wont work and then you run it on another machine and it runs like a champ. Or better yet... you make it run on your machine... submit code for review and it wont run on TA's or professors computer.

Tough luck eh?

I use VB and SQL on a daily basis because of how ArcMap works and rely on scripts too. I recently in past 2 years started learning python on my own time. And it is so much easier learning it on your own time.... not even funny.

P.S.
#1 problem with computer programming (since I already mentioned #2) is failure of debug software to clear out the error state. You make an error, debug, fix the error and it still crashes... reboot computer and pow that sucker runs like a champ. True story.
  Reply With Quote
Old 12-06-2012, 05:26 PM   #6
When Hell Freezes Over I'll Ski There Too
Pchop is one of the sharper tools in the shedPchop is one of the sharper tools in the shedPchop is one of the sharper tools in the shedPchop is one of the sharper tools in the shedPchop is one of the sharper tools in the shedPchop is one of the sharper tools in the shedPchop is one of the sharper tools in the shedPchop is one of the sharper tools in the shedPchop is one of the sharper tools in the shedPchop is one of the sharper tools in the shedPchop is one of the sharper tools in the shed
 
Pchop's Avatar
Navy: Aviation Machinist Mate
Name: Rob I
Joined: Sep 2012, #87171
Location: North Dakota
Gender: Guy
Posts: 8,718
Pchop's Tacoma Gallery
I stumbled into the wrong post. Reading this is like watching a Charlie Brown episode to me:
"Wah wa wah wah wa waa wah"

Hats off to you guys, I would rather try and learn fucking Vietnamese than try and decipher that shit.
But then again you guys probably couldnt manage a 400 person construction site so I guess we are even
  Reply With Quote
Old 12-06-2012, 05:29 PM   #7
Senior Member
04LTtacoma is one of the sharper tools in the shed04LTtacoma is one of the sharper tools in the shed04LTtacoma is one of the sharper tools in the shed04LTtacoma is one of the sharper tools in the shed04LTtacoma is one of the sharper tools in the shed04LTtacoma is one of the sharper tools in the shed04LTtacoma is one of the sharper tools in the shed04LTtacoma is one of the sharper tools in the shed04LTtacoma is one of the sharper tools in the shed04LTtacoma is one of the sharper tools in the shed04LTtacoma is one of the sharper tools in the shed
 
04LTtacoma's Avatar
Name: Zach
Joined: May 2010, #37190
Location: Oregon
Gender: Male
Posts: 11,140
04LTtacoma's Tacoma Gallery
Quote:
Originally Posted by jeckel7234 View Post
I would rather go to a Nicki Manaj concert with justin bieber, driving in a civic with a huge wing, wearing a polo (with collar popped), drinking a bud light, fitted turned to the side, and be raped by these people than ever do anything regarding c++ ever again.

http://www.youtube.com/watch?feature...&v=3zvTRQr7ns8


any professionals with c++ trying to help a bro out?
Well, at least you are done with programming... I got a few program classes I have to take as well, not looking forward to it.
  Reply With Quote
Old 12-06-2012, 05:32 PM   #8
Senior Member
zbaldo has a spectacular aura aboutzbaldo has a spectacular aura about
 
zbaldo's Avatar
Name: Ozzy
Joined: Feb 2012, #72550
Location: Torrance, Ca
Gender: Male
Posts: 427
zbaldo's Tacoma Gallery
Everybody is good at something right.
God luck
I know a guy that worked stocks and such after years of work he went bald
  Reply With Quote
Old 12-06-2012, 05:33 PM   #9
When Hell Freezes Over I'll Ski There Too
Pchop is one of the sharper tools in the shedPchop is one of the sharper tools in the shedPchop is one of the sharper tools in the shedPchop is one of the sharper tools in the shedPchop is one of the sharper tools in the shedPchop is one of the sharper tools in the shedPchop is one of the sharper tools in the shedPchop is one of the sharper tools in the shedPchop is one of the sharper tools in the shedPchop is one of the sharper tools in the shedPchop is one of the sharper tools in the shed
 
Pchop's Avatar
Navy: Aviation Machinist Mate
Name: Rob I
Joined: Sep 2012, #87171
Location: North Dakota
Gender: Guy
Posts: 8,718
Pchop's Tacoma Gallery
Not going bald, just greying out like a boss:|
  Reply With Quote
Old 12-06-2012, 05:58 PM   #10
your TW web developer!
rondog is one of the sharper tools in the shedrondog is one of the sharper tools in the shedrondog is one of the sharper tools in the shedrondog is one of the sharper tools in the shedrondog is one of the sharper tools in the shedrondog is one of the sharper tools in the shedrondog is one of the sharper tools in the shedrondog is one of the sharper tools in the shedrondog is one of the sharper tools in the shedrondog is one of the sharper tools in the shedrondog is one of the sharper tools in the shed
 
rondog's Avatar
Name: Ronnie
Joined: Nov 2010, #45618
Location: Escondido/San Diego
Age: 28
Gender: Male
Posts: 2,024
rondog's Tacoma Gallery
what are you trying to do in c++? I know quite a few languages and might be able to help.
  Reply With Quote
Old 12-06-2012, 06:07 PM   #11
AKA Crash Bandicoot
ChamYota is one of the sharper tools in the shedChamYota is one of the sharper tools in the shedChamYota is one of the sharper tools in the shedChamYota is one of the sharper tools in the shedChamYota is one of the sharper tools in the shedChamYota is one of the sharper tools in the shedChamYota is one of the sharper tools in the shedChamYota is one of the sharper tools in the shedChamYota is one of the sharper tools in the shedChamYota is one of the sharper tools in the shedChamYota is one of the sharper tools in the shed
 
ChamYota's Avatar
Army: National Guard: Infantry/ROTC Cadet
Name: Cam
Joined: Jul 2011, #59431
Location: Clemson,South Carolina
Age: 20
Gender: Male
Posts: 8,175
ChamYota's Tacoma Gallery
Im a Computer Science major(BS) at Clemson, and so far, im pretty much enjoying it, yes the frustration that comes from missing just one character is pretty epic, but for the most part, the possibilities are sickening and the pay will be as well.
  Reply With Quote
Old 12-06-2012, 08:42 PM   #12
jeckel7234 [OP] jeckel7234 is offline
Senior Member
jeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shed
 
jeckel7234's Avatar
Air Force: Crew Chief 62 AMXS
Name: Drew
Joined: May 2011, #56533
Location: VA
Gender: Male
Posts: 878
jeckel7234's Tacoma Gallery
Im not done yet, i only have one class that involves c++ i should be using matlab the rest of the way. Im working on a project which is driving me a little crazy, its like a constant mental block, every thing im reading or watching on youtube about it is getting me nowhere. If anybody cares/wants to help I would be extremely greatful.


Problem
For this problem, you will design and implement 2 classes and then write a driver function to test these classes. The first will be a C++ class for an abstract data type color with a public enumeration type colorType that has the color values shown in Listing 10.8. Your abstract data type should have an attribute for storing a single value of type colortype and member functions for reading (readColor) and writing (writeColor) a color value as well as setting and accessing it. The function readColor should read a color as a string and store the corresponding color value in the value attribute of a type color object. The function writeColor should display as a string the value stored in the value attribute of a type color object (see Figure 7.5). Modify class circle and the driver function in Listing 10.9 to include and use this class. You’ll need to remove the declaration for color in class circle. Test your modified driver function with the new color and circle classes.

The second class will be to design and implement a rectangle class similar to class circle. Be sure to incorporate the new color class you have written and tested in the first part of the programming exercise. Write a client program that asks the user to enter a shape name (circle or rectangle) and then asks the user for the necessary data for an object of that class. The program should create the object and display all its attributes.
  Reply With Quote
Old 12-06-2012, 08:43 PM   #13
jeckel7234 [OP] jeckel7234 is offline
Senior Member
jeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shed
 
jeckel7234's Avatar
Air Force: Crew Chief 62 AMXS
Name: Drew
Joined: May 2011, #56533
Location: VA
Gender: Male
Posts: 878
jeckel7234's Tacoma Gallery
This is what I have so far

circletest.cpp
#include "circle.h"
#include <iostream>
using namespace std;

int main()
{
circle myCircle(10);
float area, perimeter;

// Set circle attributes.
myCircle.setCoord(150, 100);
myCircle.setColor(circle::magenta);

// Compute area and perimeter
area = myCircle.computeArea();
perimeter = myCircle.computePerimeter();

// Display the circle attributes.
cout << "The circle attributes follow:" << endl;
myCircle.displayCircle();

// Display area and perimeter.
cout << "area is " << area << endl;
cout << "perimeter is " << perimeter << endl;

return 0;
}




circle.h
#ifndef CIRCLE_H
#define CIRCLE_H

class circle
{
public:
// enumeration type
enum color {black, blue, green, cyan, red,
magenta, brown, lightgray, nocolor};

// Member Functions
// constructor
circle(int);

// Set center coordinates
void setCoord(int, int);

// Set radius
void setRadius(int);

// Set color
void setColor(color);

// Compute the area
float computeArea();

// Compute the perimeter
float computePerimeter();

// Display attributes
void displayCircle() const;

// accessor functions
int getX() const;
int getY() const;
int getRadius() const;
color getColor() const;


private:
// Data members (attributes)
int x;
int y;
int radius;
color cColor;

};

#endif // CIRCLE_H




circle.cpp
#include "circle.h"
#include <iostream>
using namespace std;

const float pi = 3.14159;

// Member Functions...
// constructor
circle::circle(int r)
{
x = 0;
y = 0;
radius = r;
cColor = nocolor;
}

// Set center position
void circle::setCoord(int xArg, int yArg)
{
x = xArg;
y = yArg;
}


// Set radius
void circle::setRadius(int r)
{
radius = r;
}


// Set color
void circle::setColor(color c)
{
cColor = c;
}


// Compute the area
float circle::computeArea()
{
return pi * radius * radius;
}


// Compute the perimeter
float circle::computePerimeter()
{
return 2 * pi * radius;
}


// Display attributes
void circle::displayCircle() const
{
cout << "x-coordinate is " << x << endl;
cout << "y-coordinate is " << y << endl;
cout << "radius is " << radius << endl;
cout << "color is " << int(cColor) << endl;

}


// accessor functions
circle::color circle::getColor() const
{
return cColor;
}

// Insert definitions for rest of accessor functions here.
// ...

int circle::getX() const
{ return x;
}

int circle::getY() const
{ return y;
}

int circle::getRadius() const
{ return radius;
}
  Reply With Quote
Old 12-06-2012, 08:45 PM   #14
jeckel7234 [OP] jeckel7234 is offline
Senior Member
jeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shedjeckel7234 is one of the sharper tools in the shed
 
jeckel7234's Avatar
Air Force: Crew Chief 62 AMXS
Name: Drew
Joined: May 2011, #56533
Location: VA
Gender: Male
Posts: 878
jeckel7234's Tacoma Gallery
^ I've gotten that far with random help from the teacher and talking to my buddys brother over facebook. I'm just lost on were to go now after I have the 2 original functions and a driver function
  Reply With Quote
Old 12-07-2012, 03:30 PM   #15
There's an evil monkey in my truck
Evil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shedEvil Monkey is one of the sharper tools in the shed
 
Evil Monkey's Avatar
Navy: Tradevman (flight simulator tech), Aviation Electrician (F-14a), Computer Scientist(civ)
Name: Robert
Joined: Aug 2007, #2352
Location: Escondido, CA
Age: 52
Gender: Male
Posts: 8,377
Evil Monkey's Tacoma Gallery
So the problem looks like it is asking you to create a separate abstract class for the color (an abstract class has one or more pure virtual functions in it). The circle class would then inherit that abstract color class. The way it is listed, the circle class is implementing the color which is not what you want. They're trying to teach inheritance and common interfaces. So your color class can be used in the rectangle class without modifying it or doing a cut-n-paste from one code section to the next.


So you'll need another class with one or more pure virtual functions (to make it an abstract class) and inherit that class into your circle/rectangle classes.

http://www.learncpp.com/cpp-tutorial...rface-classes/

In the example above, your Color class would be similar to the "Animal" class and your circle and rectangle class would be similar to how the cow class is implemented.
  Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
Transponder Key Programming LMR 2nd Gen. Tacomas 18 11-22-2013 08:40 PM
2012 programming mdcmn7 2nd Gen. Tacomas 1 07-15-2012 02:43 AM
ECU programming SevenEmPower 1st Gen. Tacomas 0 06-18-2012 12:38 PM
All you computer guys- Market for new computer MedlinAround Technology 6 12-31-2011 02:17 PM
c++ or java programming deadbolt Off-Topic Discussion 11 06-22-2010 07:27 AM


Copyright © 2014 Tacoma Forum. Tacoma World is not owned by, or affiliated with Toyota Motor Corporation.