Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program to load a vector with 50 random integers between the numbers 0-49. Once the vector is loaded, display a report of how

image text in transcribed

Write a program to load a vector with 50 random integers between the numbers 0-49. Once the vector is loaded, display a report of how many numbers are in the range 0-9, 10-19, 20-29, 30-39, and 40-49. [8 marks] 3. You have a class called "Customer" which has a number of data members (m_nID, m sName, m nPhoneNum) as well as accessor functions for these data members called getID, getName, and getPhoneNum. The constructor for the class accepts two integers and a string to set the values of these data members. 4. Using C++ code, declare a vector to hold pointers to Customer objects and create 3 customers in the vector. Write code to display a report of the customers stored in the vector. Finally, write code to delete the customers appropriately for when the program ends. [8 marks] 5. The company that utilises the Customer class as described above has now added a new tier of customer, a Gold Customer, that has the same attributes, but lso has a number of other attributes. These include they number of years they have been a member, and a discount rate that the customer now gets on all purchases. Write a class that inherits from the Customer class that adds these data members as wll as a function that can get the discount rate. Your constructor should set the initial values to 1 year of membership and a 10% discount rate. that it can hold and work with both normal customers and gold customers. [10 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

Practical Azure SQL Database For Modern Developers Building Applications In The Microsoft Cloud

Authors: Davide Mauri, Silvano Coriani, Anna Hoffma, Sanjay Mishra, Jovan Popovic

1st Edition

1484263693, 978-1484263693

More Books

Students also viewed these Databases questions

Question

1. Identify and control your anxieties

Answered: 1 week ago