SlideShare a Scribd company logo
EN3085 Assessed Coursework 1
1. Create a class Complex to allow programmers the easy use of
complex numbers in their programs. An
object of that class should: [5]
a. Be able to store a complex number in the most efficient way.
b. Make use of constructor and destructor functions if needed.
The
constructor should take three arguments: a character indicating
if the last
two arguments should be interpreted as real and imaginary parts
or
magnitude and angle, and two real numbers defining the value
of the
complex number. The constructor should also initialise the
members of
the object appropriately, including for cases when it receives
only some
or no arguments.
c. Be able to return individual element of the complex number
in both
rectangular (real and imaginary) and polar form (magnitude and
angle).
d. Allow modification of the stored complex number by
enabling the
modification of individual elements of the complex number
(both in rectangular and polar form).
e. Include a function to print on the screen the complex number,
either in rectangular or polar form.
2. Create a function GetComplexListFromFile, that: [2]
a. Reads all complex numbers recorded in a text file. Each data
line in the text file always consist of one of
the following, to define a complex number:
• a letter ‘p’ followed by a magnitude and an angle (in radians),
all separated by a space.
• a letter ‘r’ followed by the real and imaginary parts, all
separated by a space.
b. Creates for each of them an object of type Complex.
c. Stores each created Complex object in a vector to obtain a list
of all complex number defined in the file.
d. Returns the resulting vector to the function call location.
3. Create a function SaveComplexListToFile that saves a
provided list of Complex objects into a text file, using
the same text file format mentioned in question 2.a. [2]
4. Using the Complex class and the functions developed
previously, write a main function which will in the
order provided below: [2]
a. Stores in a vector ComplexList all complex number stored in
the provided file "ComplexList.txt".
b. Prints on the screen, in both rectangular and polar forms, all
complex numbers stored in ComplexList.
c. Keeps asking on the screen if the user wants to add a complex
number to the list and if so asks for the
relevant information and stores the provided new complex
number in the vector ComplexList.
d. Saves all the object stored in ComplexList in the file
"ComplexList.txt".
5. Expand the class Complex with the following overloaded
member operators: binary operators "+", "-", "*",
and "/" and a unary operator "-". [4]
The operators should return complex numbers only in
rectangular form and provide the standard
functionality for arithmetic operations on complex numbers.
Using these operators, in the main function:
a. Calculate the sum of all complex number stored in the vector
ComplexList, after the reading of the
file "ComplexList.txt" and after the user has provided additional
complex numbers.
b. Demonstrate the use of all operators using the following
equation: A= - B*(C-D)/E
A, B, C, D and E, being the 5 first complex number provided in
the file "ComplexList.txt".
c. Print on the screen the complex number resulting from the
equation above in both rectangular and
polar form.
When relevant you should make use of all the “best practice”
and concepts covered in the lecture (e.g. inline,
const…).
r
Ɵ
a
b
Standard form: a + b.i
Im
Re
Polar form: r (cos Ө + i sin Ө)
Submission Procedure
You should solve the problems independently from other
students and submit only your own work. Submit
your solution on “learning central” using the Coursework
Answer Sheet provided by 18:00, Friday
27/03/2020 (week 9).
In section one of the Coursework Answer Sheet, explain briefly
the structure of your class in terms of memory
usage and “user friendliness”, how you tested it and any
identified issues. Then, directly from Microsoft Visual
C++, copy and paste all your code in the relevant section of the
Coursework Answer Sheet. Add a screen shot
of the window showing what is printed on the screen when
running your program (for example using
Microsoft Snipping Tool).
All developed code should be included in the 3 files provided:
Complex.h, Complex.cpp and Main.cpp and
these 3 completed files should also be uploaded on “learning
central” together with the Coursework
Answer Sheet to facilitate our testing of your program. Any
incomplete submission will be considered late.
Marking scheme
Source code. Maximum marks will be awarded for:
• A correctly functioning program. The program should operate
according to the specification.
• An efficient program and elegant algorithms. Try to develop
algorithms, which are efficient in terms of the amount of
data, which needs to be stored (e.g. minimum number of
variables used), and the speed in which they operate.
• Appropriate use of classes and functions. Try to keep your
function main() as short as possible.
• A user-friendly program. When your program runs, the
messages displayed on the screen should be easy to
understand and succinct. The user should be in no doubt as to
what they must do to use the program.
• A well commented program. The judicious use of commenting
is essential if somebody else is to easily understand
your program. Start your programs with a short comment
specifying the name of the program, your name, and what your
program is designed to do. Supply your functions with pre- and
post-conditions.
• A well laid out program. Indent your program code. Indent
your comments as well. Use blank lines to space out blocks
of code.
EN3085 Assessed Coursework 1Submission ProcedureMarking
scheme
#include "complex.h"
p 10 0.5
r 12 14
p 25 1
p 100. 0.80
r 50. 50.
p 20 3.14
r -100. 25
p 12 1.14
#include "complex.h"
using namespace std;
void main()
{
}

More Related Content

Similar to EN3085 Assessed Coursework 1 1. Create a class Complex .docx

C Programming Lab manual 18CPL17
C Programming Lab manual 18CPL17C Programming Lab manual 18CPL17
C Programming Lab manual 18CPL17
manjurkts
 
CBCS 2018 Scheme I sem Lab Manual for 18CPL17
CBCS 2018 Scheme I sem Lab Manual for 18CPL17 CBCS 2018 Scheme I sem Lab Manual for 18CPL17
CBCS 2018 Scheme I sem Lab Manual for 18CPL17
manjurkts
 
I x scripting
I x scriptingI x scripting
I x scripting
Alex do Amaral Dias
 
PT1420 File Access and Visual Basic .docx
PT1420 File Access and Visual Basic                      .docxPT1420 File Access and Visual Basic                      .docx
PT1420 File Access and Visual Basic .docx
amrit47
 
Student Lab Activity A. Lab # CIS CIS170A-A1B. Lab 6.docx
Student Lab Activity A. Lab # CIS CIS170A-A1B. Lab 6.docxStudent Lab Activity A. Lab # CIS CIS170A-A1B. Lab 6.docx
Student Lab Activity A. Lab # CIS CIS170A-A1B. Lab 6.docx
emelyvalg9
 
Question 1 briefly respond to all the following questions. make
Question 1 briefly respond to all the following questions. make Question 1 briefly respond to all the following questions. make
Question 1 briefly respond to all the following questions. make
YASHU40
 
1 Project 2 Introduction - the SeaPort Project seri.docx
1  Project 2 Introduction - the SeaPort Project seri.docx1  Project 2 Introduction - the SeaPort Project seri.docx
1 Project 2 Introduction - the SeaPort Project seri.docx
honey725342
 
Cmis 102 Effective Communication / snaptutorial.com
Cmis 102  Effective Communication / snaptutorial.comCmis 102  Effective Communication / snaptutorial.com
Cmis 102 Effective Communication / snaptutorial.com
HarrisGeorg12
 
Educational Objectives After successfully completing this assignmen.pdf
Educational Objectives After successfully completing this assignmen.pdfEducational Objectives After successfully completing this assignmen.pdf
Educational Objectives After successfully completing this assignmen.pdf
rajeshjangid1865
 
Comp 220 ilab 6 of 7
Comp 220 ilab 6 of 7Comp 220 ilab 6 of 7
Comp 220 ilab 6 of 7ashhadiqbal
 
Comp 220 ilab 7 of 7
Comp 220 ilab 7 of 7Comp 220 ilab 7 of 7
Comp 220 ilab 7 of 7helpido9
 
Oopp Lab Work
Oopp Lab WorkOopp Lab Work
Oopp Lab Work
Heather Dionne
 
The Lab assignment will be graded out of 100 points.  There are .docx
The Lab assignment will be graded out of 100 points.  There are .docxThe Lab assignment will be graded out of 100 points.  There are .docx
The Lab assignment will be graded out of 100 points.  There are .docx
jmindy
 
Comp 220 ilab 7 of 7
Comp 220 ilab 7 of 7Comp 220 ilab 7 of 7
Comp 220 ilab 7 of 7ashhadiqbal
 
Cmis 102 Success Begins / snaptutorial.com
Cmis 102 Success Begins / snaptutorial.comCmis 102 Success Begins / snaptutorial.com
Cmis 102 Success Begins / snaptutorial.com
WilliamsTaylorza48
 
Cmis 102 Enthusiastic Study / snaptutorial.com
Cmis 102 Enthusiastic Study / snaptutorial.comCmis 102 Enthusiastic Study / snaptutorial.com
Cmis 102 Enthusiastic Study / snaptutorial.com
Stephenson22
 
Computer science sqp
Computer science sqpComputer science sqp
Computer science sqp
B Bhuvanesh
 
Bcsl 031 solve assignment
Bcsl 031 solve assignmentBcsl 031 solve assignment
Comp 220 ilab 7 of 7
Comp 220 ilab 7 of 7Comp 220 ilab 7 of 7
Comp 220 ilab 7 of 7
solutionjug4
 
IP Lab Manual for Kerala University 3 Year UG Programme
IP Lab Manual for Kerala University 3 Year UG ProgrammeIP Lab Manual for Kerala University 3 Year UG Programme
IP Lab Manual for Kerala University 3 Year UG Programme
SAFAD ISMAIL
 

Similar to EN3085 Assessed Coursework 1 1. Create a class Complex .docx (20)

C Programming Lab manual 18CPL17
C Programming Lab manual 18CPL17C Programming Lab manual 18CPL17
C Programming Lab manual 18CPL17
 
CBCS 2018 Scheme I sem Lab Manual for 18CPL17
CBCS 2018 Scheme I sem Lab Manual for 18CPL17 CBCS 2018 Scheme I sem Lab Manual for 18CPL17
CBCS 2018 Scheme I sem Lab Manual for 18CPL17
 
I x scripting
I x scriptingI x scripting
I x scripting
 
PT1420 File Access and Visual Basic .docx
PT1420 File Access and Visual Basic                      .docxPT1420 File Access and Visual Basic                      .docx
PT1420 File Access and Visual Basic .docx
 
Student Lab Activity A. Lab # CIS CIS170A-A1B. Lab 6.docx
Student Lab Activity A. Lab # CIS CIS170A-A1B. Lab 6.docxStudent Lab Activity A. Lab # CIS CIS170A-A1B. Lab 6.docx
Student Lab Activity A. Lab # CIS CIS170A-A1B. Lab 6.docx
 
Question 1 briefly respond to all the following questions. make
Question 1 briefly respond to all the following questions. make Question 1 briefly respond to all the following questions. make
Question 1 briefly respond to all the following questions. make
 
1 Project 2 Introduction - the SeaPort Project seri.docx
1  Project 2 Introduction - the SeaPort Project seri.docx1  Project 2 Introduction - the SeaPort Project seri.docx
1 Project 2 Introduction - the SeaPort Project seri.docx
 
Cmis 102 Effective Communication / snaptutorial.com
Cmis 102  Effective Communication / snaptutorial.comCmis 102  Effective Communication / snaptutorial.com
Cmis 102 Effective Communication / snaptutorial.com
 
Educational Objectives After successfully completing this assignmen.pdf
Educational Objectives After successfully completing this assignmen.pdfEducational Objectives After successfully completing this assignmen.pdf
Educational Objectives After successfully completing this assignmen.pdf
 
Comp 220 ilab 6 of 7
Comp 220 ilab 6 of 7Comp 220 ilab 6 of 7
Comp 220 ilab 6 of 7
 
Comp 220 ilab 7 of 7
Comp 220 ilab 7 of 7Comp 220 ilab 7 of 7
Comp 220 ilab 7 of 7
 
Oopp Lab Work
Oopp Lab WorkOopp Lab Work
Oopp Lab Work
 
The Lab assignment will be graded out of 100 points.  There are .docx
The Lab assignment will be graded out of 100 points.  There are .docxThe Lab assignment will be graded out of 100 points.  There are .docx
The Lab assignment will be graded out of 100 points.  There are .docx
 
Comp 220 ilab 7 of 7
Comp 220 ilab 7 of 7Comp 220 ilab 7 of 7
Comp 220 ilab 7 of 7
 
Cmis 102 Success Begins / snaptutorial.com
Cmis 102 Success Begins / snaptutorial.comCmis 102 Success Begins / snaptutorial.com
Cmis 102 Success Begins / snaptutorial.com
 
Cmis 102 Enthusiastic Study / snaptutorial.com
Cmis 102 Enthusiastic Study / snaptutorial.comCmis 102 Enthusiastic Study / snaptutorial.com
Cmis 102 Enthusiastic Study / snaptutorial.com
 
Computer science sqp
Computer science sqpComputer science sqp
Computer science sqp
 
Bcsl 031 solve assignment
Bcsl 031 solve assignmentBcsl 031 solve assignment
Bcsl 031 solve assignment
 
Comp 220 ilab 7 of 7
Comp 220 ilab 7 of 7Comp 220 ilab 7 of 7
Comp 220 ilab 7 of 7
 
IP Lab Manual for Kerala University 3 Year UG Programme
IP Lab Manual for Kerala University 3 Year UG ProgrammeIP Lab Manual for Kerala University 3 Year UG Programme
IP Lab Manual for Kerala University 3 Year UG Programme
 

More from gidmanmary

Using C#, write a program to find the nearest common parent of any t.docx
Using C#, write a program to find the nearest common parent of any t.docxUsing C#, write a program to find the nearest common parent of any t.docx
Using C#, write a program to find the nearest common parent of any t.docx
gidmanmary
 
Using autoethnography in a qualitative research,consider a resid.docx
Using autoethnography in a qualitative research,consider a resid.docxUsing autoethnography in a qualitative research,consider a resid.docx
Using autoethnography in a qualitative research,consider a resid.docx
gidmanmary
 
Using Earned Value to Determine StatusJennifer turned in her statu.docx
Using Earned Value to Determine StatusJennifer turned in her statu.docxUsing Earned Value to Determine StatusJennifer turned in her statu.docx
Using Earned Value to Determine StatusJennifer turned in her statu.docx
gidmanmary
 
Using at least your textbook and a minimum of three additional sourc.docx
Using at least your textbook and a minimum of three additional sourc.docxUsing at least your textbook and a minimum of three additional sourc.docx
Using at least your textbook and a minimum of three additional sourc.docx
gidmanmary
 
Using APA style format, write a 4-5 page paper describing the provis.docx
Using APA style format, write a 4-5 page paper describing the provis.docxUsing APA style format, write a 4-5 page paper describing the provis.docx
Using APA style format, write a 4-5 page paper describing the provis.docx
gidmanmary
 
Use the organization you selected in Week One and the Security Ass.docx
Use the organization you selected in Week One and the Security Ass.docxUse the organization you selected in Week One and the Security Ass.docx
Use the organization you selected in Week One and the Security Ass.docx
gidmanmary
 
Using DuPont analysis is a quick and relatively easy way to assess t.docx
Using DuPont analysis is a quick and relatively easy way to assess t.docxUsing DuPont analysis is a quick and relatively easy way to assess t.docx
Using DuPont analysis is a quick and relatively easy way to assess t.docx
gidmanmary
 
Using APA style, prepare written research paper of 4 double spaced p.docx
Using APA style, prepare written research paper of 4 double spaced p.docxUsing APA style, prepare written research paper of 4 double spaced p.docx
Using APA style, prepare written research paper of 4 double spaced p.docx
gidmanmary
 
Use the organization selected for your Managing Change Paper Part .docx
Use the organization selected for your Managing Change Paper Part .docxUse the organization selected for your Managing Change Paper Part .docx
Use the organization selected for your Managing Change Paper Part .docx
gidmanmary
 
Use your knowledge to develop the circumstances and details involved.docx
Use your knowledge to develop the circumstances and details involved.docxUse your knowledge to develop the circumstances and details involved.docx
Use your knowledge to develop the circumstances and details involved.docx
gidmanmary
 
Use the percentage method to compute the federal income taxes to w.docx
Use the percentage method to compute the federal income taxes to w.docxUse the percentage method to compute the federal income taxes to w.docx
Use the percentage method to compute the federal income taxes to w.docx
gidmanmary
 
Use the textbook andor online sources to locate and capture three w.docx
Use the textbook andor online sources to locate and capture three w.docxUse the textbook andor online sources to locate and capture three w.docx
Use the textbook andor online sources to locate and capture three w.docx
gidmanmary
 
Use the Web to conduct research on User Domain Security Policy and A.docx
Use the Web to conduct research on User Domain Security Policy and A.docxUse the Web to conduct research on User Domain Security Policy and A.docx
Use the Web to conduct research on User Domain Security Policy and A.docx
gidmanmary
 
Use this Article to create the powerpoint slidesBrown, S. L., No.docx
Use this Article to create the powerpoint slidesBrown, S. L., No.docxUse this Article to create the powerpoint slidesBrown, S. L., No.docx
Use this Article to create the powerpoint slidesBrown, S. L., No.docx
gidmanmary
 
use the work sheet format made available  but only to give brief, bu.docx
use the work sheet format made available  but only to give brief, bu.docxuse the work sheet format made available  but only to give brief, bu.docx
use the work sheet format made available  but only to give brief, bu.docx
gidmanmary
 
Use these three sources to compose an annotated bibliography on Data.docx
Use these three sources to compose an annotated bibliography on Data.docxUse these three sources to compose an annotated bibliography on Data.docx
Use these three sources to compose an annotated bibliography on Data.docx
gidmanmary
 
Use this outline to crete a four page essay. Guideline included and .docx
Use this outline to crete a four page essay. Guideline included and .docxUse this outline to crete a four page essay. Guideline included and .docx
Use this outline to crete a four page essay. Guideline included and .docx
gidmanmary
 
Use the link provided to complete a self-assessment. After completin.docx
Use the link provided to complete a self-assessment. After completin.docxUse the link provided to complete a self-assessment. After completin.docx
Use the link provided to complete a self-assessment. After completin.docx
gidmanmary
 
Use the SPSS software and the data set (2004)GSS.SAV (attached).docx
Use the SPSS software and the data set (2004)GSS.SAV (attached).docxUse the SPSS software and the data set (2004)GSS.SAV (attached).docx
Use the SPSS software and the data set (2004)GSS.SAV (attached).docx
gidmanmary
 
Use the Internet to research functional systems that would contain a.docx
Use the Internet to research functional systems that would contain a.docxUse the Internet to research functional systems that would contain a.docx
Use the Internet to research functional systems that would contain a.docx
gidmanmary
 

More from gidmanmary (20)

Using C#, write a program to find the nearest common parent of any t.docx
Using C#, write a program to find the nearest common parent of any t.docxUsing C#, write a program to find the nearest common parent of any t.docx
Using C#, write a program to find the nearest common parent of any t.docx
 
Using autoethnography in a qualitative research,consider a resid.docx
Using autoethnography in a qualitative research,consider a resid.docxUsing autoethnography in a qualitative research,consider a resid.docx
Using autoethnography in a qualitative research,consider a resid.docx
 
Using Earned Value to Determine StatusJennifer turned in her statu.docx
Using Earned Value to Determine StatusJennifer turned in her statu.docxUsing Earned Value to Determine StatusJennifer turned in her statu.docx
Using Earned Value to Determine StatusJennifer turned in her statu.docx
 
Using at least your textbook and a minimum of three additional sourc.docx
Using at least your textbook and a minimum of three additional sourc.docxUsing at least your textbook and a minimum of three additional sourc.docx
Using at least your textbook and a minimum of three additional sourc.docx
 
Using APA style format, write a 4-5 page paper describing the provis.docx
Using APA style format, write a 4-5 page paper describing the provis.docxUsing APA style format, write a 4-5 page paper describing the provis.docx
Using APA style format, write a 4-5 page paper describing the provis.docx
 
Use the organization you selected in Week One and the Security Ass.docx
Use the organization you selected in Week One and the Security Ass.docxUse the organization you selected in Week One and the Security Ass.docx
Use the organization you selected in Week One and the Security Ass.docx
 
Using DuPont analysis is a quick and relatively easy way to assess t.docx
Using DuPont analysis is a quick and relatively easy way to assess t.docxUsing DuPont analysis is a quick and relatively easy way to assess t.docx
Using DuPont analysis is a quick and relatively easy way to assess t.docx
 
Using APA style, prepare written research paper of 4 double spaced p.docx
Using APA style, prepare written research paper of 4 double spaced p.docxUsing APA style, prepare written research paper of 4 double spaced p.docx
Using APA style, prepare written research paper of 4 double spaced p.docx
 
Use the organization selected for your Managing Change Paper Part .docx
Use the organization selected for your Managing Change Paper Part .docxUse the organization selected for your Managing Change Paper Part .docx
Use the organization selected for your Managing Change Paper Part .docx
 
Use your knowledge to develop the circumstances and details involved.docx
Use your knowledge to develop the circumstances and details involved.docxUse your knowledge to develop the circumstances and details involved.docx
Use your knowledge to develop the circumstances and details involved.docx
 
Use the percentage method to compute the federal income taxes to w.docx
Use the percentage method to compute the federal income taxes to w.docxUse the percentage method to compute the federal income taxes to w.docx
Use the percentage method to compute the federal income taxes to w.docx
 
Use the textbook andor online sources to locate and capture three w.docx
Use the textbook andor online sources to locate and capture three w.docxUse the textbook andor online sources to locate and capture three w.docx
Use the textbook andor online sources to locate and capture three w.docx
 
Use the Web to conduct research on User Domain Security Policy and A.docx
Use the Web to conduct research on User Domain Security Policy and A.docxUse the Web to conduct research on User Domain Security Policy and A.docx
Use the Web to conduct research on User Domain Security Policy and A.docx
 
Use this Article to create the powerpoint slidesBrown, S. L., No.docx
Use this Article to create the powerpoint slidesBrown, S. L., No.docxUse this Article to create the powerpoint slidesBrown, S. L., No.docx
Use this Article to create the powerpoint slidesBrown, S. L., No.docx
 
use the work sheet format made available  but only to give brief, bu.docx
use the work sheet format made available  but only to give brief, bu.docxuse the work sheet format made available  but only to give brief, bu.docx
use the work sheet format made available  but only to give brief, bu.docx
 
Use these three sources to compose an annotated bibliography on Data.docx
Use these three sources to compose an annotated bibliography on Data.docxUse these three sources to compose an annotated bibliography on Data.docx
Use these three sources to compose an annotated bibliography on Data.docx
 
Use this outline to crete a four page essay. Guideline included and .docx
Use this outline to crete a four page essay. Guideline included and .docxUse this outline to crete a four page essay. Guideline included and .docx
Use this outline to crete a four page essay. Guideline included and .docx
 
Use the link provided to complete a self-assessment. After completin.docx
Use the link provided to complete a self-assessment. After completin.docxUse the link provided to complete a self-assessment. After completin.docx
Use the link provided to complete a self-assessment. After completin.docx
 
Use the SPSS software and the data set (2004)GSS.SAV (attached).docx
Use the SPSS software and the data set (2004)GSS.SAV (attached).docxUse the SPSS software and the data set (2004)GSS.SAV (attached).docx
Use the SPSS software and the data set (2004)GSS.SAV (attached).docx
 
Use the Internet to research functional systems that would contain a.docx
Use the Internet to research functional systems that would contain a.docxUse the Internet to research functional systems that would contain a.docx
Use the Internet to research functional systems that would contain a.docx
 

Recently uploaded

Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 

Recently uploaded (20)

Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 

EN3085 Assessed Coursework 1 1. Create a class Complex .docx

  • 1. EN3085 Assessed Coursework 1 1. Create a class Complex to allow programmers the easy use of complex numbers in their programs. An object of that class should: [5] a. Be able to store a complex number in the most efficient way. b. Make use of constructor and destructor functions if needed. The constructor should take three arguments: a character indicating if the last two arguments should be interpreted as real and imaginary parts or magnitude and angle, and two real numbers defining the value of the complex number. The constructor should also initialise the members of the object appropriately, including for cases when it receives only some or no arguments. c. Be able to return individual element of the complex number in both rectangular (real and imaginary) and polar form (magnitude and angle). d. Allow modification of the stored complex number by enabling the modification of individual elements of the complex number (both in rectangular and polar form).
  • 2. e. Include a function to print on the screen the complex number, either in rectangular or polar form. 2. Create a function GetComplexListFromFile, that: [2] a. Reads all complex numbers recorded in a text file. Each data line in the text file always consist of one of the following, to define a complex number: • a letter ‘p’ followed by a magnitude and an angle (in radians), all separated by a space. • a letter ‘r’ followed by the real and imaginary parts, all separated by a space. b. Creates for each of them an object of type Complex. c. Stores each created Complex object in a vector to obtain a list of all complex number defined in the file. d. Returns the resulting vector to the function call location. 3. Create a function SaveComplexListToFile that saves a provided list of Complex objects into a text file, using the same text file format mentioned in question 2.a. [2] 4. Using the Complex class and the functions developed previously, write a main function which will in the order provided below: [2] a. Stores in a vector ComplexList all complex number stored in the provided file "ComplexList.txt". b. Prints on the screen, in both rectangular and polar forms, all complex numbers stored in ComplexList. c. Keeps asking on the screen if the user wants to add a complex number to the list and if so asks for the relevant information and stores the provided new complex
  • 3. number in the vector ComplexList. d. Saves all the object stored in ComplexList in the file "ComplexList.txt". 5. Expand the class Complex with the following overloaded member operators: binary operators "+", "-", "*", and "/" and a unary operator "-". [4] The operators should return complex numbers only in rectangular form and provide the standard functionality for arithmetic operations on complex numbers. Using these operators, in the main function: a. Calculate the sum of all complex number stored in the vector ComplexList, after the reading of the file "ComplexList.txt" and after the user has provided additional complex numbers. b. Demonstrate the use of all operators using the following equation: A= - B*(C-D)/E A, B, C, D and E, being the 5 first complex number provided in the file "ComplexList.txt". c. Print on the screen the complex number resulting from the equation above in both rectangular and polar form. When relevant you should make use of all the “best practice” and concepts covered in the lecture (e.g. inline, const…). r Ɵ
  • 4. a b Standard form: a + b.i Im Re Polar form: r (cos Ө + i sin Ө) Submission Procedure You should solve the problems independently from other students and submit only your own work. Submit your solution on “learning central” using the Coursework Answer Sheet provided by 18:00, Friday 27/03/2020 (week 9). In section one of the Coursework Answer Sheet, explain briefly the structure of your class in terms of memory usage and “user friendliness”, how you tested it and any identified issues. Then, directly from Microsoft Visual C++, copy and paste all your code in the relevant section of the Coursework Answer Sheet. Add a screen shot of the window showing what is printed on the screen when running your program (for example using Microsoft Snipping Tool). All developed code should be included in the 3 files provided:
  • 5. Complex.h, Complex.cpp and Main.cpp and these 3 completed files should also be uploaded on “learning central” together with the Coursework Answer Sheet to facilitate our testing of your program. Any incomplete submission will be considered late. Marking scheme Source code. Maximum marks will be awarded for: • A correctly functioning program. The program should operate according to the specification. • An efficient program and elegant algorithms. Try to develop algorithms, which are efficient in terms of the amount of data, which needs to be stored (e.g. minimum number of variables used), and the speed in which they operate. • Appropriate use of classes and functions. Try to keep your function main() as short as possible. • A user-friendly program. When your program runs, the messages displayed on the screen should be easy to understand and succinct. The user should be in no doubt as to what they must do to use the program. • A well commented program. The judicious use of commenting is essential if somebody else is to easily understand your program. Start your programs with a short comment specifying the name of the program, your name, and what your
  • 6. program is designed to do. Supply your functions with pre- and post-conditions. • A well laid out program. Indent your program code. Indent your comments as well. Use blank lines to space out blocks of code. EN3085 Assessed Coursework 1Submission ProcedureMarking scheme #include "complex.h" p 10 0.5 r 12 14 p 25 1 p 100. 0.80 r 50. 50. p 20 3.14 r -100. 25 p 12 1.14