Maurice Tutor

(5)

$15/per page/Negotiable

About Maurice Tutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Algebra,Applied Sciences See all
Algebra,Applied Sciences,Biology,Calculus,Chemistry,Economics,English,Essay writing,Geography,Geology,Health & Medical,Physics,Science Hide all
Teaching Since: May 2017
Last Sign in: 407 Weeks Ago, 6 Days Ago
Questions Answered: 66690
Tutorials Posted: 66688

Education

  • MCS,PHD
    Argosy University/ Phoniex University/
    Nov-2005 - Oct-2011

Experience

  • Professor
    Phoniex University
    Oct-2001 - Nov-2016

Category > Computer Science Posted 27 Aug 2017 My Price 12.00

methos and constructor

  1. Make a class Rational to provide at least following methos and constructors:

Rational r1= new Rational (3,5);

Rational r2= new Rational (4,7);

Rational r3=r1.add(r2);

// also sub,mult,divide methods

         Other that four operations you should provid methos that you think is useful for user of your class.

        2. Write a JFrame or JApplet (file name: TestRational.java) that performs the following tasks:

         a) Define two arrays of size 10. Each element in the array references to a Rational object that you wrote in Problem 1 above.

                   Rational a[], b[];

                   a = new Rational[10];

                   b = new Rational[10];

                

Rational

Numerator                                                                                                                              

                           

Denominator

                                      

          

              

 

   .

   .

   .

   .

   .

 

         b) Initialize the arrays in Question a) by creating random Rational numbers. Do this by generating two       random numbers between 1 and 9 for each Rational and using the numbers as the numerator and     denominator. Denominator should be greater than Numerator. You should generate random numbers with Math.random.

         c) Display the contents of both arrays on the screen using JTextArea.

         d) Add a Scrollbar to JTextArea for scrolling up or down.

         e) For each public method in Rational class, create a corresponding JButton object. When the user clicks on a button, the actionPerformed listener should execute the corresponding Rational method for all the elements in the two arrays and store the results in a new array. You should then display the result array in the JTextArea using the setText method. For example, if the user hits the add button you should loop     through all the elements in arrays and execute:

  

                   c[i] = a[i].add(b[i]);

        

         f) If the user hits the sort button, uses the JTextArea method append to append the results of sorting.

Answers

(5)
Status NEW Posted 27 Aug 2017 12:08 PM My Price 12.00

Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll

Not Rated(0)
Relevent Questions