2,827 Posted Topics

Member Avatar for mrnutty

Your recent threads all have the same underlying problem. You need more than 64 bits of precision and you are only using a data type that can store 64 bits. You either need a data type that holds more or you need to convert the problem somehow so that you …

Member Avatar for MosaicFuneral
0
147
Member Avatar for GrimJack

We had MAME installed on our X-Box at home as well as on the computers (they played better on X-Box), and a friend built a really great MAME cabinet. The early 80's produced some great games. Friends would bring over recent X-Box games and I'd ignore them and go straight …

Member Avatar for Ezzaral
0
237
Member Avatar for acardiac

It's hard to give much of a hint since we don't know what your expertise level is. We don't know if you know how to use classes. If so, you could set up classes like [ICODE]Seat[/ICODE], [ICODE]Row[/ICODE], [ICODE]Airplane[/ICODE]. If not, the issue is moot. Regardless, split the assignment up into …

Member Avatar for acardiac
0
117
Member Avatar for Swemp

On line 58, you read in a character from the user and store it in a char variable called [ICODE]question[/ICODE]? Is that correct? I don't see you use this [ICODE]question[/ICODE] variable anywhere, so what are you supposed to do with it and what does the user enter when prompted? So …

Member Avatar for Swemp
0
1K
Member Avatar for harryoma

