Beginners - October 2017 (Page 29)

Rounding offto 2 decimal points
 
Hi, may I know how to round off a number to only 2 decimal points? For example, 2.789 becomes 2.79 2.43 become 2.4 Thanks in advance!
[3 replies] Last: Wow, thank you very much!!! (by hooi1997)
by skinex
Parsing xml file
 
there is such xml a file <order> <object> <name >John Doe</name> <cost>5000</cost> </object> <object> <name>Tom Hall</name> <cost>5000<...
[7 replies] Last: Json is much cleaner and easier to read than xml, IMO. Also I feel lik... (by Golden Lizard)
Any other ways to write a dynamic array?
 
I have an assignment for a class where I need to read in values from a text file. They are just simple integers each per line. The instructions state that I ca...
[5 replies] Last: Thank you Kemort and jonnin I really appreciate the help. This helped ... (by closed account NCRLwA7f)
Just need a sanity check re: headers and undeclared identifier error
 
I'm writing a program that uses several algorithms to do some basic searching and sorting. I wrote them all in the same .cpp file originally--but I want to do ...
[5 replies] Last: -is there any reason why I shouldn't use <vector> instead of a array?... (by AbstractionAnon)
Computing Time delay
 
A user wishes to enter a starting time AM/PM format, and delay time in hours and minutes, and have the computer compute and display the time (in AM/PM format) a...
[6 replies] Last: My proffesor doesnt want use to be using anything but the #include<ios... (by MrMongoose)
Help please. New to nested loop
 
When i run the project, it wont cout the 2nd loop. Thanks in advance #include <iostream> using namespace std; int main() { char choice,choicee; ...
[6 replies] Last: kemort's version classifies "I don't have any fever." as "NORMAL Feve... (by closed account 48T7M4Gy)
by Demii
Help with a few lines of code
 
Hi, i'm just trying to finish up this code and need some help with the parts commented out that say fill in. Thanks int main() { float *monthSales; // a p...
[7 replies] Last: @kemort, Thank you. Nice to be appreciated. Andy (by Handy Andy)
Algorithms swapsort
 
Hello I have a homework question in which I have to determine what values(counter and sortval) are saved at line 14 and 19. at the start sortval =0. from line 7...
[4 replies] Last: it isn't one after 1 iteration of the loop. it is one on line 14 whic... (by jonnin)
I'm stuck
 
Hi I'm just trying to understand some lines of code in my c++ book from Sam's 24 hour. It has to do with classes and objects. I don't understand what these li...
[9 replies] Last: I think I'm just getting bogged down with details here I don't thi... (by closed account 48T7M4Gy)
by Bopaki
This line is giving me an error: cout<<"List: "<<list<<endl;
 
I really do not understand why I am getting an error here on this line. Because on the other lines before it I do not get an error. Here is the error: 114 ...
[6 replies] Last: Thank you all. I eventually managed to overload the operator<< properl... (by Bopaki)
by jmpc92
Getting filename from command line argument?
 
Hello, I have written this code (apologies if it's a little hard to understand) and it works just fine, however I'm having trouble with a couple of things. Firs...
[5 replies] Last: @kermot @JLBorges Thank you so much for your incredible help! After st... (by jmpc92)
There seems to be a logic error in my code (mayby)
 
Hello and best wishes to all. I'm trying to self-study C++ (yes, I'm an psycho, I know it :) ) and now I'm at the very beginning of the endless programming road...
[3 replies] Last: The warmest thanks to all! (by Komarovus)
Return pointer value errors
 
the value of x and y in the returning pointers is not as expected. X value is right but y value is wrong. #include <iostream> using namespace std; struct ...
[2 replies] Last: thanks (by Ahmed Abdellatif)
Second maximum value in while loop
 
So the question is to input prices of books using while loop and find out the maximum price,second maximum price,minimum price and total number of books with ma...
[2 replies] Last: Yes -1 is like compulsory to end the loop but afterwards the output is... (by arsalazhar336)
coordinates for lowest randomly generated route
 
My code compiles and runs fine. The problem is that I am not sure if it is outputting the correct thing. It should continue to test routes and save the shorte...
[2 replies] Last: Why not use a dataset you know the answer to that you can compare with... (by closed account 48T7M4Gy)
simple Friends program
 
Why am I not getting any output for Customer Number, City, State, and Zip code? #include<iostream> #include <string> using namespace std; class Cit...
[1 reply] : your program produces this output Customer Number: City: State: Zip... (by ne555)
help with function that calculates area of a circle
 
Hello everyone, so for this program i have to read names and numbers from the file, from there I have to use the numbers to calculate the area of the circle, bu...
[5 replies] Last: Ahh I see, thank you for the help guys ! (by closed account EAk1vCM9)
Strings
 
Can anyone tell me what I am doing wrong here? I can find the first 'a' but I cannot seem to find the second 'a'. I know the code is very bad. How would I find ...
[1 reply] : Lifetime and masking. You have int n on line 2. On global scope. Ac... (by keskiverto)
Creating Program to find fewest coins possible from Cent Input
 
Hello, fairly fresh coder that is learning to create a program that will output the fewest coins possible from any given cent input between 0 and 99. I don't ne...
[1 reply] : Line 17: You calculate the number of quarters correctly, but your oth... (by AbstractionAnon)
rsa repeated key generation
 
Hi, i try to génératre 10 rsa public and privat keys, i get only a repetition of keys, it génerate the same keys, please would any one help me. ...
[2 replies] Last: Hi, not yet (by jeanpaulw)
October 2017 Pages: 1... 2728293031... 33
  Archived months: [sep2017] [nov2017]

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