Beginners - October 2017

Loop until 2^n-1
 
I was just wondering if I was to loop through 0 to 2^n -1 can I just write the code as is? like this: for(int i = 0; i < 2^n -1; i++) { //code } ...
[1 reply] : hello, you should note that ^ doesn't mean "power" in c++, you should ... (by closed account SECMoG1T)
How can I pass variable objects?
 
Basically I wrote a program that asks the user for a number of coins they have. It starts by asking how much of each coin we have. Afterwards we print to the sc...
[6 replies] Last: JLBorges’s code’s always tidy and elegant, but that English gramma... (by Enoizat)
by Ex0d
reverse order intergers
 
Hello, I'm in need of some little help. I need lines of output are in reverse order. Define and use a function that accepts a single value x and prints a line...
[10 replies] Last: Push your integers onto a stack. Then pop them back off LIFO and use @... (by lastchance)
by wnp007
Implementing cmath functions in RPN calculator
 
I am trying to implement some scientific functions into this rpn calculator(meant to be a hp-35 sim) but i'm having trouble being able to use pi in calculations...
[13 replies] Last: It's a long time since I did any serious stuff with RPN, but I was jus... (by Chervil)
Write a function which allows the user to enter inventory data for items in a store.
 
Here is the instructions for this project https://imgur.com/a/4kfry . I am extremely confused on were to even start any help would be appreciated.
[9 replies] Last: Ewe, gross. Paperwork programming? :p (by bradltr95)
Help with an issue in lottery program
 
dffdhs
[1 reply] : Hello droodic, In your first bit of code the problem is with line 14.... (by Handy Andy)
Endless loop?
 
Why if i input a negative number, it all goes fine, but if i input a letter or an invalid input (ex .8) it goes on a endless loop? Help me out please. ...
[12 replies] Last: Ok i included the library "limits". Everything works fine now. Thanks ... (by BlueRyse)
by MegsD
Binary Searching of random number arrays
 
we were tasked to find a specific number in the array, doesn't matter if its linear or binary, so I tried it in binary. wow.cpp (library header (.cpp)) ...
[4 replies] Last: > Does that mean that I have to add a way to find the number within a ... (by JLBorges)
Shorter way to read/print array
 
I know there is a way to have all these if statements done in 1-3 lines, but I haven't been able to find it. void digitCount(char digitsArr , int countD...
[7 replies] Last: # include <iostream> constexpr auto SIZE = 12; constexpr auto NUM_D... (by gunnerfunner)
Help URGENT
 
Write a function called Insert that takes in four parameters: an integer array the size of the array the new value to be inserted into the array the index at wh...
[1 reply] : before starting to code, write a pseudocode or a diagram flow. the sni... (by ne555)
Attempting to pass by reference
 
Attempting to pass by reference and I'm getting these errors. main.cpp:30:29: error: declaration of 'counts' as array of references void digitCount(int &coun...
[1 reply] : Okay so It looks like I am trying to reference a reference, but I'm no... (by Garribean)
by Pecky
I could not attend class and i'm lost
 
This is translated from Icelandic but I hope y'all understand it. Make a dimensional array with 9 seats (3*3) and use a loop to put in the letters X and O so...
[4 replies] Last: Compiles fine for my compiler GNU GCC, Im gonna assume you didn't ... (by bradltr95)
Issue With Vectors
 
I'm writing a program that needs to have three vectors filled in with information, but I keep getting error code C2664 in Visual Studio 2015. The error message...
[3 replies] Last: Always look for type safety first :)! Probably 80% of errors in beginn... (by bradltr95)
by imren
helping please!
 
could someone solve this question? it is my homework.I am not good at c++ functions.Please help me. The function s(n) returns the sum of the first ...
[3 replies] Last: Heres some sample code to help you along the way: #include "std_l... (by bradltr95)
Factorial Recursion
 
I am doing an assignment displaying a table of factorials from 0 to 20 using recursion. Everything works fine, but I can not figure out how to display the corr...
[3 replies] Last: Ok. Can you trace what I do here? #include <iostream> #include <ioman... (by keskiverto)
Input /n
 
Hello, I am writing a code which will be binary decimal converter. I know how to write rest of code to be functional. I have problem with only one thing. ...
[5 replies] Last: Thank you all for your help. Especially I have to thank Andy. It took... (by Alastor)
Starting in the middle of a grid and tracking random movement
 
I am currently writing a program that will start in the middle of a grid that you determine the size of. I need to track the movement that will be at random. I ...
[4 replies] Last: Thank yall for the assistance, I have got the code to work and I will ... (by atvman36)
by stb453
fstream file reading trouble
 
Running the program below will yelid an error saying the program file does not exist and in the line TestFile.open(name); it says that there is no matching f...
[1 reply] : It sounds like you are using an old compiler, or a recent one configur... (by Chervil)
Need help fixing the error thank you
 
// Lab 3 percentage.cpp // This program will determine the percentage // of answers a student got correct on a test. // PUT YOUR NAME HERE. #include <ios...
[3 replies] Last: Taking care of those kind of errors is really important and it can ste... (by benhart)
Programming Assignment
 
I need help finishing a program. #include <iostream> #include <string> using namespace std; int main() { int unsorted ; for (int i = 0;...
[3 replies] Last: You'll need to know how to create loops and use rand() to generate ra... (by MarbleHornets)
October 2017 Pages: 123... 33
  Archived months: [sep2017] [nov2017]

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