Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
40% Quality Score
Upvotes Received
1
Posts with Upvotes
1
Upvoting Members
1
Downvotes Received
2
Posts with Downvotes
1
Downvoting Members
2
1 Commented Post
0 Endorsements
~7K People Reached
Favorite Forums
Favorite Tags
Member Avatar for logicmonster

I'm trying to come up with a small block of code that simply takes a character value that is input by the user and then use an "if" statement to determine what is excecuted depending on what is entered. I just started C++ this week and have no prior experience …

Member Avatar for lance p
0
304
Member Avatar for logicmonster

I am having a problem displaying random numbers, I'm trying to make a dice game where you play against the computer and the first one to 100 wins. However, my random number is never random, it always comes out as the same number. From what I understand to simply display …

Member Avatar for MrEARTHSHAcKER
0
858
Member Avatar for logicmonster

alright, well the code I have is a complete mess and there HAS to be a better way of doing it as well.... it's right here [CODE]#include <stdio.h> #include <stdlib.h> int toExit(int exit){ while(exit != 1 || exit !=2){ printf("\n\nPlease Choose:\n1) Exit\n2) Run program again\nYour choice: "); scanf("%d", &exit); printf("\n"); …

Member Avatar for logicmonster
0
293
Member Avatar for logicmonster

I'm getting into some territory I have never treaded before.... What I have is an Abstract class "Person" with an abstract class "Employee" that extends "Person" and then three concrete classes within "Employee" named: Agent, Accountant, and WebDesigner. sudo: [CODE]abstract class Person{ abstract class Employee extends Person implements myInterface{ class …

Member Avatar for logicmonster
0
261
Member Avatar for logicmonster

I am trying to create an array of a custom object and I think the error I'm running into is that the objects within the array are not initialized prior to use (its a run time error, so i'm not entirely sure). The part that doesn't make sense is, if …

Member Avatar for JamesCherrill
0
772
Member Avatar for logicmonster

I have to calculate the number of days between two dates the hard way. I know there is already a way to do this with an existing package and such but I have to do it within a single method "daysBetween" without altering any other part of the code. The …

Member Avatar for logicmonster
0
971
Member Avatar for logicmonster

Is it even possible to create a singly linked list using a function outside of main and then access it once you leave the function? pseudo: [CODE]#include //whatever needs to be included function{ \\create and link lists in this function } main{ funtion()//call function to create lists and link properly …

Member Avatar for Narue
0
1K
Member Avatar for logicmonster

I have to open and read a file whos file name is provided through a command line argument. Right now, I am using the following method. My main: [CODE]#include <stdio.h> #include <string.h> #include <ctype.h> #include <stdlib.h> #include "functions.h" int main(int argc, char *argv[]) { int count, string_size; int other = …

Member Avatar for Ancient Dragon
0
160
Member Avatar for logicmonster

I'm having a problem parsing information stored in the buffer after a getline command. I have a file with data in the format: [ICODE]1310 76102 C 5 27 2011 6 26 2011 5 R R 8.00 20.00 F R 8.00 25.00 150 165[/ICODE] I would separate everything using white space …

Member Avatar for WaltP
0
136
Member Avatar for logicmonster

I'm trying to figure out a way to create a loop to open files and read in data until either there are no more files or the user wants to stop. for example, the first time through the loop, the string variable would be "myfile_1" and then each subsequent time …

Member Avatar for logicmonster
0
453
Member Avatar for logicmonster

I have a string that has a bunch of white space on the end of it and was wondering if there is a simple way to eliminate the trailing white space with a standard C function. I know there is one called "String.trim" but I can't use anything that isn't …

Member Avatar for Adak
0
160
Member Avatar for debasishgang7

hi all, I am trying to pass an array to a function. an array is like char game[4] = {'S', 'R', 'D'}; i wanna pass the entire array to a function which accept. like this void name(char *game) How to do this..?

Member Avatar for abhimanipal
0
179
Member Avatar for logicmonster

I have two different ways to traverse a tree adt that essentially do the same thing except one is a recursive function and the other is iterative. How could I compare the efficiency between them? RECURSIVE [CODE]inorder(node) if node.left ≠ null then inorder(node.left) print node.value if node.right ≠ null then …

Member Avatar for abhimanipal
0
130
Member Avatar for logicmonster

Aside from using switch statements, do-while loops, and if-else trees, is there a good way to complete error checking after a user input from the keyboard?

Member Avatar for abhimanipal
0
183
Member Avatar for logicmonster

Is there a way to evaluate cosecant^2 in c? As far as I know, it isn't included in the math.h library, but could there perhaps be another one that it is included in?

Member Avatar for WaltP
0
57
Member Avatar for logicmonster

I'm working on a code that will multiply two matrices and print the result. This specific code is meant to ask the user to define the bounds of the matrices (i.e. the (M)x(N) of the matrix) then ask for each matrix by row. The trouble I'm having is that I …

Member Avatar for N1GHTS
0
135
Member Avatar for logicmonster

I finished this last night and it almost works perfectly aside from one minor thing that I can't quite figure out. [CODE] #include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main() { int playerscore, computerscore; int turnscore; int dice; char input = 0; bool turnover, gameover; srand((unsigned)time(0)); playerscore …

Member Avatar for logicmonster
0
113
Member Avatar for kotkata

[code] //this game is played with a six sided die, on each player's turn he may roll until he gets a 1 from the die, at which point, all points accumulated to that point are wiped, he may hold and add the accumulation to his score at any time. #include<fstream> …

Member Avatar for WaltP
0
268
Member Avatar for sgw

Here is the simplest program: [CODE]#include <iostream> using namespace std; int main() { cout << "hello" << endl; cin.get(); return 0; }[/CODE] When I ran it (using Dev C++), there is no output, just a blank screen. The problem seems to be from the "endl". If I delete it, or …

Member Avatar for ppl154
0
139
Member Avatar for logicmonster

This is a program that is meant to be a dice game with the computer, and this is what I have so far. I'm trying to make sure that I'm doing it right but I can't compile it to check because of a syntax error near the end of the …

Member Avatar for WaltP
0
170
Member Avatar for logicmonster

I have a program that a friend wrote for me in Java, however I'm trying to put it in C++ and I don't know Java myself. Does anyone know somewhere that I can get it translated? Or maybe someone who has time to translate it themselves? It all looks vaguely …

Member Avatar for javaAddict
0
183