Skip to content
FeatherEssaysFeatherEssays
FeatherEssays
Expert Essay and Academic Writing Services
1-343-433-433-444support@featheressays.com

our-guarantee

  • HOME
  • ABOUT US
  • OUR SERVICES
  • HOW IT WORKS
  • FAQ
  • TESTIMONIALS
  • ORDER A CUSTOM PAPER NOW
  • CONTACT US
  • HOME
  • ABOUT US
  • OUR SERVICES
  • HOW IT WORKS
  • FAQ
  • TESTIMONIALS
  • ORDER A CUSTOM PAPER NOW
  • CONTACT US
July 21, 2017UncategorizedBy classhelp24@gmail.com [email if you need fresh paper done]

Please answer the questions for me using c++ code blocks. The questions are attached below:

Question 1
Consider the following structure used to keep record of a school?s status and details:
struct Status
{
string name; //e.g. Sutherland High School
string address; //e.g. 234 Wierda Road, Eldoraigne, 0149
char level; //primary school ?P? or secondary school ?S?
bool private; //1 if private school, 0 if state school
}
Turn the status struct into a class. The class should have member variables for all
the values
in the corresponding struct. Make all member variables private. Include public
member
functions for each of the following:
a default constructor that sets the string data members to blank strings, char data
members to blank characters and bool member variables to 0;
member functions to set each of the member variables to a value given as an
argument
to the function (i.e. mutators);
member functions to retrieve the data from each of the member variables (i.e.
accessors);
Test the class in a program that instantiates an object of class Status (i.e. ?declare? an
object
of ?type? Status). The program should then input values for the object (obtained from
the
keyboard), and use the mutators to assign values to the member variables. Use the
accessors
to obtain the values of the member variables of the object and display those values on
the
screen. Test your program with the following input:
Input for member variables of Status object:
School name: Sutherland High
Address: 192 Wierda Road, Eldoraigne, 0149
Level: S
Private indicator: 1

Question 3
Consider the following class declaration with a main() function. There are two errors in
the
main() function. Name them and explain how to fix them.
class Restaurant
{
public:
Restaurant();
int getTables();
int getTempStaff();
int getPermStaff();
string getShifts();

private:
string Menu;
int Tables;
int TempStaff;
int PermStaff;
string Shifts[3];
};
int main()
{
Restaurant mimmos;
………(additional code)
string menu = mimmos.Menu;
………(additional code)
//get information about shift 3
cout << "Shift info:" << mimmos[2].getShifts() << endl;
return 0;
}

Question 4
Design and implement a C++ class called Car that handles information regarding car
prices,
service plans and discounts if you buy a specific car. Think of all the things you would
want to
do with such a class and write corresponding member functions for your Car class.
Your class
declaration should be well-documented so that users will know how to use it.
Write a main program that does the following:
Declare an array to hold information for different types of cars. The elements of the
array
must be of type Car.
You must have member variables to hold the price of a car, the value (in Rands) of the
service plan, type of the car, discounts, etc. Initialise the array with applicable
information.
The criteria for getting a special discount, is that the buyer agrees to a service plan.
Determine the total price of each car by deducting the applicable discount amount from
the price, and then adding the value of the service plan, to give the new price for the car.
Display the car price including the service plan amount, without and with the discount.
Enrichment exercises:
(a) Turn your Car class into an ADT, so that separate files are used for the interface
and
implementation. Use separate compilation to compile the implementation separate from
the application file that tests the ADT.
(b) Adapt the application program to use a vector instead of an array. It should not be
necessary to change the class interface or implementation file in any way.
PLEASE NOTE: The enrichment exercises do not form part of the assignment. It is for
practice
Only.

