Beginners - December 2019 (Page 8)

by SuddeN
Binary to decimal conversion not working
 
Im having trouble getting this function to work. I need to take an 8-bit binary number in as a string and convert it to decimal. I already have a function to va...
[6 replies] Last: #include <iostream> #include <string> using namespace std; int Conve... (by lastchance)
function pointer
 
For the bad_alloc &. what does & do? And for delet co, does it delete also the *ret in concat function? #include <iostream> #include <new> // bad_alloc #...
[1 reply] : catch (const bad_alloc &) { die("allocation failure"); } The throw... (by keskiverto)
Templates
 
If possible how do you make templates carry over to other functions rather than rewriting it as such? #include <iostream> #include <string> using namespace...
[2 replies] Last: Now, looking at your code: what do you mean? Is it like this? templ... (by highwayman)
Using namespace
 
Is the use of using namespace std fine in these situations? #include<iostream> #include<string> #include<cmath> using namespace std; class Point; ...
[2 replies] Last: Not using using namespace std; is not a status symbol. If only it wa... (by againtry)
String concatenation in C++
 
Hello, I have two problems in the below code. (line 20 and line 30) 1. I want to save the name as P0, P1, and P2. but the below code doesn't work. P .Name =...
[1 reply] : Convert the integer to a string with std::to_string https://en.cppre... (by JLBorges)
Display the weekday by input month and day
 
like this Sample display12 25Wednesday
[5 replies] Last: http://www.cplusplus.com/reference/ctime/mktime/?kw=mktime (by againtry)
IS VALID FUNCTION
 
I need some help on a few things. Include a function named isValidPassword that will complete all the checks and return a Boolean value which will indica...
[6 replies] Last: #include <iostream> #include <string> #include <ctype.h> using names... (by kbw)
by noyou
Struggling to complete this program
 
I am having some trouble finishing this exercise here. I am supposed to have this program run normally, then ask for an employee ID or name, and then store the ...
[2 replies] Last: double amountAllowableMeals = 0.0; if (timeOfDeparture > 07.00) ... (by noyou)
Help please
 
Write a program that reads students’ names followed by their test scores. The program should output each student’s name followed by the test scores and the ...
[1 reply] : Hello BatJuan72, I was looking over your post and wondering if you ha... (by Handy Andy)
Computer Science Final (1,2)
 
1. Given an integer ‘a’ and an integer ‘b’ write an IF statement that executes when ‘a’ is less than 5 and ‘b’ is greater than or equal to 22. ...
[28 replies] Last: #3: The condition for a while loop goes inside the parentheses: while... (by dhayden)
Blackjack
 
This program works but it only prints and asks if the player would like to play again..and nothing else? How do I correctly get the game to work? Deck d...
[4 replies] Last: When the computer wins, what score does the human have and what score ... (by Repeater)
various examples of looping programs
 
give me an example of a loop program using the for , while ,or do while functions !
[1 reply] : while ( input != correct_password) { cout << "Wrong password. Try a... (by Repeater)
Find an nth element in an integer number
 
Hello, I want to find an nth element in an integer number. (from the left) For example, the number is = 963258741 and the fourth element is 2 or the sixth elem...
[4 replies] Last: partially. Here, no loops: #include<iostream> #include<cmath> usin... (by jonnin)
Genetic Algorithm NEED HELP
 
So I've developed my code near completion. Each function operates functionally on there own. However when run I get repeated values. I believe this is due to th...
[4 replies] Last: I really am sorry for the lack of comments. In the moment I hadn't rea... (by thomash16)
Program returns 0 instead of going back to main menu
 
I've been writing a code for a uni assignment that includes a main menu (to go by each different action the user can do), and i've been having a problem with on...
[4 replies] Last: Thanks a lot man, deleted the cout cin and it worked. can't believe it... (by carmel b)
by seatea
Beginner programmer - help with authentication problem
 
Hi folks! I will be asking forhelp with an assignment and don't expect you guys to do it for me, but if you could help me get on it would be extremely helpful...
[13 replies] Last: The name of the function was chosen by our teacher, and we are not all... (by seatea)
How do I fix my loop?
 
How do I fix my code to where the student and assignment numbers aren't set as just single digits? It continues to repeat the input of the number of students an...
[4 replies] Last: My pleasure :) (by H00G0)
Euler Problem from Hackerrank, code complete but not correct
 
Hello everyone, Im in my 2nd course for programming and learning c++, for a final I was tasked with solving a euler problem from hackerrank. I have code done bu...
[13 replies] Last: I don't know, I haven't seen a link to the actual question yet. It'... (by dhayden)
by jf3238
New to c++ and need finding an error in my code
 
Hello! I have an upcoming project for one of my coding classes and I am having trouble finding where my error is in my code. The project outline is as follows...
[3 replies] Last: #include<iostream> #include <ctime> using namespace std; int AskRan... (by againtry)
by medosz
terminating loop
 
I am trying to write a simple money exchange program. The following should happen: User enters maximum five currency-exchange rate pairs. If they would like to ...
[2 replies] Last: I made some changes, but the problem is from the second loop it doesn`... (by medosz)
December 2019 Pages: 1... 678910... 13
  Archived months: [nov2019] [jan2020]

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