week07.pdf - ICT167 Principles of Computer Science Lab Practice Week 7 You need to show working versions of your answers to all questions to your tutor

week07.pdf - ICT167 Principles of Computer Science Lab...

This preview shows page 1 out of 1 page.

ICT167 Principles of Computer Science 1 Lab Practice Week 7 You need to show working versions of your answers to all questions to your tutor. Your tutor will expect to see them by your next session. References: Topic 4 and 5 lecture slides, Chapters 6.1 - 6.7 1. Continue from Week 4 lab exercise,add two constructors to your fraction class. One should be a default constructor which creates the fraction 0/1. The other should accept numerator and denominator arguments. 2. Add a method dblValueto your fraction class which returns the double precision approximate value of the fraction. Eg, if a client has a fraction f which represents 1 / 2 then f.dblValue()
Background image

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture