Alpha Geek

(8)

$10/per page/Negotiable

About Alpha Geek

Levels Tought:
University

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Environmental science,Essay writing,Programming,Social Science,Statistics Hide all
Teaching Since: Apr 2017
Last Sign in: 438 Weeks Ago, 1 Day Ago
Questions Answered: 9562
Tutorials Posted: 9559

Education

  • bachelor in business administration
    Polytechnic State University Sanluis
    Jan-2006 - Nov-2010

  • CPA
    Polytechnic State University
    Jan-2012 - Nov-2016

Experience

  • Professor
    Harvard Square Academy (HS2)
    Mar-2012 - Present

Category > Computer Science Posted 29 Apr 2017 My Price 8.00

Create two classes.

a. Create two classes. The first, named Sale, holds data for a sales transaction. Its private data members include the day of the month, amount of the sale, and the salesperson’s ID number. The second class, named Salesperson, holds data for a salesperson, and its private data members include each salesperson’s ID number and last name. Each class includes a constructor to which you can pass the field values. Create a friend function named display()that is a friend of both classes and displays the date of sale, the amount, and the salesperson ID and name. Write a short main()demonstration program to test your classes and friend function. Save the file as Sales.cpp.

b. Add a function to both the Sale and Salesperson classes that returns the private salesperson ID number. Write a main()function that contains an array of five Salesperson objects and store appropriate data in it. Then, continue to prompt the user for Sale data until the user enters an appropriate sentinel value. For each Sale transaction entered, determine whether the salesperson’s ID number is valid. Either display an error message, or use the friend display()function to display all the data. Save the file as Sales2.cpp.

 

 

Answers

(8)
Status NEW Posted 29 Apr 2017 09:04 AM My Price 8.00

-----------

Attachments

file 1493459977-Answer.docx preview (383 words )
a-----------. C-----------rea-----------te -----------two----------- cl-----------ass-----------es.----------- Th-----------e f-----------irs-----------t, -----------nam-----------ed -----------Sal-----------e, -----------hol-----------ds -----------dat-----------a f-----------or -----------a s-----------ale-----------s t-----------ran-----------sac-----------tio-----------n. -----------Its----------- pr-----------iva-----------te -----------dat-----------a m-----------emb-----------ers----------- in-----------clu-----------de -----------the----------- da-----------y o-----------f t-----------he -----------mon-----------th,----------- am-----------oun-----------t o-----------f t-----------he -----------sal-----------e, -----------and----------- th-----------e s-----------ale-----------spe-----------rso-----------nâ€-----------™s -----------ID -----------num-----------ber-----------. T-----------he -----------sec-----------ond----------- cl-----------ass-----------, n-----------ame-----------d S-----------ale-----------spe-----------rso-----------n, -----------hol-----------ds -----------dat-----------a f-----------or -----------a s-----------ale-----------spe-----------rso-----------n, -----------and----------- it-----------s p-----------riv-----------ate----------- da-----------ta -----------mem-----------ber-----------s i-----------ncl-----------ude----------- ea-----------ch -----------sal-----------esp-----------ers-----------onâ-----------€™s----------- ID----------- nu-----------mbe-----------r a-----------nd -----------las-----------t n-----------ame-----------. E-----------ach----------- cl-----------ass----------- in-----------clu-----------des----------- a -----------con-----------str-----------uct-----------or -----------to -----------whi-----------ch -----------you----------- ca-----------n p-----------ass----------- th-----------e f-----------iel-----------d v-----------alu-----------es.----------- Cr-----------eat-----------e a----------- fr-----------ien-----------d
Not Rated(0)