Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
100% Quality Score
Upvotes Received
1
Posts with Upvotes
1
Upvoting Members
1
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
~3K People Reached
Favorite Forums
Favorite Tags
c++ x 40
Member Avatar for Towely

I'm getting the error message "Error: expected initializer before 'sum' " from line 9 of my code when I try to compile my program. I can't seem to figure out why it would be throwing this error. Any help would be great. Thanks! [CODE] #include <iostream> using namespace std; struct …

Member Avatar for Towely
0
787
Member Avatar for Towely

I'm currently working on a project that simplifies and adds two user-defined fractions. The teacher specified that we use a function with the prototype: [code] Fraction addfractions(const Fraction& f1, const Fraction& f2) [/code] My problem is, I can't find any information on this Fraction data type that he is making …

Member Avatar for rbrt13
0
992
Member Avatar for Towely

I'm having a few issues with my Pig Latin program. First, The program doesn't loop correctly. I need it to keep prompting the user for input until the user presses CTRL+D, but I can't figure out how. Right now, it never re-writes the line "Enter some text (CTRL-D to end):". …

Member Avatar for Towely
0
164
Member Avatar for Towely

I'm trying to make a function that adds the digits of a number together and finds the sum of them. For example, for the number 9211, I want to add 9 + 2 + 1 + 1 and output the sum. Here's my function, I can't figure out where I …

Member Avatar for kri_prasad2000
0
179
Member Avatar for Towely

I know this is probably a really easy question, but my teacher failed to mention how to do it, so here goes. I'm making a simple program that tells a user if a sequence of given numbers are even or odd. Here's what the program should look like: [CODE]Enter a …

Member Avatar for Towely
0
141
Member Avatar for Towely

I'm attempting to create a computer program that prints a triangle of digits, as well as a "ruler" that measures the user specified width of the screen, showing the width in digits. The ruler must have a tens row and a ones row. The program reads three integers: a) the …

Member Avatar for Towely
0
242
Member Avatar for Towely

I'm trying to create a program that takes 2 numbers from a user (a numerator and a denominator), displays one ontop of the other separated by dashes, and then shows the answer of one number divided by the other. Inside an If statement, I want to output several lines using …

Member Avatar for Towely
0
214
Member Avatar for Towely

I'm trying to compile a program that I created that takes a number and finds its average and reverses it. It's a very simple program, but when I try to compile it with g++, it gives me an error. Why won't it compile? What code is wrong? [CODE] #include <iostream> …

Member Avatar for siddhant3s
0
187