49,757 Topics

Member Avatar for
Member Avatar for aznlitomik3

MY ASSIGNMENT: Write a program that works with fractions. Your program should be able to add, subtract, multiply, and divide two fractions. Specifically, your program must request two fractions from the user, getting the numerator and denominator separately for each fraction, and the operation to perform (add, subtract, multiply, or …

Member Avatar for aznlitomik3
0
13K
Member Avatar for Lance5057

Whenever I run this code the while(b<63) only seems to run once then does nothing. The (a<63) loop runs fine but doesn't go again because the first loop just stops. Any idea what's going on? [CODE]#include <iostream> #include <time.h> using namespace std; int main() { int a,b,c,sand; int land[64][64]; srand((unsigned)time(NULL)); …

Member Avatar for Lance5057
0
106
Member Avatar for travigne

This is the question : you are burning some music CDs for a party. You've arranged a list of songs in the order in which you want to play them. However, you would like to maximize your use of space on the CD, which holds 80 minutes of music. So, …

Member Avatar for travigne
0
2K
Member Avatar for ahaykal

I have this homework in which I have been working on it: but I dont know what im doing wrong :( Could anyone help me: [code]#include <iostream> #include <cstring> using namespace std; class Account { private: char number[8]; char type; char owner[31]; double balance; double interestRate; public: Account() { number[0] …

Member Avatar for ahaykal
0
243
Member Avatar for vbx_wx

[code] class Security { public: virtual ~Security() {} }; class Stock: public Security {}; class Bond: public Security {}; class Investment: public Security { public: void special() { cout << "Special Investment function" << endl; } }; class Metal: public Investment {}; int main() { Security* s = new Metal; …

Member Avatar for vijayan121
0
103
Member Avatar for ayesha91

Hello, I am having a problem with an assignment that I have to submit tomorrow which is to let a user construct an object. in the assignment it is asked from me to create a DVDshop class where the user can create a DVD object. Also, in this class I …

Member Avatar for ayesha91
0
119
Member Avatar for angel6969

Write a program that will read in a sentence of up to 100 characters and output the sentence with spacing corrected and with letters corrected for capitalization. In other words, int the output sentence all strings of two or more blanks should be compressed to a single blank. The sentence …

Member Avatar for cbsinc
0
2K
Member Avatar for kuchick32

I'm trying to use a getline function in my program. I have the correct cout function but when I try and enter my input the program keeps wanting me to enter a couple of times and then that's what comes out. I'm very confused on what I'm doing wrong in …

Member Avatar for kuchick32
0
109
Member Avatar for bpress91

I have written a program that allows for two people to play tictactoe, however it will not work. I am not sure what the problem is. Can some please help? Thank you in advance

Member Avatar for technologic
0
39
Member Avatar for akssps011

Hi I wanted to start a project on implementing packet sniffer. Though I have fairly good experience of C++ programming and network protocols( theoretical), I am not able to get start with this. How should I approach towards it. What libraries or resources should be helpful ? Would Qt be …

Member Avatar for alwaysLearning0
0
109
Member Avatar for naricpp

Hi All, Please find the below code and please elaborate how derived class default copy constructor is calling base class copy constructor which is implemented by the base class. [CODE]class X { X( const X& x ); } class Y ; public X { } class Z { void fun( …

Member Avatar for Fbody
0
147
Member Avatar for MAPONYA

I'm a beginner as far as c++ is concernt.I want help using user defind funtions

Member Avatar for rahul10.rawat
-1
144
Member Avatar for BryantFury

hello, so im designing a simple prgram which calculates the cost of a ticket you buy. there are only 3 ticket options, namely a b and c. here is my code. [CODE] #include <iostream> using namespace std; const int PRICE = 3; int find(int [PRICE]); int main() { int nums[PRICE] …

Member Avatar for Tom83B
0
104
Member Avatar for mommabear

[B]Specifications (minimum):[/B] The CDROM class contains the following, private, data members: string Name; // The Name of the CDROM string CDType; // The Type of CDROM float Cost; // The Cost of the CDROM [I]The ONLY recognized (i.e., legal) CDROM types are, “Game”, “Word”, “Compiler”, “Spreadsheet”, “Dbase”, and “Presentation” (AND, …

Member Avatar for mitrmkar
0
148
Member Avatar for format_c

Im trying to create an object array that accepts values generated by a 2 random functions so that i can sort the objects in the array based on one value of an identifier (finishtime) in each object. eg. twenty Activitys with datamembers [starttime, finishtime, id] my code for the main.cpp …

Member Avatar for thelamb
0
189
Member Avatar for digan

Hi, ive only started programming recently and as my second assignment i have to write a program that can convert uppercase letters to lowercase letters and visa-versa. i also have to make it stop when a full-stop is entered and count the number of times the program changed letter case. …

Member Avatar for digan
0
107
Member Avatar for bejfake

Hi, I've got such class template: [CODE=c]template <class Type> class Stack{ private: struct Element{ Type value; Element *prev; } *end; public: Stack(){ end = NULL; } void push(Type value){ struct Element *element = new Element; element->value = value; element->prev = end; end = element; } Type pop(){ if(end != NULL){ …

Member Avatar for alwaysLearning0
0
3K
Member Avatar for fantasma

Greetings from Portugal to everyone. I'm building a project to a course in my university and i've stucked in some compiling error given by NetBeans and g++ in my dynamic array implementation. Glad if someone could give a hand to this. Here is the code [ICODE]#pragma once #include <iostream> #include …

Member Avatar for fantasma
0
121
Member Avatar for Nathaniel10

This is a follow-up exercise to the one related to reference and dereference operators. Stroustrup asks the reader to modify that program to handle an array overflow. He wants us to specifically use the realloc() function. I read the tutorial here but didn't understand the example. I read other web …

Member Avatar for Ancient Dragon
0
98
Member Avatar for jimbob90

Here's my main [code=c++] int main () { int list1[3] = {5,5,6}; int num = 3; int result; int *arr = list1; int maxVar; int *maxVarHolder; maxVarHolder = &maxVar; result = sumarr(*arr, num, *maxVarHolder); return 0; } [/code] Here's the function header: [code=c++] int sumarr (int *arr, int size, int …

Member Avatar for mike_2000_17
0
229
Member Avatar for Lightslei

I need the program to read 2 pieces of data from each line of a text. For example my txt is: [code] A Garbage B Garbage2 A Garbage3 A Garbage4 A Garbage5 B Garbage3 B Garbage [/code] Now IIRC the getline function breaks after the first space. The program is …

Member Avatar for WaltP
0
121
Member Avatar for format_c

Im trying to write a code for a class that has 20 activities .. each activity has a start time and a finish time. When i try to generate the times the start time is larger than the finish in some cases. can any one help me with my function …

Member Avatar for jonsca
0
146
Member Avatar for arithehun

Anyone that develops GUI applications in C++ will definitely be familiar with the C++ <windows.h> class. However, I am wondering who wrote this vast class?

Member Avatar for Ancient Dragon
0
98
Member Avatar for Greywolf333

Hey all, I need to initialize an array to hold an image to all zeroes. The dimensions are that of an image [numcols][numrows][3], where 3 is for rgb values. I know this isn't necessary when I'm reading an image into the array, of course, but I'm going to be using …

Member Avatar for Greywolf333
0
129
Member Avatar for 0dark

Hello guys, this is my first post, so don't be harsh if I do something stupid. Well, the reason why I'm posting here is because I need to find a method to alter the stream itself, not just the buffer I send to a variable with "file.Read(". For example, lets …

Member Avatar for Ancient Dragon
0
227
Member Avatar for C++Challenged

I need to write a program to decipher a code and process a set of characters in a text file. this is the text file: >EBC;Iit_is a CaPital Mistake tO_theorize Before_one has DatA123. There are 6 encrypted characters at the beginning of the file. The encryption is based on the …

Member Avatar for hardatwork
0
141
Member Avatar for TheGlyde

[CODE] #ifndef LexA_H #define LexA_H #include <iostream> using namespace std; class LexA { public: int charClass, lexLen, token, nextToken; char lexeme[100], nextChar; private: char character; public: LexA(); void setChar(char); void addChar(); void getChar(); void getNonBlank(); int lex(); int lookup(char); #define int_lit 10; #define ident 11; #define assign_op 20; #define add_op …

0
68
Member Avatar for giftalp

I have created class menu and class number. I would like that my functions in class do sum, subtract, multiply, and divide. I've done sum, but I have problems with other functions. When I do difference, it is actually sum my numbers, and result of multiplication and division is 0 …

Member Avatar for giftalp
0
192
Member Avatar for StopWatch

Hi all, I am senior in high school and I am currently taking computer science classes in which we are learning C++. I understand the most basic implmentations of C++ fundamentals. I am seeming to have a lack of full understanding with heaps. I have borrowed several books in the …

0
44
Member Avatar for hq1

Hey so I wrote this blackjack program to read from file but i'm getting these errors on the specified lines: Error 1 error C2059: syntax error : 'while' line: 46 Error 2 error C2228: left of '.ins' must have class/struct/union line: 48 Error 3 error C2050: switch expression not integral …

Member Avatar for Ryaether
0
135

The End.