Beginners - January 2015 (Page 12)

Switch
 
Question: The program is about to compare any two numbers. Then, it will display whether the number is minimum or maximum. Please use switch statement. Here'...
[7 replies] Last: rofl. small fonts for the win. I didn't actually notice it first time ... (by mutexe)
by Sym8
tax rate and large value question
 
so my program asks the user for the price of an item, the number of items bought, and the tax rate. i was wondering if the formula is ((price of item*number o...
[2 replies] Last: ((price of item*number of items) + (((price of item*number of items)*... (by mutexe)
Questions on Classes
 
Im studying classes and have questions regarding this sample code that was given in the tutorial section. 1)What is this line of code? int area() {return wi...
[5 replies] Last: Can you not simply call the class like you would a function? OP: h... (by mutexe)
by GOPI56
My program is not working as it should.Help me.
 
I am trying to create a electric bill calculating program which calculates based from the rate given below The rate: First 20 kWh = 25 cent / kWh o Next ...
[2 replies] Last: Line 14: You're using the assignment operator, not a comparison opera... (by AbstractionAnon)
Do-While Loop. Help!
 
I have this assignment where I have to simulate a soda pop machine. I have to have the program loop through until one of the soda pops is out of stock. The thin...
[2 replies] Last: output for above code (changing each original drink total to 2): ==... (by jmadsen)
Picking C++ Books
 
Background: Hello! My name is Levi and I'm 13 years old. I've been interested in computers in general since I was about 7. This was the time when I was allowed...
[1 reply] : > I don't need books that teaches programming from scratch Start with... (by JLBorges)
Making Decimal Places Appear
 
Hey, Guys! Well, I'm 38 years old and really wanted to pick up programming as just a hobby. I seem to be stuck on a little bit of a problem with making decimal ...
[7 replies] Last: notice that, setprecision() and precision() are different. there ... (by anup30)
How to layout codes in namespace and library?
 
I have a question about how I should layout the codes for namespace. Assume in my code I have three class a, b, c and I want to put them in namespace own Then...
[7 replies] Last: Thanks very much. (by buddha87)
Print Array in reverse order
 
This is for a school homework assignment on Fibonacci numbers. Anyways we have to store the numbers that the user asked for in an array and then display those n...
[1 reply] : The problem is that you're starting at the end by doing j = n-1. So, j... (by BasV)
Where can I insert this break function?
 
Where can insert the following break function into this body of code? char thing; cin >> thing; if (thing == 'a') { break; } do { print...
[6 replies] Last: @Ganado, you're right! I haven't used scanf() in 25 years. I forgot ... (by koothkeeper)
Cant display lines!!!
 
Hi! I'm trying to write a code that displays lines between user designated points with circles at each point, but I can't get the lines to display! I'm at a los...
[5 replies] Last: Ok, so what does you code look like now? Do you understand how I mea... (by TheIdeasMan)
by Jweim
Trouble spotting an infinite loop
 
I cannot seem to find what is causing my program to fall into an infinite loop. When the user enters "2" and goes into the lookupTaxes function, they then pick ...
[3 replies] Last: Hi, You have declared selection as an int , but in the cases they... (by TheIdeasMan)
Reading From File - Size of Magic Square
 
Hello. I have written a program to read a 5*5 magic square and test whether or not it is one. I now need to covert my code to make it so it reads from a text fi...
[8 replies] Last: Here is a version that will work for any sized squares. #include <io... (by dhayden)
Can a pointer able to store more than one variable?
 
I'm a beginner of C++ programming. I'm now studying the topic about pointers. I am a bit confused about the usage of pointers and I wondered if pointers can sto...
[2 replies] Last: pointer itself doesn't contain variable values. it just points to addr... (by anup30)
Qt
 
Hello, I wanna ask you.. Does anybody worked with this programme --> „QT Gui Application“
[2 replies] Last: do you have skype ?? (by Wantautas)
by ViiTeX
How to know how many times double a is 2 times double b?
 
How to know how many times double a is equal to 2 times double b So i want to calculate the amount of times the rainfall of a particular month is more than...
[5 replies] Last: This statement wetMonths + 1; does not increment wetMonths. It makes... (by booradley60)
by nomnum
How to implement a multi-file class.
 
Hey guys! So I am trying to set up a very simple program that uses a class in a separate file. Currently, I have a main.cpp, a class.cpp, and a class.h ...
[7 replies] Last: void foo(){} void foo(){} //error: redefinition of `void foo()' To #... (by ne555)
by Kanj
How to safely allocate memory at a pointer using a function & then use it in main
 
I have a piece of code like this. # include <iostream> using namespace std; int make_array_at_p (int **p) { cout<<"-----------------\n"; *p = ne...
[4 replies] Last: Alright. I've got it now. Thanks a lot. (by Kanj)
How to sort the numbers in a random number generator
 
I am needing help sorting the numbers that the random number generator puts out. I have to create a vector, size 20. Display that vector. Sorts the vector and ...
[1 reply] : http://www.cplusplus.com/reference/algorithm/sort/ PLEASE USE CODE ... (by AbstractionAnon)
by h4ever
errors in project using SDL (Lode's Computer Graphics Tutorial)
 
I successfully installed SDL in Codeblocks (discussed here http://www.cplusplus.com/forum/beginner/154178/ ) but I have problem to make the project working beca...
[no replies]
January 2015 Pages: 1... 1011121314... 39
  Archived months: [dec2014] [feb2015]

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