Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

hi please help me with both questions 5. The following UML diagram describes a class template AnyType. T : class AnyType description : string -

hi please help me with both questions

image text in transcribed
5. The following UML diagram describes a class template AnyType. T : class AnyType description : string - isPrimitive : bool - isNumeric : bool value T + AnyType ( descriptn : string, isPrimi : bool, isNum : bool, aValue toString () : string Write the declaration for the class. (Note : all constructors and functions must be accessible to all other objects / code, while the attributes can only be accessed by AnyType itself!) (3 marks) b) With reference to the class template in part a) above, write a complete main ( ) program to: instantiate a AnyType object with a double value 338 . 168, the description to "double", and both boolean variables (isNumeric, isPrimitive) to true, and ... invoke the method to display its contents to the terminal (3 marks) 6, Write a complete main () program that does the following: a) Instantiate a default_random_engine object called 'randobj'. Declare a vector named 'intVec', and (using randobj ) , initializes intVec with 5500 random integer values. b) Using reverse iterator, print out all even numbers contained in intVec. c) Using iterator, together with the generic algorithm 'find', print out "Value found!!", if intVec stores a particular value: 16807. (9 marks)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

Students also viewed these Programming questions

Question

What is the displacement method?

Answered: 1 week ago