User Profile

Collapse

Profile Sidebar

Collapse
ejack
ejack
Last Activity: Mar 26 '08, 08:18 PM
Joined: Mar 11 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • ejack
    replied to Multiplying money by 100 - loss of pennies
    in C
    Wow! Forgive me for being so uneducated, but that went way over my head. I think I get the big picture though. I've changed everything to ints and it seems to be working properly. Thank you for your help.
    See more | Go to post

    Leave a comment:


  • ejack
    replied to Multiplying money by 100 - loss of pennies
    in C
    "amount" is a double. When the user enters an amount, they can enter 5.23. Then what I'm trying to do is take that 5.23 and multiply by 100 so I can work with the modulus operator. Can you show me a better way? Thank you!...
    See more | Go to post

    Leave a comment:


  • ejack
    started a topic Multiplying money by 100 - loss of pennies
    in C

    Multiplying money by 100 - loss of pennies

    Hello! I am having issues with my code. My program is supposed to take a given amount of money (1.33) and tell how many quarters, dimes, nickels and pennies would make up this sum of money. Problem is when I multiply the input by 100, depending on the amount of money entered, I lose a penny. When I enter .34 it comes out correct, but when I enter .35, it gives me 34. Any and all help is greatly appreciated. Here is part of my code:
    ...
    See more | Go to post

  • ejack
    replied to Taking out duplicate items in a vector
    in C
    Well, it took a week, but I figured it out on my own. Thanks anyway.
    See more | Go to post

    Leave a comment:


  • ejack
    replied to Taking out duplicate items in a vector
    in C
    I guess I had better mention that I am in a C++ class and we haven't learned how to use set containers yet. My vector will hold no more than 15 items so is there a way to do it using vectors?

    Thank you for your help.l
    See more | Go to post

    Leave a comment:


  • ejack
    replied to Taking out duplicate items in a vector
    in C
    How do you use a set container? I'm very new to C++ Programming. Thank you for your help.
    See more | Go to post

    Leave a comment:


  • ejack
    started a topic Taking out duplicate items in a vector
    in C

    Taking out duplicate items in a vector

    Code:
    	int total = static_cast<int>(vComp.size()) - 1;
    	int tTotalUnits = 0;
    	float tTotalCostJob = 0;
    	int i = 0;
    	int j = 0;
    	int counter = 0;
    	bool foundFlag;
    
    	vector<string> vItems;
    	vector<string> vHolding;
    
    	for(i = 0; i < total; ++i)
    	{
    	// Push components into the vItems vector
    	   vHolding.push_back(vComp[i].GetType());
    ...
    See more | Go to post

  • ejack
    replied to vector of vectors
    in C
    That's it! That's exactly it! Thank you, thank you, THANK YOU!!!! I was making it much harder than it had to be. Thank you so much for all your help.
    See more | Go to post

    Leave a comment:


  • ejack
    replied to vector of vectors
    in C
    Studlyami:

    Thank you for your help.
    See more | Go to post

    Leave a comment:


  • ejack
    replied to vector of vectors
    in C
    That's exactly what I need the program to do. Here is the original Irrigation Estimator class. I just don't understand how to push items into the vComp vector:

    Code:
    class IrrigationEstimator
    {
    private:
    	vector<IrrigationComponent> vComp;
    	string companyName, busName;
    public:
    	IrrigationEstimator();
    	bool ReadData();
    	string WriteInvoice();
    };
    ...
    See more | Go to post

    Leave a comment:


  • ejack
    replied to vector of vectors
    in C
    Sorry about the code tags. Hope I did it right this time. Here is the IrrigationCompo nent class. Thank you so much for any and all help.

    Code:
    #include <string>
    using namespace std;
    
    
    class IrrigationComponent
    {
    private:
    	string type, name;
    	int required;
    	float gallons, gph, cost, totalCost;
    	void CalcCost();
    	void CalcGPH();
    
    public:
    ...
    See more | Go to post

    Leave a comment:


  • ejack
    started a topic vector of vectors
    in C

    vector of vectors

    Hello:

    This is my first time here so I hope I am doing this correctly. I am trying to push a vector object into a vector (I think). Here is my code (header file first) but it's only part of the code. Hope this is enough to make sense. I am getting the error:

    Code:
    IrrigationEstimator.cpp
    c:\documents and settings\developer\desktop\c++ ii\jacksonp5\jacksonp5\irrigationestimator.cpp(53) : error C2664: 'std::vector<_Ty>::push_back'
    ...
    See more | Go to post
    Last edited by Ganon11; Mar 12 '08, 04:18 PM. Reason: Please use the [CODE] tags provided.
No activity results to display
Show More
Working...