Computer Science  >  Research Paper  >  University of California, RiversideCS 012main.cpp (All)

University of California, RiversideCS 012main.cpp

Document Content and Description Below

#include <iostream> #include <vector> using namespace std; // parameter order will always be jersey #s then ratings void outputRoster(const vector<int>& modjersey , const vector<int>& modrating); ... void addPlayer(vector<int> &modjersey, vector<int> &modrating); void removePlayer(vector<int> &modjersey, vector<int> &modrating); void updatePlayerRating(const vector<int> &modjersey, vector<int> &modrating); void outputPlayersAboveRating(const vector<int> &modjersey, const vector<int> &modrating); int main() { vector<int> jersey(5); vector<int> rating(5); int number; int rate; for (int i = 0; i <5; ++i){ cout << "Enter player " << i+1 << "'s jersey number:" << endl; cin >> number; jersey.at(i) = (number); cout << "Enter player " << i+1 << "'s rating:" << endl << endl; cin >> rate; rating.at(i) = (rate); } cout << "ROSTER" << endl; for (int i = 0; i <5; ++i){ cout << "Player " << i+1 << " -- Jersey number: " << jersey.at(i) << ", Rating: " << rating.at(i) << endl; } cout << endl << "MENU" << endl << "a - Add player" << endl << "d - Remove player" << endl << "u - Update player rating" << endl << "r - Output players above a rating" << endl; cout << "o - Output roster" << endl << "q - Quit" << endl << endl << "Choose an option:" << endl; char userInput; cin >> userInput; while (userInput != 'q'){ if(userInput == 'a'){addPlayer(jersey,rating);} else if(userInput =='d'){removePlayer(jersey,rating);} else if(userInput == 'u'){updatePlayerRating(jersey,rating);} else if(userInput == 'r'){outputPlayersAboveRating(jersey,rating);} else if(userInput == 'o'){outputRoster(jersey,rating);} else if(userInput == 'q'){return 0;} cout << endl << "MENU" << endl << "a - Add player" << endl << "d - Remove player" << endl << "u - Update player rating" << endl << "r - Output players above a rating" << endl; cout << "o - Output roster" << endl << "q - Quit" << endl << endl << "Choose an option:" << endl; cin >> userInput; } return 0; [Show More]

Last updated: 3 years ago

Preview 1 out of 3 pages

Buy Now

Instant download

We Accept:

Payment methods accepted on Scholarfriends (We Accept)
Preview image of University of California, RiversideCS 012main.cpp document

Buy this document to get the full access instantly

Instant Download Access after purchase

Buy Now

Instant download

We Accept:

Payment methods accepted on Scholarfriends (We Accept)

Reviews( 0 )

$8.00

Buy Now

We Accept:

Payment methods accepted on Scholarfriends (We Accept)

Instant download

Can't find what you want? Try our AI powered Search

81
0

Document information


Connected school, study & course


About the document


Uploaded On

Jun 08, 2021

Number of pages

3

Written in

All

Seller


Profile illustration for Cheryshev
Cheryshev

Member since 4 years

102 Documents Sold

Reviews Received
6
4
1
0
1
Additional information

This document has been written for:

Uploaded

Jun 08, 2021

Downloads

 0

Views

 81

Document Keyword Tags

Recommended For You

Get more on Research Paper »

$8.00
What is Scholarfriends

Scholarfriends.com Online Platform by Browsegrades Inc. 651N South Broad St, Middletown DE. United States.

We are here to help

We're available through e-mail, Twitter, Facebook, and live chat.
 FAQ
 Questions? Leave a message!

Follow us on
 Twitter

Copyright © Scholarfriends · High quality services·