Beginners - February 2016 (Page 22)

by Lospwr
What did i do wrong here in this code?
 
Hey guys, i am having trouble understanding the for concept. This is the algorithm the teacher posted and this is the code I try to implement although i am sur...
[3 replies] Last: cin >> account number; This is illegal. It looks like you're tryin... (by MikeyBoy)
Writing a while-loop?
 
I was given this assignment: Write a C++ code segment using the while loop to find the sum of the even integers 2,4,6,8,...,500. Display the resulting sum...
[5 replies] Last: Thank you very much! (by GetMeOuttaHere)
Programming and principles ch 7 exercise doubt
 
Question (Calculator program): Modify Token_stream::get() to return Token(print) when it sees a newline. This implies looking for whitespace characters and trea...
[2 replies] Last: Well it was rather easy, i feel silly now char ch; cin.get(ch); ... (by ephraimr)
Sqrt and modulus
 
So I am having a problem. I'm doing an assignment for class, and I'm learning how to try, throw, and catch. In the function named squareRoot, I'm trying to get ...
[5 replies] Last: I would expect the function to look more like the following: int squ... (by cire)
regex_search
 
Why does inputting "integral123" result in the last character of the first group being displayed, while the second group displays the first number? regex...
[1 reply] : #include <iostream> #include <string> #include <regex> #include <ioma... (by JLBorges)
by Nyapp
I have some questions
 
I've been learning c++ for some time now using learncpp.com, but looking back i've realised that I've rushed and that I need to go over certain things. I have a...
[2 replies] Last: a) Is this relevant? It depends on the compiler how it is added to the... (by coder777)
Constructor with strings - Errors
 
Hi all, I am trying to create a tool which contains part#, Part Description, Price and Qty. From what I defined I want it to calculate the total price (price*...
[4 replies] Last: Makes sense. Should have caught onto that one. Guess I was working on ... (by titan88)
by Haziq
How to find specific value in text file
 
I noticed that if i put the date as shown below, it return a correct line. But what if i asked the user to input certain value for year, month and date and retu...
[4 replies] Last: Found a new solution.. i declare date as string instead of declare one... (by Haziq)
NEED HELP WRITING PAYROLL ALGORITHM!
 
i am new to programming and writing algorithms I'D APPRECIATE YOUR HELP WRITING AN ALGORITHM FOR THE FOLLOWING PAYROLL PROGRAM Assignment Plan and code a ...
[1 reply] : I think you should read this first. http://www.cplusplus.com/forum/beg... (by Thomas1965)
c++ noob need help
 
i am a beginner in c++ and i have an assignment. i need to make C++ program that will accept N numbers, and display its sum, the smallest value and largest valu...
[1 reply] : Hey. Please don't spam the forum with identical posts - http://www.cpl... (by TarikNeaj)
HELP! Using Pointers to Determine Odd Numbers in Array
 
Hey guys, I'm new to this, and am having a lot of trouble figuring out how to correctly use pointers. My question is how to implement them in my code below. I a...
[7 replies] Last: the amount of odd numbers Not sure whether you've finished this yet.... (by Chervil)
by oje
Converting std::string to integer (or not)
 
Hello, coming from Java, I tried to use string concatenation on a string and an int using "x" + i. I quickly found out that in C++ one needs proper conversio...
[9 replies] Last: Thanks a lot, now I got it! (by oje)
by m0bb1n
Segmentation error in Battleship game
 
I am getting segmentation error but I don't know whats happening. I isolated it to this part. I want to mark the grid with the first letter of whatever the sh...
[3 replies] Last: > FULL PROGRAM HERE if needed: you should always provide enough code t... (by ne555)
Endless Loop need help
 
Hi all, I am learning C++ programming. The following works so far, but if a non int is entered the code loops continuously with Input Error, Try Again.... Wh...
[4 replies] Last: TheIdeasMan, Thanks for the tips, I'll definitely look at implementin... (by pkdevine)
THIS DUDE REALLY NEEDS HELP
 
i am a noob in c++ and i need help in this problem. I have to Create a c++ program that will accept the N numbers, and display its SUM, the smallest value and l...
[1 reply] : #include <iostream> using namespace std; int main() { //Create a v... (by WakeofMisery)
Scope for Public and Private
 
There is a piece of code: class BirdCarreau: public viscosityModel // Private data { dictionary BirdCarreauCoeff...
[1 reply] : Hi, The public refers to public inheritance of a base class. The Bi... (by TheIdeasMan)
Magic Number
 
So something isn't working right in this code, cout << "Enter a 3 digit number, whose first digit is greater than its last\n"; cin >> number1; cou...
[3 replies] Last: He means that by the time you reach line 13, number1 is zero. This is... (by dhayden)
by ianS
Please Help Calling Function, If then
 
Hello. This is not a homework question but was a lab that I have constructed myself. I am having a difficult time and pretty confused at this point. I had writt...
[6 replies] Last: No worries, pleased to help. Awesome that you sent thanks, often that ... (by TheIdeasMan)
Creating Bank Program with 2 Accounts
 
Hi all, I am having trouble trying to create a bank account program. I have I think all the defined headers and have the functions I need. But I am struggling w...
[9 replies] Last: Perfect thanks guys I got this working! (by titan88)
Bizarre question in CS intro class
 
Part of my intro to CS class is access to "my programming lab" which is a collection of questions relating to the text. This question is supposed be related to...
[5 replies] Last: No, I agreed that your answer was correct, because it has only two cha... (by Duthomhas)
February 2016 Pages: 1... 2021222324... 46
  Archived months: [jan2016] [mar2016]

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