Almost there I think. What am I doing wrong in my class declaration file? I think reset() would have to be able receive two integers to reset private member variables pizzaSize and pizzaTop. However, I seem to be running into problems when I try to return Pizza (my constructor) to void Pizza:reset(). Do I need to change void Pizza::reset() to enable it to accept two integers? Ex: Pizza::reset(in t, int) Here's what I have:
...
User Profile
Collapse
-
I've tried to use a pointer like it suggests. Here's is what I did to my Pizza_Program.c pp file:
...Code:// "Pizza_Program.cpp" // Program simulates a simple pizza parlor menu ordering system #include "Pizza.h" #include <iostream> #include <iomanip> using namespace std; // Function prototypes void displayMenu();
Leave a comment:
-
Thank you again for the continued input. I still have having trouble getting it to compile. I have five errors which is down from the original 11 that I had....yay!. They are all in my pizza_program.c pp file. They say I have to create a pointer to a member. I'm not sure why I need a pointer. Here are the error messages:
Error 1 error C3867: 'Pizza::getPizz aSize': function call missing argument list; use '&Pizza::getPiz zaSize'...Leave a comment:
-
I think I've made the changes you suggested. I created a default constructor and have passed an instance of Pizza to both the size and topping function in main(). I'm still having problems with it compiling. Also, I'm not sure what to call in selection 'D' from the menu. Should I call the default constructor to clear previous customer selections? Here is my code:
...Code:// "Pizza.h" // Specification file
Leave a comment:
-
I understand what you said about passing nothing to my size function.....I can just pass a default value of 10"......howeve r, not sure what you mean about making a pizza first and then calling size and toppings. Do you mean I should first make a pizza feeding in all the default arguments (first choices of size and topping menu)? Thank you for your earlier reply. Will continue working on project tomorrow.Leave a comment:
-
C++ assignment dealing with classes and functions
I'm not sure if I'm heading in the right direction with this school project. I am suppose to create a 3 file, class based program that will allow you to run a very simple pizza parlor program. The menu should be displayed similar to what is shown below.
MENU
--------------------------------------------------------------------------------------------
A) What size of pizza... -
dropping lowest value after an ascending sort
Does anyone know what I can do to this function to get it to drop the lowest value? Thanks for any insight.
...Code:void sort(double* score, int size) { int startScan; int minIndex; double minValue; for (startScan = 0; startScan < (size - 1); startScan++) { minIndex = startScan; minValue = score[startScan]; for (int index = startScan -
Just curious, how do you set it to unicode. Is it:
#include <unicode>
Something like that?Leave a comment:
-
Here's the code you were wanting to know about. For future reference it is better if you have a question to at least post the code you have tried as nickyeng said in his last post. This forum is a wonderful resource, but only if you're willing to try and learn yourself. I myself am new to C++ and have always found that members of this forum will help as long as you're giving an honest effort. Good luck with the rest of your classes. The program...Leave a comment:
-
-
Thank you for your input. The code worked like a charm. Now time for me to actually dig into how that formula actually works.Leave a comment:
-
Gannon, excellent class. Enjoyed how you presented the material; it was very easy to understand, and the visuals of code you gave I'm sure will prove to be beneficial as we get into more complicated material.
Thanks for taking the time to teach this class! I look forward to many more.Leave a comment:
-
Possible use of counter in function?
Have a quick question dealing with a program I've been working on all day. The program meets all the requirements for class and has displayed proper output through various tests. What I want to know is if i could use a counter of some sort in my printPattern function to count the total number of characters printed in the pattern. I have the logic worked out in my printLastLine function, but what if I had a program that had the possibility of going... -
Ah yes! Thank you so much Gannon, that did it! One more function and I've got the program working. I've been stuck on that for the last hour or so, many thanks to you and Sicarie!Leave a comment:
-
Here is my new code, still having problems however.
...Code:// Program allows user to select number and type of pattern to be printed to screen #include <iostream> using namespace std; // Function prototypes void getInput(int&, char&); void printError(int&, char&); int printPattern(int, char); int main() { intLeave a comment:
-
I'm sorry Sicarie. You should be very familiar with this code as you helped me with the original program. This new program is simply an extension of that using functions. I didn't mean to post my code with the unfinished printPattern function for any to see. What I am trying to pass to the printPattern function is the input I recieve from the user in my getInput function. However, I don't think that information is being passed back to my main...Leave a comment:
-
Trouble with passing variables into a function
I am having trouble passing two variable types into my printPattern function. I need to pass rows and characterSelect from my getInput function into my printPattern function. I keep getting a "printPatte rn function does not take 0 arguments" error. I'm pretty sure this means nothing is being passed to my printPattern function, but I can't figure out why. Does anyone have any suggestions? Here's my code:
...Code: -
Thank you so much for your help. That seemed to clear everything up.Leave a comment:
-
Help with input validation
I am having problem with my printError function. It handles incorrect input from user dealing with the numerical range. However, on the second condition being evaluated (dealing with character selection for the pattern) I always recieve "Invalid character.", even if the selection is of an eligible type. Here's my code:
...Code:/ Definition of printError which determines if user has entered * // acceptable
-
I may be out of place suggesting this since I am in no way contributing to the teaching of this class, but this is just a suggestion. Maybe once we actually delve into the coding aspect of C++, we could be given a problem/program to solve; and discuss, later in the week, any problems one may have encountered with writing the program. Just a thought. That way everyone would actually get some hands-on time with the actual code!Leave a comment:
No activity results to display
Show More
Leave a comment: