Answered step by step
Verified Expert Solution
Question
1 Approved Answer
7 3. a) Explain the difference between a vector and a list? Give an example of a situation where a list is more suitable than
7 3. a) Explain the difference between a vector and a list? Give an example of a situation where a list is more suitable than a vector in a code. What is the main disadvantage of using a list over a vector? (No code is required). 30 b) From basic datatypes, create a class Sphere and a class Cube, which are used to describe geometrical shapes to be used in a CAD programme. The following code from the main function will be run to test your code. The comment in every line explains the used function or operator, etc. Cube Cubel; // Initialising a cube with side length of 1 Sphere Sph1(5); // Initialising a sphere with radius 5 Cube1.setSide(5); // changes the side length of Cube1 to 5 cout
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started