Yarr The Pirate!
https://w.yarrthepirate.com/phpbb3/

C++ Help
https://w.yarrthepirate.com/phpbb3/viewtopic.php?f=5&t=10520
Page 1 of 1

Author:  Armani [ Thu Feb 01, 2007 9:19 am ]
Post subject:  C++ Help

If anyone knows how to use this program, we need to make a fraction quiz and the teacher won't tell us anything. So far I just have 3 different numbers with 1 underneath the other two, but if theres a way to make it one character, I'd appreciate the help.


something like:

a + b
- -
c c

I think I'm going to do the math outside the fraction and just check for the correct answer, unless someone can give me a more correct way to do it.

Author:  Theterk [ Thu Feb 01, 2007 10:52 am ]
Post subject: 

so, you need an input (3 numbers: Numerator and Denomenator) and an output (mixed number or decimal)?

Author:  Armani [ Thu Feb 01, 2007 11:05 am ]
Post subject: 

we're supposed to generate 3 random numbers for easy difficulty, and 4 for medium and hard (different bottom numbers, can't think of the word).

fatass teacher wrote:
Quiz phase 3

Expand the current quiz program to include add, subtract, multiply, and divide of fractions. All answers received from the user must be in simplified form. Improper fractions are acceptable. No mixed numbers. Show the fractions as they would see them in a math book.

The easy quiz should be the only one in which like denominators already exist. Medium and hard should have unlike denominators.


Earlier we had to just make two numbers for + - x and /, and now must do fractions. I can generator the 4 random numbers fine, but I'm not sure how to make it so they go together evenly for multply and divide.

Author:  Computer [ Thu Feb 01, 2007 1:01 pm ]
Post subject: 

why not just follow the basic rules for multiply and divide fractions...?
http://www.aaamath.com/fra.html#topic23

Here is the program...
http://www.cplusplus.com/src/fraction2.zip


One thing i learned from college is there is an example of every program on the internet it seems. I just chose to learn from google instead of a 300$ text book.

Author:  Armani [ Thu Feb 01, 2007 3:55 pm ]
Post subject: 

Thanks Computer. I'm not very good at finding what I need on the internet if wikipedia doesn't have it :x

Author:  Theterk [ Thu Feb 01, 2007 4:49 pm ]
Post subject: 

you basically need to take in 2 fractions in the form of "x / x" and put them into an array of characters.

to add, you find the common denominator by multiplying the smallest denominator by the largest denominator, and the opposite for the larger denominator. you then multiply the numerators of both by the same number as you did w/ the denominator, and add them together, and move that answer to your solution array. subtraction is the same concept.

to multiply, just multiply the 2 numerators and store that into the numerator of the solution, and the same for the denominator. to divide, invert the 2nd fraction and multiply

Author:  Armani [ Fri Feb 02, 2007 4:32 pm ]
Post subject: 

well, the one link you gave me, the program samples it gives have 25+ errors :( and I'm not sure whats all wrong other than it might be a different version. I went to the website and click fractions 1, and that worked, but it only simplified fractions that the user inputed.

in the end, i wasted all day making part of my program look silly, and I guess I'll figure it out monday.


p.s.
thanks for the snow yarr

Author:  Yarr [ Fri Feb 02, 2007 4:55 pm ]
Post subject: 

Armani wrote:
p.s.
thanks for the snow yarr


Marry god damn christmass

Author:  Reinheld [ Fri Feb 02, 2007 5:43 pm ]
Post subject: 

Marry god? He doesn't like the gays.

Author:  Ponuh [ Fri Feb 02, 2007 6:16 pm ]
Post subject: 

Reinheld wrote:
Marry god? He doesn't like the gays.


Bullshit--How do you explain THIS, then?

Image

Author:  Caduceus [ Fri Feb 02, 2007 7:27 pm ]
Post subject: 

Ponuh wrote:
Reinheld wrote:
Marry god? He doesn't like the gays.


Bullshit--How do you explain THIS, then?

Image


I always wonder why he keeps that entourage of little boy angels.

Author:  Parade [ Fri Feb 02, 2007 8:13 pm ]
Post subject: 

that guy couldnt even get a girl... look at that thumbtac cock

Author:  Computer [ Fri Feb 02, 2007 11:13 pm ]
Post subject: 

How did a C++ thread get hit with a gay stick?

Author:  Armani [ Sun Feb 04, 2007 11:25 am ]
Post subject: 

ponuh i think

Author:  Armani [ Tue Feb 06, 2007 9:22 am ]
Post subject: 

we gotta use a command called modulus (%) but the teacher won't tell us how to use it. it makes sure numbers divide into each other evenly.

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/