Writing a function called process

Assignment Help C/C++ Programming
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:

  1. Sort the vector by the names of the customers in ascending order (a-z).
  2. Print all the Gameboys that are in the collection (be sure to print all the data)
  3. 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"
  4. Add all the "working" Gameboys to a new list. This list will be what is returned at the end of the function.
  5. 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;

}

Reference no: EM133201525

Questions Cloud

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)

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd