Consider the following two program segments: $1 and 52 St: Base class class rational [ error() [ cout <

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Consider the following two program segments: $1 and 52 St: Base class class rational [ error() [ cout <

Post by answerhappygod »

Consider The Following Two Program Segments 1 And 52 St Base Class Class Rational Error Cout Name Endt 1
Consider The Following Two Program Segments 1 And 52 St Base Class Class Rational Error Cout Name Endt 1 (22.83 KiB) Viewed 10 times
Consider the following two program segments: $1 and 52 St: Base class class rational [ error() [ cout <<name() << endt) string name() { return "Rational R}} Derived class: class complex rational [ string name() { return Complex - rational A: complex B; S2 Same as St, but name is defined as: virtual string name() { return "Rational":] What is the correct answer: ? O a Considering St, A.error() <= error will call name() in rational and Berror() error will call name()in rational b. Considering S2: A.error() error will call name() in rational and Berror will call name in complex O c. a and b Ⓒd. in S1 and 52, if error is called Rational is always printed Ⓒe none of the mentioned
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply