Beginners - April 2018 (Page 25)

How do I create a frequency table of strings?
 
I need to write a piece of code counts the string inputted and shows how many times each string occurred, essentially a frequency table of strings. So, user ent...
[5 replies] Last: The while loop puts strings s into the map. If s isn't yet in the ma... (by lastchance)
While Loop Trouble Help Needed
 
Hello. I have two issues with my code. The first one is that I'm trying to use a while function to terminate the program when the word "none" is typed for th...
[1 reply] : Line 16 looks like its from another program. It makes no sense here. D... (by tpb)
Printing arrays with pointers
 
I modified the 2darray A to get array B. I need to use pointers to print both as AAAA BBBB. A has its own rows and columns and B has its own. but I can only pri...
[1 reply] : #include <iostream> #include <iomanip> using namespace std; int mai... (by tpb)
Generate symbol randomly
 
Hello.I'm doing my school assignment. I want the code that to generate any two symbols from # $ X O once randomly. For example , $X . I have written some code b...
[2 replies] Last: You can use C++'s random library. #include <iostream> #include <rand... (by tpb)
by jen400
linear search problem
 
hey! so I am writing a code that will determine the max profit from buying and selling stock prices. Example: Sample Output: Input: [7, 1, 5, 3, 6, 4] Output:...
[1 reply] : Your algorithm is flawed. The maximum and minimum numbers have nothing... (by tpb)
easy answer? on Heaps
 
Ok, so many places online that I am looking for help represent a heap as a pyramid binary tree looking visual representation. so for example: 45,7,20,2,6,12,10 ...
[1 reply] : Drawing the heap as-if it was a binary tree helps illustrate the heap ... (by mbozzi)
by abc456
How to fix code that counts letters in words?
 
This code works correctly. However I've been trying to get it to count and output the NUMBER of 3 letter words, 4 letter words etc. I'm not sure how to do this....
[6 replies] Last: thanks everyone for your help i got it working :) (by abc456)
Extraction operator overloading confusion!
 
Hi all! I have been stuck on extraction overloading for hours now and the error code i get is "All paths through this function will call itself" if that helps!...
[4 replies] Last: const means that it's an object that cannot be modified after being in... (by Ganado)
I'm Having Trouble Multiplying Matrices, Need Help
 
Hello. I am a beginner user with C++ on Cygwin and I am having trouble multiplying two already-established matrices together with nests and I'm having a little ...
[2 replies] Last: Your loop on lines 14--16 assumes that the A has 3 columns and that t... (by ITOYEN2049)
by Vendal
Function Overloading
 
Working on another section and encountered a problem. Maybe its me having stayed up all night doing calculus, but I just seem to continue running into errors. ...
[9 replies] Last: Making mistakes, even simple ones such as yours, is how we learn and i... (by closed account E0p9LyTq)
How to extract whole words from char array
 
I have to read a text file of words into a stack and queue in order to check if hey are palindromes. I'm not allowed the use of string so I'm reading the text i...
[8 replies] Last: #include <iostream> #include <stack> #include <queue> #include <cstri... (by lastchance)
c++ function
 
this is my question::) Lalala Playland offers great discounts for entrance tickets during the school holidays. The following are the prices and discounts given...
[1 reply] : this is my question::) There's no question there. (by Repeater)
Unexpected Output
 
#include <iostream> #include <cstdlib> using namespace std; int main() { int num; int y ; cout << "Enter the amount of numbers you w...
[8 replies] Last: @chipp, Your particular compiler implementation seems to require the ... (by closed account E0p9LyTq)
Understanding vector implementation
 
// A simple representation of graph using STL #include <vector> #include <iostream> using namespace std; // A utility function to add an edge in an //...
[2 replies] Last: @lastchance, thanks for the explanation (by Student555)
priority_queue of objects
 
hello everybody. i don't exactly understand why this code does not work. i'm simply trying to create a priority_queue of objects from a class: #include <...
[2 replies] Last: thank you, i searched why it should be const, and now i understand :) (by Stauricus)
how can i delay my console program when executing?
 
hello guys. am creating a console application and i hav a problems 1). i wanna let my program delay befor other output. like delaying in 1second before conti...
[4 replies] Last: To 1. if you use Windows and can't use C++11 then Sleep is an option -... (by Thomas1965)
I just want to understand
 
Hey guys please help me with this assignment we were given the other day. I have yet to understand since my lecturer was too fast. Would appreciate your feedb...
[2 replies] Last: Hello Andy, Thanks for the response. Let me try if I get stuck I wil... (by Dero8080)
c++ program for successive adding
 
How do I make a program add successive numbers starting with one until the sum is greater than or equal to 100? I know I need a loop for this one, just not sure...
[1 reply] : int sum = 0; for (int n = 1; sum < 100; n++) sum += n; ... (by mbozzi)
April 2018 Pages: 1... 232425
  Archived months: [mar2018] [may2018]

This is an archived page. To post a new message, go to the current page.