Beginners - October 2016 (Page 48)

How does this program work?
 
A natural number is called cool if the sum of the digits which are in odd positions (starting to count on the right) is an even number. For instance, 2 and 6790...
[5 replies] Last: Okay I understand now, thanks (by Oriol Serrabassa)
Problems with templates
 
Hello I don't understand templates. If i want to create for instance very simple function which adds two variables of generic type T together and returns the...
[5 replies] Last: Thank you! Now everything works very well. (by beginner12345)
Trying to do Simple tic tac toe game without functions
 
Is it possible to put the code below into a do while sort of loop that will stop the code if it meets the requirements of the win conditions? if (tictactoe_g...
[2 replies] Last: Thanks :) (by Jpp Mitch)
by lnp657
Help with pointers!
 
Hi, I am writing a program for my class where I pass the pointer to an array of scores for separate individuals and store the pointer in an object... I'm fai...
[2 replies] Last: I assume testScores is a local variable? In that case, yes, it's bec... (by TwilightSpectre)
How can I apply loop precondition i am a bit confused
 
I am a beginner so please bare with me.. This is my code I have to get unlimited inputs but when the difference between the two recent one's equal 15 it outputs...
[5 replies] Last: Thanks @JLBroges.. (by Abhijeet010)
Best way to make mutually recursive functions iterative?
 
What is the best approach to make a mutually recursive function iterative?
[5 replies] Last: Here is the most stupid and trivial example I can think of: bool is_... (by mbozzi)
by Hengry
Help with push_front
 
My push_front function is suppose to push data into the front of the array bool UniqueVector<T>::push_front(const T& data){ //If data is already in t...
[3 replies] Last: The only obvious thing I see wrong is lines 5-7 in your at snippet w... (by cire)
How to exit an infinite loop at your desired time
 
Good day! i am having quite a trouble for searching on how to ask this on google so here is my delema. let have a simple code here. int x=1,y=0; ...
[3 replies] Last: Wow, it's new for me knox41234 multithreading, i'll try to explore it... (by Annom)
by ncaver
Car
 
We had to implement a code that talk about your dream car. I did the code but I got errors. this is the header file class car{ public: car(); ~car();...
[1 reply] : What is the scope of the program? What do you want the program to do? ... (by closed account 49iURXSz)
How do I reverse digits of an integer?
 
Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 int reverse(int x) { int output; for(int i...
[15 replies] Last: These are the exact steps to find reverse of a number: 1: Use a loop t... (by kamal choudhary)
Error Putting String into Stream
 
For this project I need to parse a string using spaces as a delimiter. Since stringstreams do this by default I figured it was a good idea to use one. My co...
[3 replies] Last: Line 2 is not calling a constructor. It is attempting to call a functi... (by Duthomhas)
Random numbers always giving 0
 
I'm having an issue trying to generate two random numbers. I've looked up tutorials and everything seems right, but I guess I'm missing something! My values alw...
[4 replies] Last: Using srand() and rand(): http://www.cplusplus.com/faq/beginners/rando... (by Duthomhas)
Conditional, Relational, or Boolean Operators
 
Hey! I'm a beginner doing a Lab for class. I'm working with ASCII values to get certain outputs. But when I run the below code, It always ends up outputting the...
[9 replies] Last: I see what you mean. That makes sense. But what I have below works now... (by jaketheguy)
Counting number of digits in a number
 
Hi everyone. So for my c++ class I have to write a program that converts a decimal number and turns it to a ternary number in base 3. So I managed to do that. T...
[1 reply] : So for my c++ class I have to write a program that converts a decimal... (by SakurasouBusters)
Data Stored in ADT Bag
 
I have a concept question. I am attempting to store a data item in an ADT Bag. If I have the user input the data item himself (using the cin operator)into(lets ...
[3 replies] Last: I am not sure if it a compiler issue then, but when I remove line 27, ... (by neverStopLearning)
Implementing a Program Version Data Type
 
Background: I'm writing some simple programs to re-learn some skills I lost by writing a simple program that simply prints it's version and exits. I want to ...
[2 replies] Last: I'm still manually changing the version number in the source file, but... (by closed account 49iURXSz)
by HMHO
Unhelpful Professor, help me complete this code?
 
Part 1: Write a program that uses a while loop to read in test scores until the user enters a negative number. Print the average score after dropping the hi...
[2 replies] Last: Which of the requirements do you want to start on? Break them down int... (by closed account 49iURXSz)
by jeg19
Switch Statements, and do, while loops
 
I have to do this assignment: Write a menu driven program (that means Switch statements) that displays the following menu: Geometry Calculator 1. Calculate ...
[3 replies] Last: Glad it helped! (by joe864864)
by HotWax
How to output a string from an int?
 
Hello! I was finishing up an assignment for my computer science class but I've run into a small problem. Everything in my program works as it should, but when t...
[2 replies] Last: Thank you very much! (by HotWax)
Defining Variables plus decimals.
 
Hello, I need help defining variables. I can't seem to get my code to output the variables in addition to the end-result "volume". Anybody have any tips that co...
[1 reply] : ...get my code to output the variables in addition to the end-result ... (by closed account 49iURXSz)
October 2016 Pages: 1... 464748495051
  Archived months: [sep2016] [nov2016]

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