General C++ Programming - April 2021 (Page 4)

replace vowels with undescore sr.at(i)
 
In this program, you ask user to enter a sentence and read it using string class function getline. Use a for loop to iterate through all characters. Please use ...
[2 replies] Last: As C++17: #include <string> #include <iostream> #include <cstring> ... (by seeplus)
Assignment 5 problem 3
 
Problem 3: Radioactive active decay Your program should display the amount of A/A0 in a patient body every hour for 24 hours after receiving the dose. Prompt u...
[2 replies] Last: Your instructions are missing a rather fundamental parameter. You will... (by lastchance)
output is not displaying correctly because of spaces in text file
 
I am having trouble outputting the data of my text file correctly. There are a few street addresses that have spaces in the street name, therefore it's causing ...
[1 reply] : First, use code tags when posting code. http://www.cplusplus.com/artic... (by salem c)
prime factorization
 
I have a question for prime factorization since I am being asked to validate the input to exclude anything that is a string, character, or a negative number us...
[4 replies] Last: read it in as a string, see if it is a number .. for positive values, ... (by jonnin)
Where is getopt
 
Does anyone know where to find getopt?
[4 replies] Last: if you google it, there are some workarounds ready to download. https:... (by JustShinigami)
Algorithm development
 
I am a student of number truth and I have taken on a mathematical problem to further disprove if numbers are truly random and can be predicted using high ord...
[2 replies] Last: after you generate this, consider dumping it into a file you can read ... (by jonnin)
deleting a dynamically located array cause crashes
 
this is the code that i wrote, am suppose to delete the arrays at the end to free the allocated memory by using a distructor, but when i do so the whole progra...
[4 replies] Last: OK. I only used the stl functions in 3 places - which are easily remov... (by seeplus)
Quastion for beginners
 
Hallo i am a beginner in c++ and my prof asked us a quastion . so why the result below is (inf). so why it is (inf) and what does inf mean in c++ thx ...
[1 reply] : The question is about floating point arithmetic . To put shortly, it ... (by keskiverto)
by jb4x
Template specialization VS CRTP VS Pure virtual functions
 
Hello everyone, I am currently working on a resource manager class to handle different kinds of assets: textures, font, sounds... In order to handle the diffe...
[6 replies] Last: Thank you both again for your answers. I can see how the book I'm rea... (by jb4x)
Operator Overloading with a class array
 
Hey ya'll, I'm new to operator overloading and I'm stuck on implementing my comparison function in main. I created a menu that allows the user to enter info on...
[1 reply] : L7 has no effect - so you are always returning false. Just: bool La... (by seeplus)
Help with overloading operator to do union, intersection, differences of sets
 
I'm quite new to C++, used to learn java, so I might ask something quite stupid here. I'm kind of finishing coding most of them, but there are some errors that...
[2 replies] Last: Hi welcome to the forum :+) First up please always use code tags : ww... (by TheIdeasMan)
thousand comma separator for numbers
 
How do I format a number to be displayed with commas to separate every three zeroes like this 1,000,000.00 in c++ for double and 1,000,0000 for integer? I ult...
[19 replies] Last: [quote=seeplus]Compile as C++11 The last update to VS 6 was back in 2... (by George P)
by T23
Permutations of Names
 
I'm fairly new to C++ programming and am facing quite an issue with writing a method that with create and output all permutations of a list of names that the us...
[4 replies] Last: A brute force solution with minimal effort applied, but showing that y... (by jonnin)
Sorting question
 
hi , so I have to see my the input is sorted or not. here is my code. #include <iostream> using namespace std; bool isSorted(const int list , int size); ...
[16 replies] Last: Detecting both increasing and decreasing: bool isSorted(const int li... (by dhayden)
how to find the max element of an std::vector using custom comparator
 
My problem: I have a Directed Graph which contains Edges and Vertexes. And I want to find the maximum length of the outgoing edges of a vertex. Note: assume I ...
[4 replies] Last: Ah didn't see this. Yes, I agree with TheIdeasMan. Template arguments ... (by Ganado)
Simple Animation to Race a Drunk Man from Start to Finish
 
This is an interactive console animation app, where your choice of character (any letter from a to z) will appear to move funnily from start to finish line. If ...
[1 reply] : understand what??? Use code tags when posting code! #include <iost... (by seeplus)
Numbers to Letters
 
hi , So I have to convert numbers to letter ex.. Input 1: 110 Output one hundred ten dollars This is what I have tried but don't know where to go from...
[11 replies] Last: For the full monty, perhaps: #include <iostream> #include <string> ... (by seeplus)
Array question
 
hi , I am trying some practice problems and I am stuck The output should look like this Enter the number of students Enter 4 scores : Student 0 score is 40 a...
[7 replies] Last: Student 0 score is 40 and grade is C ... Student 2 score is 40 and gr... (by lastchance)
Program already runs, but can someone explain why my program is displaying the wrong numbers from a read file.
 
Hello, below I'll attach the prompt and requirements for easier understanding. My program also runs but I can't seem to figure out how to make it count the righ...
[3 replies] Last: Also, learn how to use a debugger - it will save you hours of staring ... (by TheIdeasMan)
createstack identifier not found error c++
 
//impl.h #include <string> #include <stack> #include <iostream> using namespace std; class VideoGame { public: string title, genre, publisher; int year; ...
[6 replies] Last: @ agent max Often some of the IDE's will use a make file implicitly.... (by TheIdeasMan)
April 2021 Pages: 123456... 8
  Archived months: [mar2021] [may2021]

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