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;
}
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.
Can you please help me print columns for my C++ project? I'd like the print-out to...
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...
Write in C++ 1. Use the following Person class (Person.cpp, Person.h). You will be writing Person objects to a random access file. --------------------- Person.cpp--------------------------------- // Class Person stores customer's credit information. #include <string> #include "Person.h" using namespace std; // default Person constructor Person::Person( int idValue, string lastNameValue, string firstNameValue, int AgeValue ) { setID( idValue ); setLastName( lastNameValue ); setFirstName( firstNameValue ); setAge( AgeValue ); } // end Person constructor // get id value int Person::getID() const { return id;...
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 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...
Purpose This assignment is an exercise in implementing the Stack ADT using a dynamically-allocated array, as well as techniques for managing dynamically-allocated storage in C++. Assignment In this assignment, you will write a class called Stack that will encapsulate a dynamically-allocated array of elements of a generic data type. A driver program is provided for this assignment to test your implementation. You don't have to write the tests. Program You will need to write a single template class for this...
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 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...
This small project is geared to get you started on writing Object Oriented program using either Java or C++. Create a class called Person that will hold information about a single individual. This class should have a data section that consists of the following: Variable Name Data Type firstName string lastName string address string The Person class should have the following mutators: setFirstName(string first); setLastName(string last); setAddress(string address); The Person class should have the following accessors: string getFirstName(); string getLastName();...
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 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...