Monday
September 1, 2014

Homework Help: computer science

Posted by Shannon on Friday, May 28, 2010 at 10:46am.

hi i'm taking compsci and I need someone to give me some examples of these classes, thanks!

You will have to write a class to represent one of the following items. Note
that each class must a proper constructor even though the constructor is not
explicitly named.

1. a Fraction that has a numerator and a denominator. The class should
have methods that can: (1) add and subtract two Fractions together and
return the resulting Fraction, (2) create a duplicate of itself and return
the duplicate, (3) see if another Fraction is equivalent to itself and return
True or False appropriately and (4) reduce itself to the lowest equivalent
Fraction.

2. a Student that has a name, point and course count. The class should
have methods that can: (1) add a grade to the GPA and GPA should be
calculated and returned appropriately, (2) create duplicate of itself and
return that duplicate, and (3) see if another student has the same name
and GPA as itself and return True or False appropriately.

3. a Clock that has a minute and hour hand. The class should have methods
that can: (1) add and subtract minutes appropriately, (2) return an ap-
propriate textual representation of itself (either 12 or 24 hour clock), (3)
duplicate itself and return that duplicate, and (4) see if another clock is
of equal time as itself and return True or False appropriately.
3

Answer this Question

First Name:
School Subject:
Answer:

Related Questions

math - Greg teaches martial arts. He charges a one time processing fee of $5.00 ...
probability - out of 250 students interviewed at a community college, 90 were ...
computer science - write a program to select the classes that you are taking(Ex...
Computer Science - Java - Hi, For an assignment I am doing, we have to have 2 ...
math - For every girl taking classes at the martial arts school, there are 3 ...
Math - For every girl taking classes at the martial arts school, there are 3 ...
Math - for every girl taking classes at the school, there are 3 boys who are ...
Grades - I need some help on calculating my current high school GPA. So far, I'...
Writing - If you are interested in going into a career as an author, what ...
Speech 09 - I had to interview someone in my class and write speech about them...

Search
Members