How many syntax errors in the following code? Assume all libraries are including

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter11: Inheritance And Composition
Section: Chapter Questions
Problem 5PE: Using classes, design an online address book to keep track of the names, addresses, phone numbers,...
icon
Related questions
Question
4) How many syntax errors in the following code? Assume all libraries are
including
#include <iostream>
using namespace std;
class ShapeType {
protected:
double length, width;
void setDimension (double L, double w) { length = L; width = w; }void print() {};;
};
class rectangleType :protected ShapeType
{
private:
public:
};
double length, width;
rectangleType() { length = 0; width = 0; }rectangleType(double L, double w) {
setDimension (L, w); }
void setDimension (double L, double w) { length = L; width = w; }
double getLength() { return length; }
double getwidth() { return width; }
double area() { return length width; }
double perimeter() { return 2* (length + width); }
void print() {
ShapeType: :print();
}
Your answer:
5) How many true statement(s) among the following?
Comm
A. Templates in C++ are commonly used to repeat code by generating a
set of classes and functions
B. Friend functions are member functions that have the right to access
public and protected member functions.
C. The process of overloading an operating in C++ MUST include writing
a function
D. Overloading an operator is commonly used to change its precedence
E. It is possible to create new operators in C++
F. We can override built-in type operators in C++
6) How many false statement(s) among the following?
A. Set in STL is an associate container for storing unique values and
allows rapid lookup
101101
010101011
B. Keys in STL's map are unique
C. We give the highest priority to the first element in the STL's priority
queue
D. Recursion in C++ allows functions to be calling themselves directly or
indirectly and provide an elegant way to define functions
E. Memory addresses store integers that can point other integers
F. Overloading the [] operator requires that the function is a member of
the class
Transcribed Image Text:4) How many syntax errors in the following code? Assume all libraries are including #include <iostream> using namespace std; class ShapeType { protected: double length, width; void setDimension (double L, double w) { length = L; width = w; }void print() {};; }; class rectangleType :protected ShapeType { private: public: }; double length, width; rectangleType() { length = 0; width = 0; }rectangleType(double L, double w) { setDimension (L, w); } void setDimension (double L, double w) { length = L; width = w; } double getLength() { return length; } double getwidth() { return width; } double area() { return length width; } double perimeter() { return 2* (length + width); } void print() { ShapeType: :print(); } Your answer: 5) How many true statement(s) among the following? Comm A. Templates in C++ are commonly used to repeat code by generating a set of classes and functions B. Friend functions are member functions that have the right to access public and protected member functions. C. The process of overloading an operating in C++ MUST include writing a function D. Overloading an operator is commonly used to change its precedence E. It is possible to create new operators in C++ F. We can override built-in type operators in C++ 6) How many false statement(s) among the following? A. Set in STL is an associate container for storing unique values and allows rapid lookup 101101 010101011 B. Keys in STL's map are unique C. We give the highest priority to the first element in the STL's priority queue D. Recursion in C++ allows functions to be calling themselves directly or indirectly and provide an elegant way to define functions E. Memory addresses store integers that can point other integers F. Overloading the [] operator requires that the function is a member of the class
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Lock objects
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning