2.1. What is the effect of the following statements? If a statement is invalid, explain why it is invalid. The classes stackADT, stackType, and linkedStackType are as defined in this chapter.
2.1.1. stackADT<int> newStack;
2.1.2. stackType<double> sales(-10);
2.1.3. stackType<string> names;
2.1.4. linkedStackType<int> numStack(50);
1
Expert's answer
2015-05-07T03:15:49-0400
Answer on Question# 52467, Programming, C++2.1. Whatis the effect of the following statements? If a statement is invalid, explain why it is invalid. The classes stackADT, stackType, and linkedStackType are as defined in this chapter. 2.1.1.stackADT<int> newStack; 2.1.2.stackType<double> sales(-10); 2.1.3.stackType<string> names; 2.1.4. linkedStackType<int>numStack(50). Answer: 2.1.1. stackADT<int> newStack – is notvalid since stackADT is abstract class, so we can use only some implementation of this abstract class.
2.1.2. stackType<double> sales(-10); -create stack size 100, since exist one constructor with parameter, but this parameter must be positive (otherwise set size to value 100).
2.1.3. stackType<string> names; - createstack of string’s elements, size of stack 100, since class have owner constructor with default value of elements 100.
2.1.4. linkedStackType<int> numStack(50)– create linked stack with number of integer elements is 50.
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment