Beginners - October 2017 (Page 6)

by cash
alternative to if statement
 
My code needs help because there is no way to get to the second if statement because the first if statement needs to be one first. The program need some work to...
[2 replies] Last: thanks, I think your way works better. (by cash)
recursion reverse number order
 
Can someone help me or point me in the right direction. I need to make a function using recursion to reverse a value that has been read in from a file. so for ...
[6 replies] Last: Yes int PRINT_REVERSE(int n, int result=0) is exactly what I was ref... (by Ihatov)
by glof2
Timer problem
 
No errors at all, and it counts down only one time.(1:1:5) C++ builder 6 //--------------------------------------------------------------------------- ...
[1 reply] : Why don't you use the TTimer class ? http://www.functionx.com/bcb/con... (by Thomas1965)
Functions
 
Write a program that has a function that takes a salary as argument. If the salary is less than 20000, give a 20% raise. Return the salary. I was not given any ...
[7 replies] Last: <#include<iostream> using namespace std; int fun(sal) { if... (by alonso12)
I have homework but i miss the lesson can u help me please?
 
Depending on what is given to calculate the following function, we write the program that calculates the function value and performs the drawing using *? a...
[1 reply] : Write some code then ask again. (by Ihatov)
this pointer
 
I want the output to display the name and salary of person.I must use 'this' pointer. #include<iostream> #include<string.h> using namespace std; class salesm...
[13 replies] Last: ooooooh thanks. I didnt know the meaning of tutorial so i didnt notice... (by closed account 1vf9z8AR)
How to find product of a row of 2D/Multidimensional array?
 
How would I find the product of a row of 2D array? Example: COLS = 2; ROWS = 3; int product; ex: Array ; I want to find the product of the ROW ti...
[3 replies] Last: your terminology is confusing. What you just described is multiply ac... (by jonnin)
by SKREFI
C++ ifstream <incomplete type> | Reading only the first time in for()
 
This is the Debuger Watch: https://gyazo.com/162553614833642f37bf8737fc3d2572 This is the for loop: for(int i=1;i<=n;i++) { getline(cinF...
[1 reply] : A few comments. a) using formatted input cinF>> together with getli... (by Chervil)
Storing lists using char arrays
 
Hello, I'm trying to create a basic shopping cart application that allows the user to enter in a product and its price which is then echo'd to the user. Once t...
[3 replies] Last: there are plenty of library functions that manage character arrays, h... (by Jaybob66)
It doesnt work, always say: program.exe has stopped working
 
#include <iostream> using namespace std; #define N 1000001 int main() { long long v = {0},i; for(i=1; i<=N; i++) cout<<v <<' '; ...
[6 replies] Last: int a ; is a C style array, no management, you have to take care of ... (by Jaybob66)
Car comparison program
 
I need to make this program have a counter controlled while loop, it needs to compare a certain number of cars that the user enters and output the information s...
[2 replies] Last: Do you want the user to enter more than one car and later compare thos... (by Enoizat)
what am I doing wrong?
 
I can't for the life of me find out what is wrong with my code. I am only a few weeks into this beginners c++ course so please understand my noobiness. This is...
[2 replies] Last: Anyway, @thetrek, if you want us to check your program, I'm afraid you... (by Enoizat)
Inventory Data
 
Okay, so I am supposed to write code that allows user input for inventory data that will but stored in a text file on a disk with each items data on a single li...
[4 replies] Last: I use GNU/Linux with vim and Makefiles but I think that in Windows mos... (by Ihatov)
void and value returning function problem
 
would anyone be kind enough to help fix my code for this void function this is due very soon and ive been working hard and posted a few times on here and i sti...
[4 replies] Last: Prototype: void getGrossPay( int hours, double rate, double& pay ... (by lastchance)
c++ array storing and sorting.
 
So i am suppose to create 3 arrays. one to take the first input, the second to take the second input, and third is to store both input and sort them from least ...
[1 reply] : So, do you have any questions? Your SortedArray(...) does not sort. Y... (by coder777)
Program closes before taking input.
 
Why does my program close before taking the input for "k" and then displaying it. I am writing a code for a menu based program so I need to take input from use...
[2 replies] Last: When using scanf , always make use of it's return value - to see that ... (by TheIdeasMan)
Finding common assetes in vector lists
 
Find all the COMMON assets between two levels. The passed in asset lists may contain duplicate values, but the result must contain NO duplicates. You ca...
[2 replies] Last: #include <vector> #include <set> #include <iterator> #include <algori... (by JLBorges)
by zspar
Receive input until 2 newlines
 
Building a trie and expected to receive input in this format: 2 The man ate 5 The man SITS 1 The cat ate 777 This doesn't overlap The Should Retu...
[1 reply] : if(allwords.empty()) (by ne555)
A departing programmer left me a mess to deal with.
 
A departing programmer has written the following function that you will be expected to maintain. The function's comment and signature are correct, but the i...
[5 replies] Last: The errors I caught: 1. index in for loop needed to be unsigned Con... (by TheIdeasMan)
Question about variables in loops for an assignment
 
Hello everyone. I have an assignment where I need to get input from a store owner that owns 5 stores. The owner is meant to enter the sales for today, from ea...
[10 replies] Last: Okay, I understand more now, thank you for all of the explanations! I... (by User55009)
October 2017 Pages: 1... 45678... 33
  Archived months: [sep2017] [nov2017]

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