- Upvotes Received
- 2
- Posts with Upvotes
- 2
- Upvoting Members
- 2
- Downvotes Received
- 2
- Posts with Downvotes
- 2
- Downvoting Members
- 2
- Interests
- Life, Python Programming, Lego Mindstorms NXT, C++, C#, Web Development
Hello Programmers! I am working on a C++ phone number class. The class has overloaded stream manipulators, cin and cout for output. It has three private members: areaCode, exchange, and line, strings that represent the numbers that are used in a telephone call. It is supposed to default to (000) … |
|
Hello to all programmers out there. Considering the growing request for practice problems by the beginners, we ( Me, Joey, Niek, Aaron..) have decided to start a sticky which will host some common practice problems which would help the beginners in understanding the programming concepts in a better way. (Did … |
|
Hi all! Whenever I am working with my code in my main.cpp file, I can call character-handling functions like * isdigit * isalpha * isspace * toupper without importing the `cctype` library. However, my C++ How to Program Book shows that the cctype library must be imported before the functions … |
|
Hello all! I am trying to take a string that has mixed uppercase and lowercase chars and then convert it to lowercase. I am doing the following line of C++ code: transform(theReadMessage.begin(),theReadMessage.end(),theReadMessage.begin(),theReadMessage.end(),::tolower); //theReadMessage is a string to convert to lowercase and my C++ xCode debugger gives me this message `Too … |
|
Hi all! I am working on creating an SMS language translator (SMS -> real English), and I am having trouble initializing a map for the SMS -> English codes. My code is below: map<string, string> THE_SMS_CODES{ ".02","Your (or my) two cents worth", "10X", "Thanks", "2MI","Too much information", "2U2" ,"To You … |
|
Hello all! When would it be advisable to use string iterators vs the "for char c in string" loop that is a feature in C++-11 or vs the for (int i.....) loop? And why? The only two situations I see myself using string iterators is for the STL algorithms and … |
|
Hello all! I am working through a book here and it says that there is a class-template "basic_string" that is used in the namespace std as `typedef basic_string<char> string;` to create an alias for the "string" type. However, I know that there is a header file `<string>` for the declaration … |
|
Hello Programmers! I am trying to write a recursive implementation of the quicksort algorithm in C++. I believe you all know what it is so I shall not go into the details. However, I run this, but it never ends. Going through it with a debugger shows that my partitioning … |
|
I tried to restore my jailbroken iPad to factory settings. I clicked on the jailbroken device with iOS7 "restore to factory settings," and now it is loading for more than 8 hours (duing night). I was told that this was normal... but I do not believe it. All I have … |
|
Is it poor convention to create a c++ file only to store various functions, and then include it into the main.cpp? This would be done so that the functions could be used in different programs as well. |
|
Hello programmers! I am working on a program that checks if a user's input is a palindrome (in this case, the input is a string). I am using a custom class template "stack", that is a constrained version of my custom class "List", which is a linked list class template. … |
|
Hellp programmers! I am working on a program that uses two objects of a custom class template List [which is a linked list, with each item pointing to the next] and concatenates them. Initially, I need to input numbers into my main function, so I have two sets of while … |
|
Hello programmers! I am working on a custom tree class [with the code example being copied from Dietl's C++ How to Program, 9th edition]. It is in my fashion to copy all the code examples in the book when reading it (for muscle memory), but the authors created a custom … |
|
Hi programmers! I am trying to grasp the concept of friendship. Let's say that we have the following: class List; //forward declaration class ListNode { friend class List; //make List a friend /* rest of code here, blah, blah, blah. */ } Does this mean that ListNode can access Lists's … |
|
Hello! I was creating a custom array class as an exercise in my exploring of class and function templates. Here's my header file: #include <iostream> template <typename el> class Array { friend std::ostream &operator<<(std::ostream&,const Array&); friend std::istream &operator>>(std::istream&,Array&); public: Array(const int& arraySize=0); //set all members of array with size arraySize … |
|
Hello programmers! I recieved the following assignment to do in C#.net: It is a class that: * Accepts an HTML report string * Converts the HTML string into a PDF file using PDF Creator (free open source library) What are some utilities that I will need to use? I so … |
|
Hello programmers! I have been working on STL algorithms for some time now as a beginner, and I started doing an exercise, among which is the task of `use the fill algorithm to fill the entire array of strings named items with "hello"`. My code for this is below: // … |
|
I was just wondering, what is a good rule of thumb for industrial-grade code when deciding whether to use the std::array template vs a built-in array? |
|
Hello programmers! After covering the basics of STL, I decided to complete the following assignment: `Write a function template palindrome that takes a vector parameter and returns true or false according to whether the vector does or does not read the same forward a backward.` So, for example, a vector … |
|
Hello programmers! I am having a function that has the user enter a name for an object, check if its valid, and return it if it is. I am getting the input via getline, but it seems that you have to press enter twice to make the input work. Here's … |
|
Hello programmers! I have been working on a hardware store application, where there is a `HardwareRecord`class that stores information about each object in a store (ex: nuts, bolts, screws, and so forth). Here's my declaration of this class: // HardwareRecord.h // Initialize Hardware Store File // // // Definition of … |
|
Hello All, long time no see, I'm seeking for websites that provides practices of C++ and Java examples for programming students, the idea is to give me a programming question to solve in order to train myself. thanks. |
|
Hello programmers! I was working on a program that reads a sequential file with bank accounts. The file has three sets of data per line: the account #, the account holder's name, and balance. Then, I made a program to print the file- and it printed the last line of … |
|
This is a timer class that I wrote a while ago (cleaned up a bit for the snippet) for adding delays in some of the games I have written over the years. Note: I normally have the class functions in a .cpp file but since it looks like I can … |
|
Hello Programmers! I am working on a 'comics' page of my website. It is going to have multiple pictures (arranged neatly in a table) for the viewer to see and enjoy. I would like to have the images (by default) have a width of 10% of the browser window's width … |
|
Hello programmers! I am a beginner in html using the w3 school website help as a guide. Currently, I am working on an excercise website. The code is as following: <!DOCTYPE html> <html> <title><head> ------- Website </head></title> <body bgcolor= #FFCCFF BACKGROUND="background.gif"> <h1> What This Site Is All About: </h1> <hr … |
|
Hello programmers! I am working on a Tic-Tac-Toe player vs. computer class, which is supposed to have a `run.()` method in order for the game to start. In a `gameWon()` member function, I am checking for a win, either by the player or by the computer. I check to see … |
|
Hello Programmers! How can I throw an exception if an unsigned int variable overcomes a limit (that is set by myself). I want the exception to terminate all processes. Thanks! |
|
Hello programmers! I am making a player vs. computer Tic-Tac-Toe game in xCode that is a class, with its `run()` method as its only public member function apart from the initializer. I want to decide whether the player goes first, and I created a function to do that called `determineFirst()`. … |