Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
73% Quality Score
Upvotes Received
2
Posts with Upvotes
2
Upvoting Members
2
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
0 Endorsements
Ranked #2K
~18.6K People Reached
Favorite Forums
Favorite Tags

25 Posted Topics

Member Avatar for Crutoy

Hello , i'm trying to solve a problem Tower of Hanoi recursively. I'm having problems with coming up with logic how to treat disks in terms of value. Lets say i have 3 disks how should i assign values to them ? My function is supposed to be defined such …

Member Avatar for Crutoy
0
210
Member Avatar for DaniwebOS

youre problem is [CODE]# string Name; studentName(Name); [/CODE] you attempting to use Name variable without initializing it when you passing it to function. Also you should change void main to int main

Member Avatar for jonsca
0
126
Member Avatar for yozzie

Hi, how can this condition to be ever true ? [CODE] cin << a; while(a < 0) [/CODE]

Member Avatar for yozzie
0
173
Member Avatar for beejay321

Here's whats happening, you trying to store integer values in the variable choice everything is fine until the user enters a letter cin object goes into an error state and nothing gets stored in the variable choice.

Member Avatar for Crutoy
0
248
Member Avatar for plang007

Do you get any run time errors ? I didn't go all over youre code but it seems that variable low hasn't been initialized.

Member Avatar for plang007
0
631
Member Avatar for MaDo4

if you incluse <cctype> library you can use its functions like isupper() and islower()

Member Avatar for MaDo4
0
120
Member Avatar for coolbeanbob

I haven't dealt with classes yet, but i would assume you'd have to place it inside the function. Have you tried ?

Member Avatar for sfuo
0
4K
Member Avatar for schrope

Its just a matter of how you put them together, since they are separate variables you can just use third variable in the first of one and first in the place of third and same for the other two.

Member Avatar for Crutoy
0
183
Member Avatar for zacblazic
Member Avatar for schrope
Member Avatar for biogig

[CODE]for(i>0;i<size;i++)[/CODE] i > 0 , first condition is initialization, since you do comparison it evaluates condition to false and sets i = 0; since 0 is not greater then 0. I assume you meant to do i = 0;

Member Avatar for biogig
0
886
Member Avatar for whit0851

This is something i came up with where it guesses in ten or less trys. [CODE] #include "stdafx.h" #include <iostream> #include <ctime> using std::cout; using std::endl; using std::cin; int high_low(int,int,int); int main() { srand(int(time(NULL))); int random = 1 + rand() % 1000; int guess = 1000, counter = 0; int …

Member Avatar for Crutoy
0
773
Member Avatar for Crutoy

Hi , i'm trying to do an exercise where the computer has to guess the random number from the range of 1-1000. Currently this is the way i have it set up as. I divide that range in half and store it in guess and then check it against the …

Member Avatar for Crutoy
0
801
Member Avatar for reemhatim

look here temp= Index+1; shouldnt you be assigning a value from the array and not just a counter

Member Avatar for reemhatim
0
145
Member Avatar for InfestedLawyer

Hi, im new myself to the language, and haven't covered classes yet but by looking at the function PrintBoard shouldn't you want to pass it MyBoard array ? I would assume once function SizeBoard finishes execution MyBoard array gets destroyed and when you call PrintBoard it doesnt have anything.

Member Avatar for InfestedLawyer
0
162
Member Avatar for MaDo4
Member Avatar for MaDo4
0
143
Member Avatar for joeyn
Member Avatar for chamnab

why not use cin object as a test condition? That way it can get type mismatch and it won't write data to that type and we can easily get rid of bad input and ask user to reenter with proper data. Would this be a bad approach?

Member Avatar for jonsca
0
145
Member Avatar for jnick12

line 84 you declared it but its not initialized to anything so when you get to line 87 it throws the error. you should replace grade with numAvg in switch

Member Avatar for alaa sam
0
5K
Member Avatar for cantalope
Member Avatar for cantalope
0
4K
Member Avatar for diffuse

I think the problem might be on line 26 , array out of bounds ? Shouldn't it be < then

Member Avatar for WaltP
0
267
Member Avatar for Crutoy

Hello, i'm reviewing the exercise from the book and trying to understand the point. Basically it creates a static array and declares uninitialized char pointer. Then it allocated memory dynamically to the same char pointer. What i don't understand why is the program using strcpy() to copy string into newly …

Member Avatar for lisaroy1
0
304
Member Avatar for Crutoy

Hello , i was doing an exercise in book which asked to draw a diamond shape by displaying '*' using nested for loops. It took me quite a while to come up with a way to reverse the pyramid , and complete this exercise. So i was hoping some one …

Member Avatar for Crutoy
0
105
Member Avatar for Crutoy

Hi another exercise which im having problems with. In this challenge im given a four digit integer and encrypt each digit as follows. Replace each digit by the sum of that digit plus seven mod 10. Then swap 1st and 3rd digit places and 2nd with 4th. Heres what i …

Member Avatar for Crutoy
0
88
Member Avatar for Crutoy

Hello, Another exercise. In this particular problem we are given a five digit integer and program have to determine if its a Palindrome. Author states that we have to separate each digit into its own variables using % and /. I came up with solution but i don't know if …

Member Avatar for frogboy77
0
117

The End.