1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Elina [12.6K]
4 years ago
8

Create two classes. The first, named Sale, holds data for a sales transaction. Its private data members include the day of the m

onth, 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.Sample Run
Sale #103 on 12/25/2016 for $559.95 sold by #103 Woods
Sale #106 on 11/15/2016 for $359.95 sold by #106 Hansen
Computers and Technology
1 answer:
olya-2409 [2.1K]4 years ago
4 0

Answer:

A C++ program was used in creating two classes. the code is stated below.

Explanation:

Solution

The C++ program is executed below:

#include<iostream>

using namespace std;

//declare class (will be define later)

class Salesperson;

//class Sale

class Sale

{

  //private members of class

  private:

      string day;

      double amtOfSale;

      int salesPersonId;

 //public methods

  public:

      //constructor that takes day,amount of sale and salesPersonId as parameters

      Sale(string date,double sale,int id)

      {

          //set the private members to the initial values passed

          day=date;

          amtOfSale=sale;

          salesPersonId=id;

      }    

      //declare a friend function that takes objects of the two classes as parameters

      friend void display(Sale,Salesperson);

};  

//define class Salesperson

class Salesperson

{

  //private members of the class

  private:

      int salesPersonId;

      string lastName;    

  //public methods

  public:

      //constructor that takes name and id as parameters

      Salesperson(int id,string name)

      {

          //set the members of the class with the parameters passed

          salesPersonId=id;

          lastName=name;

      }  

      //declare a friend function that takes objects of the two classes as parameters

      friend void display(Sale,Salesperson);

};

//define the friend funtion

void display(Sale saleObj,Salesperson personObj)

{

  //display the sales info using the objects of the two classes

  cout<<"\nSale #"<<saleObj.salesPersonId<<" on "<<saleObj.day<<" for $"<<saleObj.amtOfSale<<" sold by #"<<personObj.salesPersonId<<" "<<personObj.lastName;

}  

int main()

{

  //create object for Sale class and pass default values

  Sale sObj1("12/25/2016",559.95,103);

  //create object for Salesperson class and pass default values

  Salesperson pObj1(103,"Woods");

 

  //create another object for Sale class and pass default values

  Sale sObj2("11/15/2016",359.95,106);

  //create another object for Salesperson class and pass default values

  Salesperson pObj2(106,"Hansen");

  //using the friend function dislay the sales info

  display(sObj1,pObj1);

  display(sObj2,pObj2);

  return 0;

}

You might be interested in
Draw the 2-3 tree that results when you insert the keys E A S Y Q U T I O N in that order into an initially empty tree
mr_godi [17]

Answer:

If its any easy question, answer it yourself.

Explanation:

:)

6 0
3 years ago
Jane, an employee in the human resources department, has created several important PDF documents on her computer that all office
Colt1911 [192]

Answer:

Share documents and set specific permissions.

Explanation:

For a computer network with Windows OS Jane and the technician can create a Shared Folder by right-clicking on it and selecting properties.

Then on the Share and Security tabs of the properties, they can set which specific users and/or roles will have access to the shared folder. They will also have to set what permission level will be granted, such as <em>full access, read only, etc.</em>

The managers can access the shared files using <em>Windows explorer</em> either by searching shared folders in their Network, or by typing the shared folder address usually something like \\JANE_PC/SharedFolder.

6 0
3 years ago
Read 2 more answers
What do GUI use except​
gregori [183]

Answer:

Lol this is your first question.

Explanation:

This is so easy how is this even a question

4 0
3 years ago
FIrst person to put lyrics to wap gets brainliest 100% NO CAP
Firdavs [7]

Answer:

i got u

Explanation:

****** in this house

There's some ****** in this house

There's some ****** in this house

There's some ****** in this house (Hol' up)

I said certified freak, seven days a week

Wet and gushy, make that pullout game weak, woo (Ah)

[Chorus: Cardi B]

Yeah, yeah, yeah, yeah

Yeah, you dealin' with some wet and gushy

Bring a bucket and a mop for this wet and gushy

Give me everything you got for this wet and gushy

[Verse 1: Cardi B & Megan Thee Stallion]

Beat it up, baby, catch a charge

Extra large and extra hard

Put this cookie right in your face

Swipe your nose like a credit card

Hop on top, I wanna ride

I do a kegel, I'm kinda wild

Look at my mouth, look at my thighs

This water is wet, come take a dive

Tie me up like I'm surprised

Let's roleplay, I'll wear a disguise

I want you to park that big Mack truck right in this little garage

Make me dream, make a stream

Out in public, make a scene

I don't cook, I don't clean

But let me tell you how I got this ring (Ayy, ayy)

5 0
3 years ago
Explain the importance of signaling in the telephone network.
k0ka [10]

Answer: Please see below as the answer is self-explanatory

Explanation:

In a telephone system, we call signaling to all signals that are originated within a telephony circuit, that are not part of the conversation between the calling parties.

We include in this broad category, the signal generated by the calling party when he picks up the phone, the call tone sent to him by the switch (or the busy tone if the call can't be established due to blocking), the digits that identify the called party, the ringing signal that informs the called party that someone is trying to reach him for a call, among others like are defined in the SS7 or the different 2G/3G/4G Cellular standards.

The importance of the signalling is pretty obvious; without these signals, it will be virtually impossible to set up a connection between the two parties.

8 0
4 years ago
Other questions:
  • Operating systems the most common form Microsoft windows in Mac OS discuss the similarities and differences between which two sy
    13·1 answer
  • Hi hehehehehehehehehheeheh<br>​
    10·1 answer
  • Ted is looking for a reliable source for his paper. Which of the following sites would be considered reliable?
    5·1 answer
  • Definition: This modern-day country was one of the most advanced ancient civilizations. Human
    8·1 answer
  • PLS HELP For this activity, you can use the audio recorder on your cell phone or a digital camera to record the following sounds
    14·1 answer
  • What is being identified when antibodies stick to pathogens during immunostaining?
    11·1 answer
  • 2. How is accessing the Internet through a home network and public Wi-Fi similar?​
    15·1 answer
  • When a laptop internal device fails, what three options can you use to deal with the problem?
    7·1 answer
  • The platform in E-Learning refers to:
    9·1 answer
  • Chloe is not pleased with how four images that she has placed on a web page relate to each other. Which search string will be mo
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!