Question: Trying to create a program to keep track of the Dallas Cowboys wins and losses for this season. This code will require #include Create a

Trying to create a program to keep track of the Dallas Cowboys wins and losses for this season. This code will require

#include

Create a C/C++ that does the following:

  1. Create a method that will allow you to enter the win and losses. Enter W for a win and L for a Loss.
    1. Hint: This method needs to have a vector passed by reference (&) to it.
    2. Using a loop - prompt for the Win or Loss and add the given value to the passed vector. Allow the entry 'X' to end the input.
  2. Create a method to report the total wins and total losses. It needs to have a char vector passed to it.
    1. You will need to create a variable to count the number of wins and a variable to count the number of losses.
    2. Initialize these variables to zero.
    3. Using a loop - transverse the vector and increment your counters as data qualifies.
    4. Report the total wins and total losses.
  3. In the main method
    1. Create a vector of characters.
    2. Call the method created in Step 1 and pass it the vector created in Step 3.1
    3. Call the method created in Step 2 and pass it the vector created in Step 3.1
    4. Display "Done!"

This is an example run:

Enter Win(W) or Loss(L) or X: W Enter Win(W) or Loss(L) or X: W Enter Win(W) or Loss(L) or X: L Enter Win(W) or Loss(L) or X: W Enter Win(W) or Loss(L) or X: W Enter Win(W) or Loss(L) or X: L Enter Win(W) or Loss(L) or X: X Win count is 4 - Loss Count is 2 Done!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!