Entries by Student

write my assignment 28989

write program that helps a player select players in Fantasy Premier League game. You have £100 to get 15 players, distributed as follows:program that helps a player select players in Fantasy Premier League game. You have £100 to get 15 players, distributed as follows:

·       £10 to get 2 goal keepers

·       £25 to get 5 defenders

·       £35 to get 5 midfielders

·       £30 to get 3 forwards

You will develop the following classes:

·       Player class: 

o  It is an abstract base class and has as private data fields

§ string name;

§ string team;

§ string position;

§ double price;

§ int ptsPrevSeason;

o  As regular public methods, the getters and setters of each private data field

o  An abstract function selectPlayer defined as follows 

§ virtual stack<Player*> selectPlayer(vector<Player*> players)=0;

·       Goalkeeper class: 

o  This is a derived class of class Player

o  It overrides selectPlayer method to select the designed players for goalkeeper position

o  It defines the budget for goalkeepers as static const

·       Defender class:

o  This is a derived class of class Player

o  It overrides selectPlayer method to select the designed players for defender position

o  It defines the budget for defender as static const

·       Midfielder class:

o  This is a derived class of class Player

o  This is a derived class of class Player

o  It overrides selectPlayer method to select the designed players for midfielder position

o  It defines the budget for midfielder as static const

·       Forward class:

o  This is a derived class of class Player

o  It overrides selectPlayer method to select the designed players for forward position

o  It defines the budget for forward as static const

You are given in “Players.txt” the list of player names, teams, positions, price and points in previous season. You have to parse this file to populate the vectors of players of type goalkeeper, defender, midfielder and forward.

When overriding selectPlayer method at each derived class, you must count the available budget for that position and substract the amount of money you spent for previous players taking into consideration that you can select exactly only 2 goalkeepers, 5 defenders, 5 midfielders and 3 forwards.

You are given some handouts of sample code to read from/write to a file and to insert to/ delete from vectors.

A sample of the final squad choice into file “Squad.txt” is shown below:

*****************************

The selected Goalies are: 

*****************************

Hugo Lloris (Spurs)

Heurelho Gomes (Watford)

*****************************

The selected Defenders are: 

*****************************

Kyle Walker (Man City)

Daley Blind (Man Utd)

Hector Bellerin (Arsenal)

Alberto Moreno (Liverpool)

Seamus Coleman (Everton)

*****************************

The selected Midfielders are: 

*****************************

Dimitri Payet (West Ham)

Oscar (Chlesea)

Sadio Mane (Liverpool)

Anthony Martial (Man Utd)

Christian Eriksen (Spurs)

*****************************

The selected Forwards are: 

*****************************

Sergio Aguero (Man City)

Jermain Defoe (Sunderland)

Harry Kane (Spurs)

this is getting 15 dollars

 

"Not answered?"


Get the Answer

write my assignment 27764

Instructions

Draft of Introduction and Literature Review

Follow the directions below for the completion of the introduction and literature review draft assignment for Unit IV. If you have questions, please email your professor for assistance.

The subject is Childhood Education

Purpose: The purpose of this assignment is to begin drafting your academic argumentative research paper.

Description: In this assignment, you will first write your literature review; then, you will write your introduction. Please see “Lesson 4: The Introduction” for details on why it is suggested that you begin the drafting process with the literature review instead of the introduction. The following details are requirements of the assignment:

Introduction (9-12 well-developed sentences/approximately 350 words): For more details about what is expected for each of the following sentences, please see “Lesson 4: The Introduction.” You may also want to review the “Example Introduction and Literature Review (with comments).” The following components must be included in the introduction (in the following order).

Sentence 1: Introduce the general topic

Sentence 2: Pro side (general)

Sentence 3: Con side (general)

Sentence 4: Narrow the scope (1)

Sentence 5: Examples of the narrowed topic

Sentence 6: Narrow the scope (2)

Sentence 7: Specific controversy

Sentence 8: Pro side (specific)

Sentence 9: Con side (specific)

Sentence 10: The thesis

Literature Review (800-900 words): For details about the structure of the literature review, you will want to review “Lesson 3: The Literature Review: The Process.” You may also want to review the “Example Introduction and Literature Review (with comments).” The link is below.

Literature review preface: This paragraph acts as a guide to what the reader can expect in the literature review.

Literature review body: This section includes three to four body paragraphs that discuss the history, terminology, and both sides of the controversy (pro and con).

Literature review conclusion: The conclusion signals that the literature review is ending, but it also acts as a kind of preface for the body of the paper by restating the thesis statement and establishing your argument once again.

Demonstrate how to summarize and paraphrase source materials.

Demonstrate the avoidance of plagiarism through proper use of APA citations and references for all paraphrased and quoted material.

Example: Click here to access the example introduction and literature review. Note: The conclusion is not presented in this example; however, the literature review conclusion is a requirement of the assignment.

You may also seek out the guidance of the Success Center; the specialists are always there to assist you with your writing and comprehension.

Attached  is the Annotated Bibliography for your review.

 

"Not answered?"


Get the Answer

write my assignment 2546

1) A bat flying at 4.00 m/s is chasing an insect flying in the samedirection. If the bat emits a 40.0-kHz chirp and receives back an echoat 40.4 kHz, what is the speed of the insect? (Take the speed of soundin air to be 340 m/s.)2) The acoustical system shown in the figure below is driven by aspeaker emitting sound of frequency 732 Hz. (Take the speed of sound as345 m/s.)Image: http:// If constructive interference occurs at a particular instant, by whatminimum amount should the path length in the upper U-shaped tube beincreased so that destructive interference occurs instead?(b) What minimum increase in the original length of the upper tube willagain result in constructive interference?

 

"Not answered?"


Get the Answer

write my assignment 31064

Class TicTacToe

import java.util.*;

/**

* A class modelling a tic-tac-toe (noughts and crosses, Xs and Os) game.

*

* @author Lynn Marshall

* @version November 8, 2012

*/

public class TicTacToe

{

public static final String PLAYER_X = “X”; // player using “X”

public static final String PLAYER_O = “O”; // player using “O”

public static final String EMPTY = ” “; // empty cell

public static final String TIE = “T”; // game ended in a tie

private String player; // current player (PLAYER_X or PLAYER_O)

private String winner; // winner: PLAYER_X, PLAYER_O, TIE, EMPTY = in progress

private int numFreeSquares; // number of squares still free

private String board[][]; // 3×3 array representing the board

/**

* Constructs a new Tic-Tac-Toe board.

*/

public TicTacToe()

{

board = new String[3][3];

}

/**

* Sets everything up for a new game. Marks all squares in the Tic Tac Toe board as empty,

* and indicates no winner yet, 9 free squares and the current player is player X.

*/

private void clearBoard()

{

for (int i = 0; i < 3; i++) {

for (int j = 0; j < 3; j++) {

board[i][j] = EMPTY;

}

}

winner = EMPTY;

numFreeSquares = 9;

player = PLAYER_X; // Player X always has the first turn.

}

/**

* Plays one game of Tic Tac Toe.

*/

public void playGame()

{

int row, col;

Scanner sc;

clearBoard(); // clear the board

// print starting board

print();

// loop until the game ends

while (winner==EMPTY) { // game still in progress

// get input (row and column)

while (true) { // repeat until valid input

System.out.print(“Enter row and column of chosen square (0, 1, 2 for each): “);

sc = new Scanner(System.in);

row = sc.nextInt();

col = sc.nextInt();

if (row>=0 && row<=2 && col>=0 && col<=2 && board[row][col]==EMPTY) break;

System.out.println(“Invalid selection, try again.”);

}

board[row][col] = player; // fill in the square with player

numFreeSquares–; // decrement number of free squares

// see if the game is over

if (haveWinner(row,col))

winner = player; // must be the player who just went

else if (numFreeSquares==0)

winner = TIE; // board is full so it’s a tie

// print current board

print();

// change to other player (this won’t do anything if game has ended)

if (player==PLAYER_X)

player=PLAYER_O;

else

player=PLAYER_X;

}

}

/**

* Returns true if filling the given square gives us a winner, and false

* otherwise.

*

* @param int row of square just set

* @param int col of square just set

*

* @return true if we have a winner, false otherwise

*/

private boolean haveWinner(int row, int col)

{

// unless at least 5 squares have been filled, we don’t need to go any further

// (the earliest we can have a winner is after player X’s 3rd move).

if (numFreeSquares>4) return false;

// Note: We don’t need to check all rows, columns, and diagonals, only those

// that contain the latest filled square. We know that we have a winner

// if all 3 squares are the same, as they can’t all be blank (as the latest

// filled square is one of them).

// check row “row”

if ( board[row][0].equals(board[row][1]) &&

board[row][0].equals(board[row][2]) ) return true;

// check column “col”

if ( board[0][col].equals(board[1][col]) &&

board[0][col].equals(board[2][col]) ) return true;

// if row=col check one diagonal

if (row==col)

if ( board[0][0].equals(board[1][1]) &&

board[0][0].equals(board[2][2]) ) return true;

// if row=2-col check other diagonal

if (row==2-col)

if ( board[0][2].equals(board[1][1]) &&

board[0][2].equals(board[2][0]) ) return true;

// no winner yet

return false;

}

/**

* Prints the board to standard out using toString().

*/

public void print()

{

System.out.println(this.toString());

if(this.winner!=EMPTY){

System.out.println(player+” wins”);// something needs to be added here

}

}

/**

* Returns a string representing the current state of the game. This should look like

* a regular tic tac toe board, and be followed by a message if the game is over that says

* who won (or indicates a tie).

*

* @return String representing the tic tac toe game state

*/

public String toString()

{

String table = “”;

for (int i = 0; i < 2; i++) {

for (int j = 0; j < 2; j++) {

table += board[i][j] + ” | “;

}

table += board[i][2];

table += “n———n”;

}

table += board[2][0] + ” | ” + board[2][1] + ” | ” +board[2][2];

table += “nn”;

return table;

}

}

Class TicTacToeFrame

import java.util.*;

import java.awt.*;

import java.awt.event.*;

import javax.swing.*;

/**

* A class modelling a tic-tac-toe (noughts and crosses, Xs and Os) game in a very

* simple GUI window.

*

* @author Lynn Marshall

* @version November 8, 2012

*/

public class TicTacToeFrame extends TicTacToe

{

private JTextArea status; // text area to print game status

/**

* Constructs a new Tic-Tac-Toe board and sets up the basic

* JFrame containing a JTextArea in a JScrollPane GUI.

*/

public TicTacToeFrame()

{

JFrame frame = new JFrame(“Tic Tac Toe”);

frame.setSize(250,250);

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

Container content = frame.getContentPane();

status = new JTextArea(20,50);

status.setFont(new Font(“Monospaced”,Font.BOLD,18));

status.setEditable(false);

JScrollPane scroll = new JScrollPane(status);

frame.add(scroll);

frame.setVisible(true);

frame.pack();// add the necessary code here

}

/**

* Prints the board to the GUI using toString().

*/

public void print()

{

status.setText(toString());// add code here

}

}

In this assignment, you are to take the detector: project and class TicI‘acToe used in lab #10and rewrite it to use a GUI to represent the tic tac toe board. You may call your project whateveryou like and you may have as many java classes as you like. (It can be done with just one!) The code in the given I icTacToe class was written to make the conversion to the GUI stylefairly straight forward. You can reuse all the constants and fields, except that the board fieldnow needs to have a different type, and you will need to add a few other fields. It’s recommended that you use a 3×3 Grid Layout made up of J Buttons for the tic-tac—toe board.When a button is selected, the players &quot;mark&quot; (either &quot;X&quot; or &quot;0&quot;, depending on whose turn it is)appears in the button and the button can no longer be selected. After the game ends, no buttonsmay be selected. However, if you prefer another approach, that’s fine, as long as your gameworks. Now add a label field (e. g. at the bottom of your frame) to indicate the current state of the game(e.g. game in progress and X’s turn; game in progress and 0’s tum; game over tie; game over Xwins; game over 0 wins) in a label field. Of course, the label must change so that it is alwayscurrent (Le. reflects the current state of the game). Now add a &quot;Game&quot; menu, with two choices: New (or ctrl-N) to start a new game (whether thecurrent game is over or not), and Quit (or ctrl-Q) to quit. Feel free to experiment further with GUIs. Possible extensions include adding a component thatdisplays the number of games that X has won, the number that O has won, and the number ofties. You can also add additional menu items (e.g. change the game so that &quot;0&quot; goes first, etc.),or you could implement this functionality another way. You can even change what is displayedon the buttons from just text &quot;X&quot; and &quot;O&quot; to fancy graphic &quot;X&quot; and &quot;O&quot; (by providing jpg files}.Or whatever else you can think of to make the game look better! You may also add sounds using.wav files. These extensions are not required for full marks, but may earn bonus marks.

 

"Not answered?"


Get the Answer