70 Discussion / Question Topics

Remove Filter
Member Avatar for JoBe

Hello ladies and gents, Ive got this example of a program that I tried out wich shows some special possibilities to use new. [code] #include <iostream> using namespace std; int main() { int a[100]= {0}; for (int i = 0; i < 100; ++i) a[i] = 100 * i; int …

Member Avatar for Fasola
0
276
Member Avatar for JoBe

Hello ladies and gents, Ive been reading about pointers abit and at there are two pieces of text in the book about pointers wich aren't clear to me, was wondering if any of you could enlighten me abit about them! :D [quote]Sometimes it's desired to clearly point out that a …

Member Avatar for JoBe
0
163
Member Avatar for JoBe

;) Hello ladies and gents, Ive written this class time in wich I have to use operator+ to increase the hour with a certain amount of minutes like this: time t0 (23, 59), t1; // t0 = 23.59 t1 = t1 + 120; // t1 = 1.59 Problem is, I …

Member Avatar for Narue
0
646
Member Avatar for JoBe

Hi ladies and gents, Next exercise is the following: Write the function which we can declare as follows: unsigned char bcd (int n); The idea of this function is to store the last two decimal numbers of n into a 'binary coded decimal' byte and to return this value. So, …

Member Avatar for Narue
0
604
Member Avatar for JoBe

Hi ladies and gents, I wanted to start a new exercise, but after reading it several times, I actually don't know what the exercise is all about :!: The translation into English is this: [quote]Write a function wich can be declarered as the following: unsigned int datecode(int year, int month, …

Member Avatar for Narue
0
402
Member Avatar for JoBe

Hi ladies and gents, I made this exercise in wich recursion has to be used and it worked as it should: [CODE] void ggd(short x, short y) { short a = 0; if (y == 0) { cout<<"The largest common divider is: "<< x <<endl; } else { a = …

Member Avatar for JoBe
0
185
Member Avatar for JoBe

Hi ladies and gents, I'm trying the next exercise: Write a function value, wich adds the decimal numbers of 'n' together and return the result of this into main? For example: 0.1234 = 10 0.01234 = 10 0.3286 = 19 What Ive got so far is this: [CODE] short amount …

Member Avatar for JoBe
0
299
Member Avatar for JoBe

Hello ladies and gents, I'm starting on the next exercise, but I'm puzzled a bit and was wondering if any of you might help me with this. I have to enter four integer numbers, non negative and smaller then 16 into ONE variable int x, now, the thing I was …

Member Avatar for Fasola
0
443
Member Avatar for JoBe

Hello ladies and gents, I'm trying to write this little program in wich I have to enter by keyboard a certain amount of numbers (int) not floating points, and the program must count how many [U]different [/U] numbers I have entered, when the amount is equal to ten, it must …

Member Avatar for JoBe
0
855
Member Avatar for JoBe

Hello ladies and gents, I was making this small exercise in wich I have to enter a certain date meaning, day, month and year. If entered it should count the amount of days from the beginning of that year and print it. I found a solution for this, but was …

Member Avatar for Narue
0
306
Member Avatar for JoBe

Hello ladies and gents, I'm trying to reverse a string when one is entered with cin.getline, so when typing for example: testing My output should become: gnitset Ive written this piece of code and it works but, because the string has a certain length and not the whole length of …

Member Avatar for JoBe
0
171
Member Avatar for JoBe

Hello ladies and gents, Ive written a program wich I'm almost certain it'll work, Ive only got one problem, I need to write an if like this: int a = 0; if ( u!=x) a++; Now, u is a floating variable wich is divided before this selection by 2, 3, …

Member Avatar for 1o0oBhP
0
132
Member Avatar for JoBe

Hello ladies and gents, I have tried to write my sorting function but keep on getting error messages. Ive been reading the tutorials on this forum wich explaines alot but I'm still having lots of trouble in comprehending how pointers work and more important, how that I can correctly write …

Member Avatar for Dave Sinkula
0
430
Member Avatar for JoBe

Hello ladies and gents, could someone explain what I'm doing wrong here, the ideas of this excercise is: - Declare an array with 10 firstnames using pointers! - Show the array on screen using a function! - Sort out the names alphabetically and show the array again sorted! I want …

Member Avatar for JoBe
0
193
Member Avatar for JoBe

Hi guys, Just wanted to ask you're opinions about this program I had to write for evening school, the idea is when you enter a phrase wich isn't longer then 80 letters, the programm will count the amount of each letter wich is written :!: It doesn't have to keep …

Member Avatar for JoBe
-2
383
Member Avatar for JoBe

Hi, I just wanted to ask if someone could give me a name of a good book in wich the mathematical formulas are written down with some explanation about them :?: Reason I ask is, I'm going to evening school to learn C++ but in using C++ I encounter very …

Member Avatar for JoBe
0
399
Member Avatar for JoBe

Hi guys, Quick question, I was trying out to determine the second smallest number of 10 random entered numbers, this is what I got: [code] #include <stdafx.h> #include <iostream> #include <iomanip> using namespace std; int main(void) { int s=0,x=0,y=0; cout<< "Input ten random numbers with cin and determine the second …

Member Avatar for JoBe
0
130
Member Avatar for JoBe

Hi ladies and gentlemen, Gotta question, I have a program in wich I make a small array of 100 random numbers wich are smaller then 1000! Like this: # define MAX 100 void srand(int tabel[MAX]); void srand(int tabel[MAX]) { for (int i=0;i<MAX;i++) do tabel[i]=rand(); while (tabel[i]>1000); } This of course …

Member Avatar for JoBe
0
185
Member Avatar for JoBe

Hi everyone, Ive got a question concerning an excersise I have to make in wich I use an array in a function: I have to manually fill an array with twenty numbers randomly and the array has to be used by a function, now, I know how to do this …

Member Avatar for Narue
0
133
Member Avatar for JoBe

Hello ladies and gentlemen, This is the program: /* berekening_kapitaal.cpp : Defines the entry point for the console application.*/ #include <iostream.h> void main(void) { short int per = 0, tijd = 0; float begink = 0, interest = 0, perc = 0, tot_int = 0, eindk = 0, kapitaal = …

Member Avatar for JoBe
0
199

The End.