Beginners - September 2016 (Page 19)

dynamic pointer array
 
I am working on a project for class that I am having trouble with. The program creates a class object and sets the class size to 10. However, 13 students are ad...
[3 replies] Last: It will make it work, but the idea of the exercise was to make the arr... (by hornet7288)
by SaRiaX
Palindrome task
 
So I have a task to find 75 palindromes which squares are also palindromes. I have only the part where it finds palindromes and I need some help/explanation on ...
[6 replies] Last: All int (s) should be replaced with int64_t (s). It is just my idea.... (by Krulcifer Einfolk)
Input validation and sanity checking.
 
Is there a better way to do input type validation / sanity checking? Here is what I have so far: double cost = NULL; string buffer = ""; regex ch...
[1 reply] : just try to read and fail. you may use an auxiliar stringstream and ch... (by ne555)
Why won't my code cout "fail"?
 
Why won't my code cout "fail"? #include <iostream> #include <iomanip> using namespace std; int main() { int score1, score2, score3, score4, score5, p...
[3 replies] Last: but even after fixing that, numberOfFailedTests would be at most 1 (by ne555)
help with assignment
 
using the find, length, substr, and ignore functions, I need to read in a string from a file that has a unique character within the sentence. Using the manipula...
[1 reply] : I would start by writing an algorithm in plain english. How do suppos... (by Bdanielz)
Includes
 
Just a simple, general question. If I'm include libraries in a header file, should I include those libraries in my cpp as well? Not sure if I got the terminolog...
[1 reply] : No they only need to be in one place and that is in the file where the... (by closed account 48T7M4Gy)
Pointer & Loop trouble for final assignment
 
I am having trouble using pointers for the "Name" and "Address" portion of this code. As well as getting an end for the program at "Are you finished shopping Y/...
[2 replies] Last: First off 22-28, creating the pointers and using them with the "Custom... (by Chris2424)
by kevcpp
Having trouble with my first C++ problem
 
Hello for my homework assignment I am required to do the following: Ask the user to enter a number between 20 and 100. Continue asking until it is valid. Use...
[5 replies] Last: and please, no capitals in ANY c++ codes or it will not work. example... (by closed account oNA4216C)
Converting radians into degrees
 
How do I convert radians into degrees?
[3 replies] Last: degrees=radians X 180 / pi radians=degrees X pi / 180 yeah im smart!... (by closed account oNA4216C)
Code will not run
 
Why won't my code run? #include <iostream> #include <iomanip> using namespace std; int main() { int score1, score2, score3, score4, score5, pass, fail; cin ...
[2 replies] Last: Here is a fix to it. Check comments for changes. #include <iostream... (by joe864864)
Cin.get() HELP
 
I am a little confused on how cin.get() works. if i were to enter a number like '345454', shouldnt it only print out the first three numbers. instead, i am gett...
[1 reply] : if i were to enter a number like '345454', shouldnt it only print out... (by jlb)
Need help comparing char in while statment
 
Hello, I am having trouble with the begging of my code it was working previously but will no longer and I have not been able to backtrack and find the problem. ...
[3 replies] Last: Your welcome Joe. I don't know a good way to describe it but when you ... (by SamuelAdams)
by kevcpp
Putting random numbers into an array
 
I am having some trouble putting random numbers into an array. Any tips on how I can do this? My code is shown below: #include <iostream> #include <cstd...
[6 replies] Last: You never update the loop counter (i) on line 30. Try this: #include... (by edge6768)
My code does not read the .txt file.
 
My teacher gave me the following instructions: A. Open a text file and type at least ten records (each full record of an account should be on a separate line...
[4 replies] Last: Thank you all! (by danicm9)
Ifstream reads "" after first record
 
I have been assigned to create a program that is supposed to extract all the data from each row of a file into a struct. Each row in the file contains: 1) A bab...
[4 replies] Last: If you try getline() you're probably going to need to insure you skip ... (by jlb)
Help with error and finishing assigment
 
This is my assignment, the goal is to look like this but with 30 days: Starting salary: 0.05 Number of days to work: 5 Day 1: 0.05 Day 2: 0.10 Day 3: ...
[6 replies] Last: Also having some slight formatting issues (by jeffgem10)
Get average from input in a for-loop
 
I'm making a program that is supposed to find the average max. and min. temperature, and average rainfall within a month, but also the total rainfall. I've made...
[1 reply] : You could create three new variables to keep running totals for the in... (by closed account iw7Gy60M)
by ut33zy
Reading multiple choice questions from a text file
 
Hello, I am trying to write a program that will read multiple choice questions from a text file that contains a bank of 5 questions. Every time the user opens...
[4 replies] Last: We have not learned struct or vectors in our class. So far we are at ... (by ut33zy)
Having an issue figuring out my problem
 
So basically my code should output "1" becasue there is only one cs400. I can only get my code to output 1 if I put cs400 first where math195 currently is. When...
[2 replies] Last: The problem is that you're "slicing" your objects when you copy them i... (by MikeyBoy)
Trouble with double
 
Hi again guys. I just posted a few days ago since I am a noob and needed help with an array. Well now I got the array working correctly except for one thing, It...
[4 replies] Last: Its alright, no worries we all make mistakes. . . that why I am on thi... (by Winslowz11d7d)
September 2016 Pages: 1... 1718192021... 34
  Archived months: [aug2016] [oct2016]

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