[code=cplusplus] int char2int(char c) { switch(c) { case '0': { return 0; } case '1': { return 1; } case '2': { return 2; } case '3': { return 3; } case '4': { return 4; } case '5': { return 5; } case '6': { return 6; } case …

Member Avatar for ddanbe
0
212
Member Avatar for berting

[QUOTE=berting;764667]i need to write a program which inputs an integer value, checks that it is possitive, and outputs its factorial,using formulas factorial(0)=1 factorial(n)=n*factorial(n-1) sample output: input possitive number: 6 factoral of 6is: 720[/QUOTE] What's the question?

Member Avatar for ajay.krish123
0
96
Member Avatar for confusedGirl

[QUOTE=confusedGirl;764006]Hi all I have a [COLOR="Red"]miniproject [/COLOR]I need to submit tomorrow ,but I didn't finish it.. Please if any member have a time to check it for me,,tell me so I can send my whole work... I really will appreciate your help Please help me ....Iam so sad its 50% …

Member Avatar for BestJewSinceJC
0
202
Member Avatar for NewtoC++

[QUOTE=NewtoC++;764192]Sorry its not solved. This still doesnt solve my problem. I think I phrased my question incorrectly. How do I give a user the ability to name the objects that I create? For example if they enter "Bob" I want to create an object with "Bob: class example{ }; example …

Member Avatar for NewtoC++
0
18K
Member Avatar for mrboolf

There is no "right" and "wrong" in these types of designs, but rather "pros" and "cons". You are trying to write some generic classes so that you don't have to rewrite everything for each different game, which is good. At some point, the games get so dissimilar that it's no …

Member Avatar for Murtan
1
527
Member Avatar for almazyoon

Type in "power series C++" into Daniweb's search box and some related threads will come up. Also, please use code tags. [noparse] [code] // paste code here [/code] [/noparse] Also, never, ever use [ICODE]void main ()[/ICODE]. [url]http://www.daniweb.com/forums/thread78955.html[/url] [url]http://www.daniweb.com/forums/post50869.html[/url] [url]http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1044841143&id=1043284376[/url] [url]http://www.gidnetwork.com/b-66.html[/url]

Member Avatar for VernonDozier
0
126
Member Avatar for VernonDozier

I have a problem that I have "solved" in that it now does what I want, but I'd like to know why it works. I have a JFrame. Within that JFrame I have three JPanels, which I'd like the user to be able to adjust. I would like to be …

Member Avatar for VernonDozier
0
152
Member Avatar for Manutebecker

enum would work or you can use the / and % operators to get the value and suit. 22 is a bad choice for 2 of clubs in my view. 2 of clubs should be 1, 14, 27, or 40 depending on whether clubs has a value of 0, 1, …

Member Avatar for ArkM
0
265
Member Avatar for babi

[QUOTE=babi;758132]I need to use an array of chars to input chars from the console but I don't know how many chars will be actually inputed. How can I have an array of chars whithout knowing its size in advance? I could put the array with a very high size but …

Member Avatar for Freaky_Chris
0
585
Member Avatar for Dannielf

[QUOTE=Dannielf;758966]I'm doing a program that shows which tickets have been sold for an auditorium. I am a beginner to c++ so I am not sure how I can do the following: a) Allocate an input with a character (e.g. when I enter 'A10' .. how do I allocate 'A' to …

Member Avatar for mrinal.s2008
0
92
Member Avatar for Salem

Here's chapter 2. [url]http://linuxlock.blogspot.com/2008/12/character-assasinations-aint-us.html[/url]

Member Avatar for VernonDozier
0
141
Member Avatar for clb8372

[QUOTE=clb8372;758924][code] I understand that my instructors feed back is straight forward, but I am new to creating pseudo codes and I am just not sure how the corrections are suppose to look, for example "Why do you have a variable named ItemName? Variable names should be descriptive of what they …

Member Avatar for VernonDozier
0
288
Member Avatar for ItecKid

I get a compile error on line 39: [code] if (list <= list[mid]) [/code] [quote] ISO C++ forbids comparison between pointer and integer [/quote]

Member Avatar for ItecKid
0
134
Member Avatar for ninja_gs

[QUOTE=ninja_gs;758717]can any one provide me a sample code for it ........????? plz[/QUOTE] Sample code for what? A sorting algorithm? Sorting characters as opposed to integers (as Mosaic mentions, characters are treated as integers, only they don't have as big of a range). Lots of sample code out there. Check the …

Member Avatar for Freaky_Chris
0
109
Member Avatar for Se7Olutionyg

[QUOTE=Se7Olutionyg;758267][CODE]#include <iostream> #include <cmath> using namespace std; float scale (float,int) ; int main() { float num1; int num2 ; cout << "Enter a real number : " ; cin >> num1; cout << " Enter an integer: " ; cin >> num2; cout << " Result of call to function …

Member Avatar for VernonDozier
0
127
Member Avatar for NinjaLink

[QUOTE=NinjaLink;757557]I just want to know what I need to change in my code to make insertBack into insertFront and deleteFront to deleteBack. Do you know what I need to change to make this happen?[/QUOTE] [QUOTE=NinjaLink;757557] For Linked Lists, I know the code for insertBack and deleteFront.... [/quote] No, you DON'T …

Member Avatar for NinjaLink
0
312
Member Avatar for jinuyasha

You should probably have your [ICODE]printTime ()[/ICODE] function call the [ICODE]toString ()[/ICODE] function. It's the same code. No sense writing it twice. Regarding going from 0 to 59 and 0 to 23 and not beyond, in your increment functions, use the / and % operators. Add the new amount to …

Member Avatar for VernonDozier
0
830
Member Avatar for gunsmith2112

[QUOTE=gunsmith2112;757116]I have changed the <time.h> to <ctime> but since my program is small and that it does not judge a score or take in a lot of numbers into the program since it is rand generated i have found it very hard to incoorperate an Array into my simple game. …

Member Avatar for mrboolf
0
143
Member Avatar for anbuninja

[QUOTE=anbuninja;757148]Hey Im having my final this week and its going to be on loops. Anyone got any good website on loops?[/QUOTE] Google is your friend. [url]http://www.cprogramming.com/tutorial/lesson3.html[/url]

Member Avatar for Freaky_Chris
0
105
Member Avatar for ademsaykin

Another homework dump, a verbatim copy and paste straight from the assignment sheet, with nothing to suggest the OP has put any thought at all into it. If you are a first year C++ student, your tutor is high. Ignore the 25 minute estimate completely. It'll take you that long …

Member Avatar for VernonDozier
0
125
Member Avatar for ezkonekgal

[QUOTE=ai0372;753929]1. Cause if i don't extend it.. i have errors in my ATM class. 2. How do i store the pin number and account number? in arrays? i can't get it.. the program should start by initializing and declaring a single atm object which in turn initializes it's account objects.. …

Member Avatar for BestJewSinceJC
0
2K
Member Avatar for jasimp

A firebomb is a lethal weapon and therefore lethal force is justified by police to prevent it from being thrown, in my view. When a minor is threatening you with a lethal weapon, you no longer have to treat him with the restraint you might normally treat a minor and …

Member Avatar for jbennet
0
229
Member Avatar for Ancient Dragon

A big problem is the drivers. I bought a laptop with Vista installed on it a year an a half ago. It came with a disk with drivers on it, but they were all Vista drivers. I checked the manufacturer's website for other drivers and all there were were Vista …

Member Avatar for Jen0608
3
400
Member Avatar for clueless101

[QUOTE=clueless101;755389][code] public static int[] guess = {5,9,0}; [/code] with: [code] int[] guess = new int[10]; for (int i = 0; i < 10; i++) guess = i; [/code][/QUOTE] There's nothing random about this. Three questions you need to decide. One, how many elements should be in the array? Two, what …

Member Avatar for VernonDozier
0
92
Member Avatar for cerb63

[QUOTE=cerb63;738218]I tried that and ended up with a compiler error and I still don't know what I did wrong[/QUOTE] We don't either until you show what you tried. Lerner is correct. You need the arrow operator, not the dot operator. Currently you have the dot operator. Use code tags: [noparse] …

Member Avatar for tarakant_sethy
0
149
Member Avatar for mrnutty

[QUOTE=firstPerson;753251]All this expert and no answer?[/quote] There's no reason to say stuff like this. It just antagonizes people. [QUOTE=firstPerson;753251] how about this can i somehow define a literal string with A,J,Q,K,J? then pick it out of that or something?[/QUOTE] Create a character array: [code] char cards[] ={'J', 'Q', 'K', 'A'}; …

Member Avatar for dmanw100
0
136
Member Avatar for musham

[QUOTE=musham;753764]i want the code in JAVA for the program [COLOR="Red"]"To find the shortest path using the fuzzy logic"[/COLOR][/QUOTE] I want a new car. With any luck, Santa Claus will help us both out. If you want help BEFORE Christmas, though, you are going to have to be more specific and …

Member Avatar for stultuske
-1
105
Member Avatar for capricornia

[QUOTE=capricornia;753928]well excuse me, but i'm kinda new to this and haven't mastered the terminologies just yet. in any case, i use 'Dev-C++' and DOS.. and what i mean by it doesn't work is the DOS window closes before i see the output.[/QUOTE] This program doesn't compile. There will be no …

Member Avatar for chasee
0
238
Member Avatar for VernonDozier

OK, I've been reading a lot online and I think I can't do this, but I'm really hoping someone has a clever workaround. What I have is a bunch of classes with Color attributes. I'm also storing the red, green, blue, alpha values as integer attributes in those classes because …

Member Avatar for VernonDozier
0
143
Member Avatar for star100

[QUOTE=mahlerfive;753317]And your question is?[/QUOTE] [QUOTE=star100;753776]how can i code for student data base using this information? [/QUOTE] I don't think that's what mahlerfive meant when he asked what your question was. You simply reposted the assignment, then asked how to code it. You need to make an attempt and then ask …

Member Avatar for VernonDozier
0
194
Member Avatar for Holy Roller

You are using some nonstandard #include files and you have both stdlib.h and cstdlib: [code] #include <iostream> #include <cstdlib> #include <time.h> #include <string.h> #include <fstream> [COLOR="Red"]#include <windows.h>[/COLOR] [COLOR="Green"]#include <STDLIB.H>[/COLOR] [COLOR="Red"]#include <conio.h> #include "pause.h" #include "clrscr.h"[/COLOR][/code] I had to take all of the cls commands out because my compiler doesn't have …

Member Avatar for VernonDozier
0
121
Member Avatar for weasel5-12

You need to either put [ICODE]using namespace std;[/ICODE] at the top or use [ICODE]std::cout [/ICODE]and[ICODE] std::cin[/ICODE]

Member Avatar for weasel5-12
0
119
Member Avatar for StainlessSteelR

[QUOTE=StainlessSteelR;752500]The professor has not taught us "class Card"; so I'm not really sure what you're talking about,[/QUOTE] I like ArkM's solution! I'm going to +rep that one too! As to the many threads dealing with Card Shuffling, I recently added my own snippet. [url]http://www.daniweb.com/code/snippet1019.html[/url] Of the two methods in it, …

Member Avatar for VernonDozier
0
732
Member Avatar for afg_91320

[QUOTE=afg_91320;719402]^^um...that didnt help. sorry. can someone help by [I]showing [/I] how the code should be (or an example?) i know that arrays are like pointers but how does it apply to the particular code i am trying to work on [I]right now?[/I][/QUOTE] Well, it should have helped at least a …

Member Avatar for mrboolf
0
300
Member Avatar for michael1201

[QUOTE=michael1201;647656]The rules of Sudoku state that a Sudoku puzzle is solved when the 9x9 game board contains the numbers 1 through 9 exactly once in each row, column, and 3x3 box The numbers can appear in any order and diagonals are not considered.[/QUOTE] I'd have some boolean functions to check …

Member Avatar for mynameisor
0
270
Member Avatar for sleepytoast

[code] srand((P1Cards[i])time(0)); [/code] What are you trying to do here? Either seed the RNG with time (0) or with P1Cards[i], but not both.

Member Avatar for VernonDozier
0
126
Member Avatar for FrancisC07

[QUOTE=FrancisC07;750713]i need a help on how to add the value of an array to another value of an array?[/QUOTE] Value of an array? I don't know what that means. You are going to have to elaborate, I think.

Member Avatar for FrancisC07
0
191
Member Avatar for spi02

[QUOTE=spi02;749857]I have since realized that 10^23 is not possible given that the record is 10^12 flops.... I now want to try all permutations with 15 items chosen or less... so it'd be 71C15+71C14+71C13+71C12... scenarios Does anyone know how I can implement this?[/QUOTE] I don't know what calculations you are thinking …

Member Avatar for shaun.husain
0
103
Member Avatar for cherryteresa

[QUOTE=cherryteresa;750289]You're right, I was thinking about how all this math ties together. It's crazy to think about sometimes! Okay, so thank you for pointing out the power thing. I think this is where I got stuck before. I'm trying to figure out how to raise something to the power. We …

Member Avatar for cherryteresa
0
293
Member Avatar for Nyaato

This is actually harder because the maze itself has a lot of extra white space so there is not a unique solution. It will be easier in some ways to program for a maze where all the paths are only one character wide. Best foolproof algorithm is to always keep …

Member Avatar for Lerner
0
186
Member Avatar for cinderla

[QUOTE=cinderla;749595]ya i need help just want to read a file by using file functions. by reading a file all the datas will be in a buffer know. in the buffer i want to rretrieve 8 bytes , how to do this ?[/QUOTE] If you are reading files and using buffers …

Member Avatar for VernonDozier
0
92
Member Avatar for JackDurden

[QUOTE=JackDurden;748953]How would I delete one char from a string? [CODE]string aWord = "question?"; while(aWord[i]) { if(isalpha(aWord[i]))printf ("character %c is alphabetic\n",aWord[i]); else delete[i]aWord; i++; }[/CODE][/QUOTE] Use the replace function from string: [url]http://www.cplusplus.com/reference/string/string/replace.html[/url] [code] string aWord = "abcdef"; aWord.replace (3, 1, ""); [/code] [ICODE]aWord[/ICODE] now contains "abcef"; Edit: Or just use erase: …

Member Avatar for cikara21
0
223
Member Avatar for svetlana6167

[QUOTE=svetlana6167;747168]1. printf("%d", 10*5/10); what is this result? 2. printf("%d", 10+5-5); what is this result? 3. a=d++ +(b=a); a=4,b=4,d=4 a=? 4. c=a+ a++ - b--; a=4,b=4 c=? 5. c=a+ ++a - b--; a=4,b=5 c=? 6. if(a==0 && b==0) printf("1); else if(a==0 && b==0) printf("2"); else printf("3"); (if a=1 and b=0) what …

Member Avatar for ithelp
0
126
Member Avatar for Trader09

[code=cplusplus] for(int i = 0; i < 1000; i++) { msg[i].convertToString(messageID); getline(inFile,data); msg[i].setDate(data); getline(inFile,data); msg[i].setSender(data); getline(inFile,data); msg[i].setRecipient(data); getline(inFile,data); msg[i].setBody(data); } [/code] Line 3. There is nothing to convert, since you've never actually read [ICODE]messageID [/ICODE]in from the file, have you? What conversion is required, by the way? You store messageID …

Member Avatar for Trader09
0
216
Member Avatar for Sereal_Killer

[QUOTE=Sereal_Killer;747407]hmmm . ok ill keep looking i gues . its just that the teacher kinda threw this at us lol and suposed to be done by monday . but thanks ill just keep looking at tutorials online to see if i can find the answer .[/QUOTE] Here are the documentation …

Member Avatar for VernonDozier
0
126
Member Avatar for xinix

This thread is over three years old. [ICODE]conio.h[/ICODE] is non-standard. [ICODE]cin.get () [/ICODE]is standard. See this thread for how to keep the command window open. [url]http://www.dreamincode.net/forums/showtopic30581.htm[/url]

Member Avatar for VernonDozier
0
2K

The End.