Beginners - November 2014 (Page 30)

Roman Numeral to Decimal conversion
 
I'm working on a converting Roman numbers to Decimal problem. My lackluster code will output a single roman character as decimal form, but that gets me very lit...
[2 replies] Last: you can try getting the char one by one(from the string): ////NOTE! r... (by rjvc)
worng output in float divid
 
hi all float x,y,z; cin>>x>>y; z=x*y; z=z/100; ok when i give x 5000000 ( if x is more than 4999988 out put will like this numbers 1e...
[1 reply] : Because 1000000 is equal to 1e+06; Use std::fixed to avoid scientif... (by MiiNiPaa)
Classes and pointers
 
I'm a bit confused with class instances and pointers.I'm trying to run a function from an instance of a class ,from another instance of the same class. ...
[1 reply] : So it prints "Some important info" once instead of twice? Maybe showin... (by Peter87)
booking/reservation program
 
write a booking program initially the program should display: 1.4-5(available) 2.5-6(available) then when the user keys in the slot the user is that lead back...
[1 reply] : Hi! You can try posting what you have done so far and we'll work our w... (by rjvc)
Train problem
 
Hello fellow programmers. How would you solve a problem where you have a train kompozition with wagons and cargo in them. Wagons can be two types. If type A you...
[1 reply] : bump (by theanswer)
Adding all the digits into a string.
 
I wrote a program to find the numbers into a string and calculate the sum of all the found numbers. Here is my program. #include <iostream> #include <...
[1 reply] : Because you are adding character to an in teger. characeter '1' is not... (by MiiNiPaa)
Why "itoa" function doesn't work with C++11 ISO standard?
 
Hey guys. I have this pretty simple code here: #include <iostream> #include <cstdlib> using namespace std; int int_length(int a){ //calculates the...
[2 replies] Last: Ah, I get it now. I didn't know there was such a function for strings,... (by bheadmaster)
TwoDArray/Tokenizer help
 
My project is to basically read a long string of characters and grab tokens of each word. After I do that, I put each word in an array and find the frequency. W...
[3 replies] Last: #include <iostream> #include <cstring> #include <iomanip> int main()... (by JLBorges)
I need help with a piece of code from my project, Theater Seating Program
 
In the code that I am having a problem with, I am trying to get the user to purchase tickets for seats from a theater but I need the program to check if the sea...
[1 reply] : First, rewrite arr as arr[r-1][c-1] or something like this in ... (by Konstantin2)
This cout statement is causing my program to fail!
 
Could someone explain why this single cout << endl; statement is breaking my code? I cannot for the life of me figure out what is wrong. If I rem out the cout...
[2 replies] Last: Just ran it on Xcode and can confirm it runs fine. I haven't used Net... (by Immo)
by canx
code to calculate class average
 
I'm really struggling with this problem. My instructor is asking that i get scores and calculate avergage in getScoresFindAverage instead of main, and have the ...
[2 replies] Last: Also in the same boat as LB, but I'll answer anyway. The problem here... (by Immo)
this pointer in struct's constructor
 
Hello, We read in the books that the struct in C++ is almost the same as the class except in the access specifiers where the default in class is private but th...
[2 replies] Last: You are right. Thank you !! I am not sure what was going on. (by carlossentino)
Outputting Fibonacci Sequence As An Array
 
Thank you for reading my post. I need help with my code. It keeps outputting garbage numbers. The assignment asks to ouput the fibonacci sequence up to a limit ...
[3 replies] Last: fib = 1 Fix your line 19 and you'll be closer. I also recommend get... (by Duthomhas)
Array File - Sorting/Ith Number/Max/Min
 
Can anyone tell if there is anything wrong with this code? I've been submitting this in and the submission site told me there was something wrong? This program...
[3 replies] Last: [quote=vextria]I also submitted a version with algorithm, and that gav... (by LB)
need help ASAP for filling in a code that draws a circle
 
I need to write a loop that goes from 0 to bits.length, and then inside the loop, I have to set two different colors using strokeStyle and fillStyle. Then use ...
[2 replies] Last: I'm using JavaScript in Brackets (by Katie umw)
by thor36
"errno_t was not declared in this scope" error
 
Greetings all ! I have a piece of sample code from an open library. It was supposedly written for msvs, but I am using codeblocks with mingw compiler on a wind...
[3 replies] Last: By using the typedef keyword, you make err a type instead of a var... (by LB)
by kal42
cars learning to drive stick shift
 
ok so i am trying to use a tic tac toe example to build a car program that has the useer input one for the gas and two for the brake..the gas would tell the pro...
[3 replies] Last: i just playing around trying to teach my self but i have no idea were ... (by kal42)
need to make this code less complicated
 
[1 reply] : Start by explaining what this code is trying to accomplish. (by LB)
What's the difference between passing an argument by reference and using std::ref?
 
void increment(int& i) { i++; } int main() { int i = 0; increment(std::ref(i)); std::cout << i << std::endl; increment(i); std::cout << i...
[3 replies] Last: > it's helpful when the reference is forwarded towards other functions... (by JLBorges)
Virtual classes
 
Any idea why my ptr1 doesnt work on line 41 thats were i get the error. #include <iostream> #include <string> using namespace std; class alpha{ pr...
[1 reply] : Because beta's add is not overrideing alpha's. Look at the arguments. (by Lowest0ne)
November 2014 Pages: 1... 2829303132... 65
  Archived months: [oct2014] [dec2014]

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