Question 5
Define a class Entrepreneur as an ADT that uses separate files for the interface and
the
implementation. The class represents a group taking part in an entrepreneur day at
school.
This class has the following data members:
string Item; // the item that the group is going to sell
int Nr; // the number of members in the group
double Donation; // the donation amount received by the group
double StartupAmt; // the startup amount given to the group
double Expenses; // the expenses to buy/make items/products
double Income; // amount from sales
double Profit; // profit amount : Income +(StartupAmt+Donation)
// – Expenses
int Points; // points allocated to group
bool Sold; // indicate whether all items/products were sold
// 1 = all sold, 0 = all not sold
The class should contain a default constructor that initializes Item to "Not decided",
Nr to 1
and Donation, StartupAmt, Expenses, Points, Income and Sold to 0. It
should also
contain an overloaded constructor that accepts nine parameters to set the member
variables to
specified values. The destructor should output "Congratulations to all groups
that
partook in the challenge!"
Include accessor functions that return the values stored in the member variables of an
object of
class Entrepreneur (i.e. get functions), as well as mutator functions to update each
of the
member variables of an object of class Entrepreneur respectively (i.e. set functions
with a
parameter to set each member variable to a value specified by the parameter).
In addition the class also have member functions set_info(), calc_profit() and
update_points(). Function set_info() sets the values of member variables
Expenses,
Income and Sold, according to user input values. Function calc_profit()
calculates a
group?s profit as follows: profit = income + (startup amount + donation) ? expenses; and
updates
the member variable profit. Function update_points() calculates the points for a
group as
follows: 1 point if the group has less than 3 members, and 2 points otherwise; 1 point if
no
donation was received; and 1 point if all items were sold; and updates the member
variable
points accordingly.
Overload the comparison operator > as a friend function for class Entrepreneur.
This
function returns true if the Points member variable of Group1 is bigger than that of

Group2, or if the Points member variable of Group1 is equal to that of Group2
and the Profit member variable of Group1 is bigger than that of Group2.
Otherwise the function
returns false. Use the following prototype:
bool operator>(const Entrepreneur & Group1, const Entrepreneur &
Group2)
Overload the stream extraction operator >> and the stream insertion operator << as
friend
functions for class Entrepreneur. The stream insertion operator << should display
the item,
number of members in the group, startup amount, donation amount, expenses, points
earned
and whether all items were sold or not. The stream extraction operator should get the
item to be
sold, the donation amount received, the number of members in the group and the
startup
amount from the user.

Update the points for each object (Group1, Group2 and Group3) by calling
member
function update.points().
Use member function calc_profit() to calculate and update the profit for each
object
(Group1, Group2 and Group3).
Use the overloaded stream insertion operator << to display the values of all member
variable of all 3 groups.
Use the overloaded relational operator> to determine which group is the winner, and
display the points and profit of the winning group.

Question 6
Define a class Random as an ADT that uses separate files for the interface and the
implementation. This class represents one run of a computer program that generates a
total of
one million random numbers between (and including) 1 and 10. This class has at least
the
following member variables. Depending on the logic that you follow, you may find it
necessary
to add extra member variables:
Numbers[10], an integer array that holds the number of times each number from 1 to
10
has been generated, i.e. Numbers[0] holds the total for the number of times the
number 1
has been generated, Numbers[1] holds the total for the number of times the number 2
has
been generated, etc.

NrHighest, an integer value containing the number of hits of the number that was
generated the most times
NrLowest, an integer value containing the number of hits of the number that was
generated the least times
Index, an integer value, holding the index of the array, i.e. indicating which number
from 1
to 10 we are currently updating while reading from a file.
IndexH and IndexL that hold the index of the number with the highest/lowest
number of
hits. These variables will be used to print statistics.
In addition, the class should contain a default constructor that initializes all the member
variables to 0. The destructor should not perform any action.
Include accessor and mutator functions that returns / sets the value of variables Index,
IndexH and IndexL.
Overload the stream extraction operator >> (implemented as a friend function) so that
it can
be used to input values from a file into the array data member Numbers of an object
of type
Random. Overload the stream insertion << (implemented as a friend function) so that
it can
be used to output the member variables of an object of type Random.
Include two member functions calcHighest() and calcLowest() that find the
highest/lowest number of hits (of the numbers between 1 and 10) for a specific program
run and
update the member variables NrHighest and NrLowest. The functions should also
keep
track of the index in the array. It is up to you how you want to do this. Read the next
section of
what is expected in the main() function before you design your member functions.
Demonstrate the class in an application program (main()) that reads the total number
of hits

per number from 1 to 10 for three different runs of the program from a file. Create 4
objects of
type Random, called random1, random2, random3 and total. Create a file
numbers.dat
with the following content:
Numbers.dat:
99910 99985 99826
99998 99673 100170
100176 100097 99692
99905 99692 100069
99935 100324 100381
100058 100294 100201
100098 99738 100138
99838 100247 99916
99856 100011 99941
100226 99917 99666
Each column represents the number of times each number was generated during the
three runs
of the program, for example, line 2 means that the number 2 was generated 99998 times
with
the first program run, 99673 times with the second run and 100170 times with the third
run.
Read the values for one number for the three runs into the Numbers array of
random1,
random2 and random3 respectively. Use the function calcTotal() to calculate the
total
number of hits for a number over the three runs and save the total in object total of
class
Random for that number. Keep track of the array entry that you are busy with through a
mutator
function so that you update the correct entry in total.
Using the overloaded insertion operator <<, display the contents of the array data
member
Numbersof random1, random2 and random3 respectively, as well as that of object
total.
Your output should be similar to the output below, where rows 1 to 3 display the
contents of the
Numbers array for random1, random2 and random3 respectively, and row 4, the
same for
total :

Then determine for each of the objects, which number had the highest/lowest number of
hits
and display as follows:
Run Most hits Value(1-10) Least hits Value(1-10)
— ——— ———– ———- ———–

Question 7
Define a class Employee with member variables for an employee?s basic salary,
pension
amount, medical aid amount and tax percentage. (The medical aid amount and pension
amount
is what the employee pays ? the company also contributes the same amount towards
the
employee?s salary). The tax is calculated on the sum of the basic salary, pension amount
and
medical aid amount.
Add appropriate constructors and accessors for class Employee and include the
following
member functions:
a member function calcTax()to calculate the amount that will be deducted from the
employee?s salary for tax.
a member function calcGrossPay() to calculate the gross pay consisting of the
basic
salary plus the pension amount (contributed by the company) plus the medical aid
amount (contributed by the company).
A member function calcDeductions() to calculate how much should be deducted
from the gross salary for pension and medical aid, i.e. the company?s contribution plus
the member?s contribution.
(a) Implement class Employee.
(b) Test class Employee in a driver program that does the following:
Instantiates an object of class Employee, with the following details:
basic salary: R25110.00
pension amount: R2350.00
medical aid amount: R2400.00
% tax paid: 0.08.

Use the accessor functions to display the specifications of the instantiated object on
the console.
Calculate and display an employee?s net salary by deducting the tax amount and the
medical aid and pension deductions from the gross salary. Use functions
calcTax(), calcGrossSalary()and calcDeductions()to accomplish this.
(c) Derive and implement a class Manager from class Employee. This class has an
additional member variable, Allowance (the entertainment allowance amount that a
manager receives). Class Manager also has an overloaded constructor and a function
Display() that displays the salary details of a manager. The class Manager should
override function calcTax() in order to include the entertainment allowance in the
taxable amount when the tax percentage is calculated. It should also override function
calcGrossPay()to include the entertainment allowance.
Implement the overloaded constructor for the class Manager by invoking the base class
constructor.
(d) Test class Manager in a driver program that does the following:
instantiates an object of class Manager, with the following details:
basic salary: R60560.00
pension amount: R5500.00
medical aid amount: R2800.00
% tax paid: 0.14
allowance: R2300.00.
display the specifications of the instantiated object on the console with the member
function Display()
Calculate and display a manager?s net salary by deducting the tax amount and the
medical aid and pension deductions from the gross salary. Use functions
calcTax(), calcGrossSalary()and calcDeductions()to accomplish this.

Request A Fresh Paper Done For You!You are guaranteed plagiarism free paper within 3-8 hrs
About the author

classhelp24@gmail.com [email if you need fresh paper done]

What are you looking for?
Visit
  • HOME
  • ABOUT US
  • OUR SERVICES
  • HOW IT WORKS
  • FAQ
  • TESTIMONIALS
  • ORDER A CUSTOM PAPER NOW
  • CONTACT US
Happy Client Quotes
  • When I made the decision to seek help from you guys, I didn’t know I was making a choice that would positively change my life forever. I am so much more confident with my ability to go to work and still be able to finish my research paper on time. The research you guys did for me was great and I was highly awarded for it. I mean, all along I was having difficulty managing my time. It was so hard to decide what I ought to give priority, work or research? Thanks to you guys I can now go to work without worrying too much about how great my research should be. I am still the same person, just to be sure, but with lot of skills and ability, courtesy of feather essay. I wish you guys were around 30 years ago when I started doing research while still in school. Great research paper, thanks feather essays.

    Scott Williams, Chicago
  • Feather essays is awesome, really. I can’t just say enough about how well their services are custom-made to meet students’ needs. I mean have been using other services from different websites with erratic degree of satisfaction, but this is way too perfect. I’m thankful their team understand all about essays requirement. I had an essay assignment due in two days so I had to seek for their help, at first I thought they wouldn’t be able to do it perfectly since it was the first time I was using their service. Well, I guess I was wrong. Another thing I also liked about feather essays is how they communicate with clients, so simple, they made me feel at ease even though I was under pressure. From my standpoint, their platform is very intuitive, and it’s pretty much dummy-proof. Thanks to you guys I passed, it’s really hard to recommend anything but feather essays for quality service.

    Joseph Levoh, Phoenix University
  • I mostly do silly mistakes in term papers and essays, and while going through the instructions I used to get stuck after a few steps. I must say I always get annoyed whenever this happened and I had started doubting if I will make it through college. I had lost confidence in myself, I felt uncomfortable and unmotivated in doing assignments. One day I was just going through the internet looking for help with my essay, I found out about feather essay. I was not really sure if they could help me, but considering my situation I decided to give it a try. To say the least, I’ve never regretted making the decision. They are amazing, they offer instant help on assignment and term papers, and whenever I come across any assignment with doubts, all I do is talk to them. They instantly help me with my essays and explain to me everything about it. Thanks to you guys, you help me save a lot of time and concentrate on other class work.

    Eleona Miller, New York City
  • I’d never sought out for help with my essays before, so I was a bit uncertain how to go about it. All this doubts disappeared as soon as I talked to feather essays. You guys took your time to comprehend what my short term and long term needs were, and perfectly lined up different options for me. Considering the fact that I needed a quick response and solution, the options you guys offered were so organized. I thought the steps involved could take up several weeks or days, but I was surprised when all it took was less than four hours. I guess as soon as the agreement was made, the worked started immediately. The way you delivered that essay showed me how top class service professional you guys are. For quick essays help, I recommend you guys. The best thing is that you understand when a client needs more time to think. Thanks to you guys.

    Laurette, Ohio
  • Quick Essay Help

    I’d never sought out for help with my essays before, so I was a bit uncertain how to go about it. All this doubts disappeared as soon as I talked to feather essays. You guys took your time to comprehend what my short term and long term needs were, and perfectly lined up different options for me. Considering the fact that I needed a quick response and solution, the options you guys offered were so organized. I thought the steps involved could take up several weeks or days, but I was surprised when all it took was less than four hours. I guess as soon as the agreement was made, the worked started immediately. The way you delivered that essay showed me how top class service professional you guys are. For quick essays help, I recommend you guys. The best thing is that you understand when a client needs more time to think. Thanks to you guys.

    Diana Ross, California
  • Unique service and quality work!!!Feather essays not only offer wonderful essays but also helped me pass with flying colors!! I could not also believe it. And what makes me love them more is how work is done instantly after ordering!!i will never worry about school essays anymore. Absolutely the best!

    Sasha Kelly, Cleveland
Recent Posts
  • Week 7 – Assignment: Integrate Waste Elimination Techniques into Training Development (10 Points)
    June 5, 2019
  • (Let professional handle your assignment. Get an A) Cloud Architectures Application
    June 25, 2018
  • (Let professional handle your assignment. Get an A) Cloud Architectures Application
    June 25, 2018
  • (Let professional handle your assignment. Get an A) Cloud Architectures Application
    June 25, 2018
  • (Let professional handle your assignment. Get an A) Cloud Architectures Application
    June 25, 2018
  • (Let professional handle your assignment. Get an A) Cloud Architectures Application
    June 25, 2018
  • HOME
  • ABOUT US
  • ORDER A CUSTOM PAPER NOW
  • FAQ
  • CONTACT US
  • TERMS & CONDITIONS
  • CHEAP AND AFFORDABLE PRICES
footer

Copyright © 2015 FeatherEssays