Question

Can you please help me print columns for my C++ project? I'd like the print-out to...

Can you please help me print columns for my C++ project? I'd like the print-out to have 3 columns to line up with of 1) First Name & Last Name 2) ID # and 3) Sales total

I've attached the code below. Thank you in advance for your help.

Seller::Seller()

{

setFirstName("None");

setLastName("None");

setID("ZZZ000");

setSalesTotal(0);

}Seller::Seller(char first[],char last[],char id[],double sales)

{

setFirstName(first);

setLastName(last);

setID(id);

setSalesTotal(sales);

}

/*

Method: void setSalesTotal( double newSalesTotal )

Use: Changes a Seller's sales total

Arguments: A double that represents the Seller's sales total.

Returns: Nothing

*/

double Seller::getSalesTotal()

{

return salesTotal;

}

int main()

{

//5 Seller objects

  

//First Seller: Kelsey Anderson, an id of "CSI240", and a sales total of 1234.56.

Seller S1("Kelsey","Anderson","CSI240",1234.56);

//Second Seller: Created using the default constructor (the one that doesn't take any arguments)

Seller S2;

  

//Third Seller: first name of an empty string (""), a last name of "Johnson", an id of "TOOBIG999", and a sales total 876.34.

Seller S3("","Johnson","TOOBIG999",876.34);

  

//Fourth Seller: name "James Hellwig", an id of "ULTWAR", and a sales total of 13579.11

Seller S4("James","Hellwig","ULTWAR",13579.11);

  

//Fifth Seller: should have the name "Roderick Toombs", an id of "PIPER4", and a sales total of 24680.24

Seller S5("Roderick","Toombs","PIPER4",24680.24);

  

  

//Methods for 5 Seller objects

//First Seller: display the Seller information

cout <<"*** The first Seller object ***" << endl;

S1.print();

  

//For the second Seller, display the Seller information, set the Seller name to "Terry Bollea", set the id number to "HULK96", set the sales total to 246.80, and then display Seller information again

cout <<"\n*** The second Seller object ***" << endl;

S2.print();

//sales total to 246.80, and then display the Seller information once again.

S2.setFirstName("Terry");

S2.setLastName("Bollea");

S2.setID("HULK96");

S2.setSalesTotal(246.80);

S2.print();

  

   //For the third Seller, display the Seller's information, set the Seller's first name to "Dwayne", set the id number to "ROCK89", and then display the Seller information once again.

cout <<"\n*** The third Seller object ***" << endl;

S3.print();

S3.setFirstName("Dwayne");

S3.setID("ROCK89");

S3.print();

  

//For the fourth Seller, display only the Seller's sales total.

cout <<"\n*** The fourth Seller object ***";

cout <<"Sales total is " << S4.getSalesTotal() << endl;

  

//For the fifth Seller, display the Seller's information, set the first name to an empty string (""), set the last name to an empty string,

cout <<"\n*** The fifth Seller object ***" << endl;

S5.print();

S5.setFirstName("");

S5.setLastName("");

  

//set the id number to an empty string, set the sales total to -19.88, and then display the Seller information once again.

S5.setID("");

S5.setSalesTotal(-19.88);

S5.print();

  

return 0;

}

0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
Can you please help me print columns for my C++ project? I'd like the print-out to...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • C++ implement and use the methods for a class called Seller that represents information about a...

    C++ implement and use the methods for a class called Seller that represents information about a salesperson. The Seller class Use the following class definition: class Seller { public: Seller(); Seller( const char [], const char[], const char [], double ); void print(); void setFirstName( const char [] ); void setLastName( const char [] ); void setID( const char [] ); void setSalesTotal( double ); double getSalesTotal(); private: char firstName[20]; char lastName[30]; char ID[7]; double salesTotal; }; Data Members The...

  • using C++ language!! please help me out with this homework In this exercise, you will have...

    using C++ language!! please help me out with this homework In this exercise, you will have to create from scratch and utilize a class called Student1430. Student 1430 has 4 private member attributes: lastName (string) firstName (string) exams (an integer array of fixed size of 4) average (double) Student1430 also has the following member functions: 1. A default constructor, which sets firstName and lastName to empty strings, and all exams and average to 0. 2. A constructor with 3 parameters:...

  • I need to get this two last parts of my project done by tonight. If you...

    I need to get this two last parts of my project done by tonight. If you see something wrong with the current code feel free to fix it. Thank you! Project 3 Description In this project, use project 1 and 2 as a starting point and complete the following tasks. Create a C++ project for a daycare. In this project, create a class called child which is defined as follows: private members: string First name string Last name integer Child...

  • The following C++ code include 3 files: Patient.h, Patient.cpp and Main.cpp. The program basically creates and stores patient records. The original code has everything in a single .cpp file. I tried t...

    The following C++ code include 3 files: Patient.h, Patient.cpp and Main.cpp. The program basically creates and stores patient records. The original code has everything in a single .cpp file. I tried to divide the code in 3 parts (Patient.h, Patient.cpp and Main.cpp), but it is giving me errors. Patient.h #ifndef PATIENT_H #define PATIENT_H #include <string> #include "Patient.cpp" using namespace std; class Patient{ private : string firstname; string lastname; string location; static int cnt; int id; public : Patient(string, string, string);...

  • Hello I need a small fix in my program. I need to display the youngest student...

    Hello I need a small fix in my program. I need to display the youngest student and the average age of all of the students. It is not working Thanks. #include <iostream> #include <iomanip> #include <fstream> #include <vector> #include <algorithm> using namespace std; struct Student { string firstName; char middleName; string lastName; char collegeCode; int locCode; int seqCode; int age; }; struct sort_by_age { inline bool operator() (const Student& s1, const Student& s2) { return (s1.age < s2.age); // sort...

  • hello there. can you please help me to complete this code. thank you. Lab #3 -...

    hello there. can you please help me to complete this code. thank you. Lab #3 - Classes/Constructors Part I - Fill in the missing parts of this code #include<iostream> #include<string> #include<fstream> using namespace std; class classGrades      {      public:            void printlist() const;            void inputGrades(ifstream &);            double returnAvg() const;            void setName(string);            void setNumStudents(int);            classGrades();            classGrades(int);      private:            int gradeList[30];            int numStudents;            string name;      }; int main() {          ...

  • Hello, I need to implement these small things in my C++ code. Thanks. 1- 10 characters...

    Hello, I need to implement these small things in my C++ code. Thanks. 1- 10 characters student first name, 10 characters middle name, 20 characters last name, 9 characters student ID, 3 characters age, in years (3 digits) 2- Open the input file. Check for successful open. If the open failed, display an error message and return with value 1. 3- Use a pointer array to manage all the created student variables.Assume that there will not be more than 99...

  • In this project you will write a C++ program that simulates the purchase of a single...

    In this project you will write a C++ program that simulates the purchase of a single item in an online store. What to do Write a C++ program that: 1. Prints out a welcome message. 2. Prompts the user for the following information: (a) Their first name (example: Roger) (b) Their last name (example: Waters) (c) The name of the product (example: Brick) (d) The unit price of the product (example: 1.99) (e) The quantity to buy (example: 200) (f)...

  • can someone please double check my code here are the requirements please help me fulfill the...

    can someone please double check my code here are the requirements please help me fulfill the requirements Using the material in the textbook (NumberList) as a sample, design your own dynamic linked list class (using pointers) to hold a series of capital letters. The class should have the following member functions: append, insert (at a specific position, return -1 if that position doesn't exist), delete (at a specific position, return -1 if that position doesn't exist), print, reverse (which rearranges...

  • C++ please Let's pretend that we can still go out to eat at a restaurant. Suppose...

    C++ please Let's pretend that we can still go out to eat at a restaurant. Suppose we have the job to make a program that accepts a dinner reservation. The information collected will be the name of the customer, the date for the reservation, the time for the reservation (good choice for a hierarchical struct), the number in the party, email address (for updates) and phone number. Define a hierarchical structure for a dinner reservation that will contain the above...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT