Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: bnd98
  • Order by date
  1. bnd98

    Write data to disk file

    Pete, Thank you very much for that information. It is working and saving to the file. Only one more problem that I would like to ask you about. When I open the file that it creates (book.data), it does not appear correctly for the title or the name. For instance, if I put the title as...
  2. bnd98

    Write data to disk file

    Actually it is not a class assignment, I am just trying to get a better understanding of the language. And I don't want to open it in a hex editor or viewer, I want to open it in notepad. And I know this is possible and I know that there is a way to do this but again I am missing...
  3. bnd98

    Write data to disk file

    I have changed a lot in my code. The problem I have now is that when it does write the information to disk, it does not write it correctly. It shows a lot of odd characters. What am I missing now? Seems like something simple but I am unable to locate the error. Now I would like for the user to...
  4. bnd98

    Write data to disk file

    I would like to write the following information to disk. How would I go about doing so? Any tips are greatly appreciated. #include<fstream.h> #include<conio.h> #include<string.h> class Book { private: char title[30]; char name[30]; double price; int pages; public: void setBook(char t[]...
  5. bnd98

    I have this code and in the main fu

    All I had to do was take temp.displayMeal(); out of the loop. Everything works fine. Thank you for your help...didn't realize it was such a simple error.
  6. bnd98

    I have this code and in the main fu

    I can get the &quot;Total weekly calories:&quot; to display only once but then the amount is incorrect. What now?
  7. bnd98

    I have this code and in the main fu

    It is displaying this. I input 1 calorie. Total Weekly Calories 1 Total Weekly Calories 2 Total Weekly Calories 3 Total Weekly Calories 4 Total Weekly Calories 5 Total Weekly Calories 6 Total Weekly Calories 7 I want it to only show the last line Total Weekly Calories 7 What do you mean call...
  8. bnd98

    I have this code and in the main fu

    Okay here the code is again. I think I have made all of the necessary changes that were suggested to me. It is adding the calories but it is still displaying &quot;Total weekly calories:&quot; 7 times. I have tried to change everything that I can possibly think of and nothing. Debbie...
  9. bnd98

    I have this code and in the main fu

    Thank you so much, I was pulling my hair out for that one! Okay one more question if you don't mind. I want to write another main for the same program except for this time I want it to declare an array of 7 Meal objects. I let the user enter the values for the week. Then I want to total these...
  10. bnd98

    I have this code and in the main fu

    How do I go about doing this? I have tried everything that I can think of and nothing. In public can I use: void operator=(Meal &otherMeal); And if so then what do I need to copy only the calorie and not the entree?
  11. bnd98

    I have this code and in the main fu

    So it should display &quot;Daily Total: &quot; right? And then after that I want it to take the three meals, add the calories and display that. However even with the Meal total(&quot;Daily Total: &quot;, 0); total = breakfast + lunch + dinner; it still displays &quot;Pizza&quot;. Is there...
  12. bnd98

    I have this code and in the main fu

    Thanks! However it is still displaying &quot;Pizza&quot;.
  13. bnd98

    I have this code and in the main fu

    I have this code and in the main function I want to display &quot;Daily Total: &quot; however it is displaying &quot;Pizza&quot; instead due to the constructor? Any suggestions on how to fix this problem? #include<iostream.h> #include<conio.h> #include<string.h> class Meal { friend ostream&...
  14. bnd98

    Classes, overloaded insertion operator and such

    I fixed all of the problems. Boy was I way off. Thanks again you two!
  15. bnd98

    Classes, overloaded insertion operator and such

    Amazing what you see after you post :-) This is one part that I corrected after I posted. istream& operator>>(istream& in, Meal &oMeal) { cout<<&quot;Enter the entree name: &quot;; in>>oMeal.entree; cout<<&quot;Enter the amount of calories: &quot;; in>>oMeal.calorie; return(in); };
  16. bnd98

    Classes, overloaded insertion operator and such

    Thank you both! Now this is the code that I have and I think that it covers A thru D: #include<iostream.h> #include<conio.h> #include<string.h> class Meal { friend ostream& operator<<(ostream& out, const Meal &oMeal); friend istream& operator>>(istream& in, Meal &oMeal); private: char...
  17. bnd98

    Classes, overloaded insertion operator and such

    Looks like a great forum! After many years going to the same job day after day I decided to take a class to see what may spark some interest. It's a free class, and we do not even get grades, just sort of an introductory. Well I am stuck (at least not on the first program) and have no idea what...

Part and Inventory Search

Back
Top