Reference no: EM133201525
You run a side hobby of repairing old retro tech. Your business is growing, and you want to add a bit more automation to help your billing system.
The following code defines a struct to hold your customer's items that you are working on.
Your job is to writing a function called Process, that receives a collection of Gameboys as an argument (std::vector) and returns a vector of Gameboys.
Your function will do the following:
- Sort the vector by the names of the customers in ascending order (a-z).
- Print all the Gameboys that are in the collection (be sure to print all the data)
- Find the first Gameboy in the list that is in "Non-Working" order and increase the hours worked on by 1. Switch it's status to "working"
- Add all the "working" Gameboys to a new list. This list will be what is returned at the end of the function.
- Finally, total up all the "working" Gameboy's hours worked and apply your hourly wage of $50 an hour to it. Print the total amount earned from repairing the Gameboys on the bench to working order.
*** Do not use Manual loops!
*** Do not use the same algorithm more than once!
Your solution should only contain this function.
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <string>
#include <vector>
#include <numeric>
using namespace std;
enum GameBoyIssue {
wontTurnOn, powersWithIssues, working
};
struct Gameboy {
string customerName;
string type;
GameBoyIssue status;
double hoursWorkedOn;
};
//Remove this code from final
vector<Gameboy> Process(vector<Gameboy> workBench) {
// your code here
return processed;
}
int main() {
vector<Gameboy> onBench = { {"Andy", "Colour", GameBoyIssue::wontTurnOn, 1},
{"Eliott", "DMG", GameBoyIssue::working, 2.5},
{"Ally", "Colour", GameBoyIssue::powersWithIssues, 1},
{"MC", "GBA", GameBoyIssue::wontTurnOn, 1.5},
{"Kelly", "GBA", GameBoyIssue::powersWithIssues, 2},
{"Jared", "Pocket", GameBoyIssue::working, 3}, };
Process(onBench);
return 0;
}
Worthiness of the franchise investment
: Do you agree or disagree with your fellow student's conclusion on the worthiness of the franchise investment they selected and the financing option preferred?
|
Generate a list of suggested lottery numbers
: This assignment will require that you generate a list of suggested lottery numbers using random number generation techniques.
|
Describe ethnocentrism and prejudice
: Define culture and explain the terms related to culture. Define and describe ethnocentrism and prejudice. Give personal examples to support your descriptions.
|
Mips assembler program
: You have been given 21t3final_q3. s, a MIPS assembler program that reads an integer value and then prints it. Add code to the file 21t3final_q3.s
|
Writing a function called process
: You run a side hobby of repairing old retro tech. Your business is growing, and you want to add a bit more automation to help your billing system.
|
Overview of the history of knowledge management
: Explain the concept of knowledge management. Provide an overview of the history of knowledge management. (300-400 words)
|
Perform surgeries for back and heart
: A function named surgerySelector that receives a vector of Hospital as the parameter (std::vector) and returns Hospital. This functions performs the following t
|
Explain the specific experimental design
: BIO 120-Grossmont College-Explain the specific experimental design used to figure out the role of camouflage in the mouse populations
|
Look at an item around your house
: University of Southern California - Look at an item around your house, for example a coke can (and now you can't use a coke can--nor any other soft drink can)
|