UCLA A5


  • 作业标题:Homework 5 – due March 3rd
  • 课程名称:University of California, Los Angeles (Winter 2022)
  • 完成周期:2天

Overview

Instructions: A template to answer this homework is provided on Bruinlearn. The template includes:

• Fracs.hpp and Fracs.cpp contain the Frac class which I will define in lecture. The class interface is in the .hpp file. Any leftover member function definitions appear in the .cpp file. YOU SHOULD NOT CHANGE THESE TWO FILES. You may notice that I have destroyed the default constructor. I have done this on purpose. YOU ARE NOT ALLOWED TO FIX THIS. So do not ever call the default constructor for Frac explicitly or implicitly (by not using an initializer list in ComplexFrac).

• main.cpp contains some demonstration code. You can edit this file as much as you like, and you should edit this file in order to test the functionality of the new class that you create.

• ComplexFracs.hpp and ComplexFracs.cpp are the files which you will turn in. Currently there is a declaration of a class called ComplexFrac in the .hpp file. It has two private member variables: real and imag. It has one public constructor with no parameters which creates an instance of ComplexFrac with real==0 and imag==0. It has one public member function called print. The definition of print is given in the .cpp file. You should read and understand what it is doing.

。。。


文章作者: IT神助攻
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 IT神助攻 !
  目录