computer science

posted by .

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

Respond to this Question

First Name
School Subject
Your Answer

Similar Questions

  1. math

    a class has 18 classes with 35 students in each class. in order to reduce the class size to 30,how many new classes must be formed?
  2. Computer Science - Java

    Hi, For an assignment I am doing, we have to have 2 service classes and one application class. One service class is already written (i.e. DiceGame1) and I am writing another one (i.e. Player) that is supposed to use the previous service …
  3. Computer Science

    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. 2. Student that has a name, point and course count. The class should have methods …
  4. Computer Sci Help pls

    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. 2. Student that has a name, point and course count. The class should have methods …
  5. computer

    Write a menu driven program that either accepts words and their meanings, or displays the list of words in lexicographical order (i.e. as in a dictionary). When an entry is to be added to the dictionary you must first enter the word …
  6. math

    Greg teaches martial arts. He charges a one time processing fee of $5.00 and the cost of classes are shown below. let x represent the number of classes and y represent the cost of the classes. Based on the information, what will it …
  7. algebra

    Classes A and B have 35 students each. If seven girls shift from class A to class B, then the number of girls in the classes would interchange. If four girls shift from class B to class A, then the number of girls in class A would …
  8. algebra

    Classes A and B have 35 students each. If seven girls shift from class A to class B, then the number of girls in the classes would interchange. If four girls shift from class B to class A, then the number of girls in class A would …
  9. math

    In a freshman class of 3500 students at a particular college, 20000 are taking either a history of English class their first semester. Of these 2000 students, 1300 are taking both a history class and an English class, and 375 are taking …
  10. math

    An elementary school is offering 3 language classes: one in Spanish, one in French, and one in German. These classes are open to any of the 93 students in the school. There are 35 in the Spanish class, 31 in the French class, and 22 …

More Similar Questions