subject

Consider the following class declaration. Class Customer fails to effectively encapsulate a data member, thereby risking a run-time error due to corrupted data. Using C++, locate the problem(s) and to complete the class to keep track of total year-to-date purchases. If an item to be purchased costs more than the customer’s credit limit, do not allow the sale. Declare and define data fields, accessors, and mutators which will keep track of the total number of sales and total sales for each instance of Customer. Use the filename customer. h, customer. cpp and customerDemo. cpp for your programs. class Customer{public:Customer(string name, string address, string city, string state, string zipcode);void increase_limit(double amount);string get_name() const;string get_address() const;string get_city() const;string get_state() const;double credit_limit;private:string name;string address;string city;string state;string zipcode;}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 21:30
Write code using c . (take input from user) calculate the size of a given file in kbs. in this task you will complete the function with the following prototype: float get_file_size(char * filename); the function takes the file name (address to the start of a null terminated character array) as input. the function should then open the file and find the number of bytes it contains till eof. the number of bytes divided by 1024 will give the size in kbs. if the file cannot be opened the function should return -1.
Answers: 2
question
Computers and Technology, 22.06.2019 16:30
Corey set up his presentation for delivery to his team.the information he had to convey was critical to their job performance.he knew he would need a lot of time to explain each point
Answers: 3
question
Computers and Technology, 23.06.2019 01:30
Which tab is used to change the theme of a photo album slide show? a. design b. view c. transitions d. home
Answers: 1
question
Computers and Technology, 23.06.2019 19:30
Amitha writes up a one-page summary of a novel during her summer internship at a publishing company. when she reads over the page, she realizes she used the word “foreshadow” seven times, and she would like to reduce the repetition. which tool would best amitha solve this problem?
Answers: 3
You know the right answer?
Consider the following class declaration. Class Customer fails to effectively encapsulate a data mem...
Questions
question
History, 03.06.2020 04:58
question
Mathematics, 03.06.2020 04:59