samedi 15 décembre 2018

Can some please guide me through this weeks assignment, in C++ programming?

I need some help with this week assignment I have gotten this week, I have been working on it for a while now, I just keep destroying it more and more. I would just like a walkthrough or you're on the right page. This is the assignment and the code I have I will attach.

Espresso Yourself’s Coffeehouse Payroll Program

Create a program that gets information from the owner and displays the current month’s expense for the employee’s wages.

Requirements:

No loops or decision structures or formatted output at this point Input comes from the keyboard when the owner enters the monthly data A month is 4 weeks Employees get paid once a month No taxes are taken out, currently it’s the employees job to do All of the input will be finished before the output begins This does not include prompting the coffeehouse owner for the information to be entered The input: The owner should know which employee and week he is entering the information for Hourly: Enter the hours worked by the week Get all 4 weeks for 1 employee before moving on Salary: Verification of how many full weeks they worked They can only work a full week or not at all that week The output: Make sure the output organized and easy to read Two categories Hourly Salary Display for each category First and last name How many hours worked for the month or weeks for salaried Gross pay for the month The Employees: Hourly employees (the barista’s) Darren Duchesne, $6.45 plus tips Christian Cargile, $5.75 plus tips Selena Dresher, $6.25 plus tips Neil Palafox, $5.45 plus tips Salaried employees (the managers) Emilia Rogge, $32,633/year Jamie Lanphear, $27,800/year

Notes: the parts that I am really having trouble with are... 7. A) the and week part I am super confused on how to code that 7. B) I think I have right but still coming up with errors so don't know 7. C) I don't even know where to begin is that yes or no question and if else statement at one point a had that, but second guessed it. 8. B) you can see in my code I post I have one category finished, but my question is do I just make another one for salary. 8. C) I guess the problem and I am here is I don't really understand where to put the math to get those outputs.

    #include <iostream>
    #include <iomanip>
    #include <string>

   using namespace std;

  struct employee { string first_name, last_name; int hours[4], weeks; int 
  total_number_hours; double hourly_pay; }
  emp[100];

   int main ()
  {
    emp[0].first_name = "Darren"; emp[0].last_name = "Duchesne"; emp[0].weeks;
    emp[1].first_name = "Christain"; emp[1].last_name = "Cargile"; emp[1].weeks;
    emp[2].first_name = "Selena"; emp[2].last_name = "Dresher"; emp[2].weeks;
    emp[3].first_name = "Neal"; emp[3].last_name = "Palafox"; emp[3].weeks;
    emp[4].first_name = "Emilia"; emp[4].last_name = "Rogge"; emp[4].weeks;
    emp[5].first_name = "Jamie"; emp[5].last_name = "Lanphear"; emp[5].weeks;

    cout << "Please enter Hours by week: ";
    cin >> employee::hours[4]; 
    cout << endl;

    cout << "Plese enter number of weeks worked:";
    cin >> employee::weeks;
    cout << endl; 

   cout << "-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*" 
       << "-*-*-*-*-*-*-*-*-*-*-*-*" << endl;
   cout << "Hourly";
   cout << setfill('.') << left << setw(35) << "Full name:" << right << " " 
    <<get.emp[0] << endl;
   cout << left << setw(35) << "Hours worked monthly/weekly: " 
       << setfill(' ') << right << setw(10) << totalhoursworkedmonthly << endl;
   cout << setfill('.') << left << setw(35) << "Gross monthly pay: "
       << setfill(' ') << right << " $"
       << setw(8) << grosspaymonthly << endl;


   cout << "\npress anyKey to end...";
   _getch();

Aucun commentaire:

Enregistrer un commentaire