The Genesis Energy operations management team, nearing completion of its agreement with Sensible Essentials, was asked by senior management to present a capital plan for the operating expansion.

The Genesis Energy operations management team, nearing completion of its agreement with Sensible Essentials, was asked by senior management to present a capital plan for the operating expansion. The capital plan was not to be a wish list but an analysis of the necessary expenditures to successfully establish a fully equipped operating facility overseas.

In addition, senior management requested meaningful financial and operating metrics to ensure that the performance objectives for the facility were being met. The operations management team was given five days to accomplish the following:

Calculate the firm’s WACC.

Prepare and analyze each planned capital expenditure.

Evaluate, rank, and recommend the capital expenditures according to beneficial value to the organization, using the evaluation tools NPV, payback, and IRR. Evaluation, ranking, and recommendations should be by category of expenditures. For example, facility, equipment 1, 2, and 3, and inspection.

Using the selected choices in part three, calculate the full cost of establishing a fully equipped facility. This would include the facility, equipment 1, 2, and 3, and inspection. In addition, calculate the payback, NPV, and IRR for the completed facility.

Construct and recommend between three and five metrics to measure the performance of the organization. At least one metric should be dividend decision-making driven.

Prepare an executive summary along with a separate document showing the calculations.

Part I

Following the example of the operations management team, do the following:

Download the Capital Budgeting spreadsheet, and compute the WACC for Genesis Energy.

Using the information provided in the spreadsheet, analyze Genesis Energy’s project options. Then, calculate the periodic and cumulative net cash flows for each potential project and its associated options. Please note that there are five projects (facility, equipment pieces 1, 2, and 3, and internal inspection), and that each project offers multiple-configuration options (facility size, equipment type, etc.).
Evaluate, rank, and recommend a specific option for each capital project according to beneficial value to the organization, using the evaluation tools NPV, payback, and IRR.

Construct and recommend between three and five metrics to measure the performance of the new operating strategy. At least one metric should reflect dividend policy as it relates to rewarding shareholders.

Prepare an executive summary describing your recommendations for each project and the overall cost, net cash flows, and expected returns of the operating configuration that you recommend. Be sure to justify your recommendations in terms of the investment criteria applied in Step 3 above. Be sure to report the full cost of the facility as it is configured per your recommendations. Present and justify your operating strategy performance metrics.

Your complete report should include all of your calculations as appendices (5 pages, or 1 page for each project).

Part II—Executive Summary Presentation

Because of limited resources in an era of plentiful opportunities, companies must carefully select investments. You analyzed Genesis Energy’s expansion plans and explained your findings in M5: Assignment 1.

This assignment is based on those findings. In this assignment, you will create a PowerPoint presentation that will include the following information:

An executive summary of your findings from M5: Assignment 1. Be sure to adhere to the following:

The presentation should be approximately 6–8 minutes (or 10–12 slides).

A statement of the problem or topic is included.

A concise analysis of the findings is included.

Specific details from M5: Assignment 1 to highlight or support the summary are incorporated.

Develop a 10–12-slide presentation in PowerPoint format. Apply APA standards to citation of sources. Use the following file naming convention: LastnameFirstInitial_M5_A2.ppt.

The post The Genesis Energy operations management team, nearing completion of its agreement with Sensible Essentials, was asked by senior management to present a capital plan for the operating expansion. appeared first on Vivanswers.org.

 
"Looking for a Similar Assignment? Order now and Get 10% Discount! Use Code "Newclient"

Develop a simple text-based card game in Unix using C

This assignment is designed to provide some experience with C programming and basic UNIX software development tools, e.g., gcc, gdb, and make.  Your goal is to develop a simple text-based card game in Unix using C.  Since we are emphasizing programming and not game play, we’ll be implementing Go Fish to keep things simple.  The rules are summarized below. Your game implementation will only need to support 1 real player and 1 computer player.

Game Play. Your game should have a text-based interface that mimics the one in the sample game play below (i.e., your text interface should adhere to the same format as below). You should use the rand() function in C’s standard library to shuffle the deck, and to select ranks to play on the computer’s turn (see rand’s man page). Keep in mind the game rules below, and return errors if a user enters an incorrect value. On error, prompt the player to retry their move. When the game ends, allow the player to quit the game, or to play again.

Software Design. Your implementation should include multiple .c files (or “modules”) with associated header files.  We have designed a template set of C modules/headers and functions that you should implement.  You can download these template files here.  These files define basic data types (structures) and functions to represent cards, the players, and the deck.

Remember to untar and unzip the file and go into the assignment2/ directory

> tar -xzf assignment2.tar.gz

> cd assignment2/

Each function, data type, and variable defined in each header file has a general description of its functionality/purpose, its input, and its output.  Note that the output also specifies return values when errors occur. Make sure to check for errors when calling functions. These functions, data types, and variables are not necessarily complete, and you may add additional functions and/or data structures. You may also alter the interfaces for the functions defined in the header files if necessary.  We have also included a Makefile for compilation. To compile the program, type make on the command line.  To run the program, type ./gofish on the command line.   To remove object files and the executable, type make clean.  To build the program with debugging symbols (so you can use gdb), type make debug.

Below is a sample of the game play, and an example of what your output should look like. Note that Player 1 is the human player, and Player 2 is the computer.  The red values are those entered by the human player via the keyboard. 

ece373@ece373:~$ ./gofish

Shuffling deck…

Player 1’s Hand – 5S 3H JC 9D 9H AS QC

Player 1’s Book –

Player 2’s Book –

Player 1’s turn, enter a Rank: 5

    – Player 2 has no 5’s

    – Go Fish, Player 1 draws 7D

    – Player 2’s turn

Player 1’s Hand – 5S 3H JC 9D 9H AS QC 7D

Player 1’s Book –

Player 2’s Book –

Player 2’s turn, enter a Rank: 9

    – Player 1 has 9D, 9H

    – Player 2 has 9C, 9S

    – Player 2 books 9

    – Player 2 gets another turn

Player 1’s Hand – 5S 3H JC AS QC 7D

Player 1’s Book –

Player 2’s Book – 9

Player 2’s turn, enter a Rank: 4

    – Player 1 has no 4’s

    – Go Fish, Player 2 draws a card

    – Player 1’s turn

Player 1’s Hand – 5S 3H JC AS QC 7D

Player 1’s Book –

Player 2’s Book – 9

Player 1’s turn, enter a Rank: 4

Error – must have at least one card from rank to play

Player 1’s turn, enter a Rank: 3

    – Player 2 has 3C 3D 3S

    – Player 1 has 3H

    – Player 1 books 3

    – Player 1 gets another turn

Player 1’s Hand – 8D

Player 1’s Book – 3 2 J A 6 Q

Player 2’s Book – 9 5 10 4 5 K

Player 1’s turn, enter a Rank: 8

    – Player 2 has 8H, 8S, 8C

    – Player 1 has 8D

    – Player 1 books 8

    – Player 1 gets another turn

Player 1’s Hand –

Player 1’s Book – 3 2 J A 6 Q 8

Player 2’s Book – 9 5 10 4 5 K

Player 1 Wins! 7-6

Do you want to play again [Y/N]: Y

Shuffling deck….

Player 1’s Hand – 5S 3H JC 9D 9H AS QC

Player 1’s Book –

Player 2’s Book –

Player 1’s turn, enter a Rank: 5

    – Player 2 has no 5’s

    – Go Fish, Player 1 draws 7D

    – Player 2’s turn

….

Player 1’s Hand –

Player 1’s Book – 3 2 J A 6 Q 8

Player 2’s Book – 9 5 10 4 5 K

Player 1 Wins! 7-6

Do you want to play again [Y/N]: N

Exiting.

Seven cards are dealt from a standard 52-card deck to each player.  The remaining cards in the deck are shared between the players, usually spread out in a disorderly pile referred to as the “ocean” or “pool”. The player whose turn it is to play asks another player for his or her cards of a particular rank.   For example, Alice may ask, “Bob, do you have any threes?” Alice must have at least one card of the rank she requested.  Bob must hand over all cards of that rank if possible. If he has none, Bob tells Alice to “go fish” (or just simply “fish”), and Alice draws a card from the pool and places it in her own hand. Then it is the next player’s turn – unless the card Alice drew is the card she asked for, in which case she shows it to the other players, and she gets another turn. When any player at any time has all four cards of one face value, it forms a “book,” and the cards must be placed face up in front of that player.  The player that forms the book then gets another turn.  The first person to get 7 “books” wins the game!

Grading

We will grade the program based on three attributes: compilation, game play, and implementation.  For the implementation, we have assigned point values to different functions.  The total grade is out of 100. 

Compilation – 20 points

  – The program must compile and run.

Gameplay – 30 points

  – The program must adhere to the rules of the game and the specified game play above.

  – The program not exit with errors.

Implementation – 50 points

  – Player interface (35 points)

  – Deck interface (15 points)

  – We will test the implementations of the functions specified in these interfaces.

Submission

You should write the program code in the assignment2/ directory. You should then re-tar and zip the entire directory, by running the command below.

> tar -czvf assignment2-solutions.tar.gz assignment2

The post Develop a simple text-based card game in Unix using C appeared first on Vivanswers.org.

 
"Looking for a Similar Assignment? Order now and Get 10% Discount! Use Code "Newclient"

Visualizing trends in an index. This question asks you to plot the Bitcoin price index (BPI) along with 5-day and 10-day averages.

Visualizing trends in an index

This question asks you to plot the Bitcoin price index (BPI) along with 5-day and 10-day averages. Please execute the code cell below; it will read in a csv file containing the daily closing price from Sep. 1, 2018 to Aug. 31, 2019 (data obtained from https://www.coindesk.com/price/). Perform the following tasks. You may use any built-in Python functions as well as data strucutres and functions provided by the numpy library.

  • Observe that the closing prices are at a daily interval. We therefore do not need the date information. Clean up the data and only retain the price information. Store the result in a list or a numpy array in floating point format.
  • Recall that a simple moving average is defined as the (unweighted) mean over the previous 𝑁N days.
    Perform a simple moving average of the price index. The number of days 𝑁N to average over should be adjustable. If you are using numpy, you may find the function np.convolve helpful.
  • Plot the raw price index data along with 5-day and 10-day simple moving average. Plot on the same figure in order to help you visually ascertain the effect of the filter.
  • What is the effect of the moving average filter? In what circumstances would you not want to use a moving average?

2Eight athletes are competing in a 1500 m race. Using numpy , write a vectorized race simulation according to the following criteria:

    • The granularity of the simulation is 1 s, i.e. each iteration in your simulation represents 1 second.
    • During each iteration, each athelete can randomly take 1, 2, 3, or 4 steps. Each step is 1 m long.
    • When the race is complete, return the winner and the winning time. There should not be any ties. If there is a tie, select a winner at random.

Please pay attention to the following:

    • There should only be one loop in your simulation: the loop that advances the simulation by a second.
    • All other operations should be done using vectorized array operations and boolean indexing.
    • The following numpy functions will be helpful:
      • numpy.random.randint
      • numpy.sum
      • numpy.random.choice
  1. Run your simulation 10,000 times. For each run, record the winner and the winning time. Produce a bar chart showing the number of times each athelete won. Also display a bar chart showing the average winning time for each athlete.

The post Visualizing trends in an index. This question asks you to plot the Bitcoin price index (BPI) along with 5-day and 10-day averages. appeared first on Vivanswers.org.

 
"Looking for a Similar Assignment? Order now and Get 10% Discount! Use Code "Newclient"

From a patient we received a periodic wave representing the blood flow (measured in kg/h) over time.

Problem description:

From a patient we received a periodic wave representing the blood flow (measured in kg/h) over time. The data containing respectively the time in seconds and the corresponding blood flow values in kg/h per time point is found below:

0
0,2
0,4
0,6
0,8
1
1,2
1,4
1,6
1,8
2
2,2
2,4
2,6
2,8
3
3,2
3,4
3,6
3,8
4
4,2
4,4
4,6
4,8
5
46,120
47,154
51,547
59,017
68,093
76,425
83,073
86,914
88,064
87,224
84,216
79,436
73,656
67,657
63,181
60,510
59,256
58,172
56,726
54,540
52,112
50,374
49,356
48,457
47,399
46,523

The plot of this data looks as follows:

The problem is the next:

We need a fourier transform performed on the wave shown in the graph. So that signal has to be decomposed into a superposition of sine waves. This way we can really closely mimic the data and it makes it more repeatable. So I need the function containing the superposition of sine waves with each its own amplitude and fase shift. I need a clear scientific answer containing all the in between steps so we can use it in the research. I need it up till the 4th order if that is possible.

So when I receive the superposition and let it run over time it gives me the exact representation of the file provided above. If anything is not clear let me know.

The post From a patient we received a periodic wave representing the blood flow (measured in kg/h) over time. appeared first on Vivanswers.org.

 
"Looking for a Similar Assignment? Order now and Get 10% Discount! Use Code "Newclient"

Create an Excel spreadsheet that will be capable of calculating a student’s final grade in this course.

Weighted Grade Book Project

Due Date:

Understanding how weighted averages work will be a very important topic for you in this course, since your grades are determined in this way. In this project, you will create an Excel spreadsheet that can calculate a Chemistry Lab student’s final grade. You will then write a reflection paper answering several questions regarding your project.

In this project you are required to do the following:

  1. Create an Excel spreadsheet that will be capable of calculating a student’s final grade in this course. Keep in mind that weighting is involved in determining the final grade. Your Excel spreadsheet should contain the following:
    • Your name, course name and project name
    • The scores provided on the next page
    • Category averages
    • The weights used to determine the final weighted grade for the course
    • A labeled cell with the Final course grade that uses a formula to calculate the weighted average grade for the course. If a value is changed in your spreadsheet, your final calculation should recalculate. Please limit your use of Excel functions to those used in the course-packet.
    • In addition to correctly calculating the final grade, your spreadsheet should be easy to read. Make sure the spreadsheet it is well-organized, with clear labels, and helpful formatting.
  2. Write a typed reflection paper (minimum one page). Remember that we are looking for responses that are backed by values that support your statements. The explanations should be clear to a broad audience. The paper must include the following information:
    • Your name, course name and project name.
    • An explanation of how the final grade is calculated and how Excel is used in this process.
    • Analyze and reflect on the results for the student data provided. What is the final course score you determined based on the initial data provided? What letter grade is this?
    • This student was given an opportunity to redo every quiz. If the student were to work to earn 100% on every quiz, quantify the impact this change would have on the overall grade. Would the opportunity to improve every homework assignment (while keeping the original quiz scores earned) be a better choice for this student? Explain.
    • The student also has questions about how the Lab Safety assignments were scored. The scores were originally out of varying point values. The student initially received scores of 18/20, 18/50, and 30/30. Note that the scores for these quizzes are listed in the data as percentages equivalent to these ratios. Could calculating the average score as a ratio of points possible to points earned affect the category average for Lab Safety? Explain why or why not.
    • The school’s science department is considering reducing the Quiz category to 10%. Create a new weighting system using the remaining grade categories that would accommodate this change. Explain why/how you chose your new weights. Describe the impact your changes would have for this student.
    • Reflect on the results of your project. What have you learned from doing this project?

In addition to addressing the given statements, your project should:

  • Contain a paper that is well organized and in paragraph form (not just bulleted answers!).
  • Contain a paper that is clear to someone who is not familiar with the project. (i.e. don’t assume that you are writing this to your instructor, make sure anyone could understand your statements.)
  • Give specific values (i. e. quantify statements).
  • Provide support for your statements (e.g. explain how values were found and justify statements).
  • Contain a spreadsheet using the original grade values given below.
  • Use appropriate representations (tables, color, formatting) that will help the reader understand the project.
  • Project should make use of Excel functions.
  • Project should be your original work. This project is to be completed by individual students. Copying someone else’s work is cheating. Sharing your work with someone else is cheating.
  • Submit both an Excel and Word file following your instructor’s directions for submission.

These instructions cover the MINIMUM expectations of this project.

Use the following parameters and scores in your Excel spreadsheet

Create an Excel spreadsheet that will compute the following sample student’s data set for a Chemistry Lab. Assume all scores are out of 100 and that all grades have been recorded for this student.

Homework – 5%

Quiz – 15%

Lab Safety – 5%

Lab 1 – 20%

Lab 2 – 25%

Lab 3 – 30%

72

79

90

80

63

72

71

78

36

     

80

75

100

     

75

69

       

74

65

       

90

67

       

79

62

       

0

61

       

78

82

       

85

         

76

         

63

         

77

         

80

         

85

         

 

Skills

Not Attempted

0

Incorrect Attempt

1-2

Correct Attempt

3

Total

Student’s name is appears on both files

       

Spreadsheet is organized, clearly labeled, and easy to read

       

Course weights are on the spreadsheet

       

Cell that calculates homework average

       

Cell that calculates quiz average

       

Cell that calculates lab safety average

       

Final course grade as an Excel-calculated weighted average

       

Paper is at least one page long, and in paragraph form

       

Spelling/Grammar Checked, appropriate formatting used

       

Project is submitted, on time, to the proper location in IvyLearn

       
 

Skills Total

/30

Quantitative Reasoning

Insufficient

1-2

Developing

3-4

Proficient

5-6

Clearly Articulated

7-8

Total

Explanation of Excel calculation process, including the final score and letter grade earned by this student

         

Analysis of potential to improve assignments; which category would be better for this student

         

Evaluation of lab safety category average

         

Development of new weighting system that reduces quiz weight to 10%

         

Reflection, general conclusions

         
 

QR Total

/40

The post Create an Excel spreadsheet that will be capable of calculating a student’s final grade in this course. appeared first on Vivanswers.org.

 
"Looking for a Similar Assignment? Order now and Get 10% Discount! Use Code "Newclient"

Create a class, and define variables in main(): a) double variable “var_d” and initialize it to the value 1.0898

  1. Create a class, and define variables in main():
    a) double variable “var_d” and initialize it to the value 1.0898
    b) float variable “var_f” and initialize it to the value -1.0862
    c) int variable “var_i” and initialize it to the value -10000
    d) short variable “var_l” and initialize it to the value 99990
  2. Write a program to define 2 int variables vx & vy. Initialize them with value 0; Use
    Scanner object to read from console and assign input values to them respectively.
    Display the values in the format: vx=some-value; vy=some-value. Then swap
    values in vx and vy, and display again.
  3. Write a program to “left rotate” and “right rotate” values in int variables x, y, z, w
    (Example: if x = 1, y = 2, z = 3, z = 4,
    after left rotation, x = 2, y = 3, z = 4, w = 1
    after right rotation, x = 4, y = 1, z = 2, w = 3)
  4. Write a program to calculate the area of a rectangle. You should use Scanner to get
    values of width and height; then calculate the area; and finally display the width,
    height and the area of this rectangle.
  5. Write a program to get from console a number which represents seconds. Convert
    this number of seconds to the format: ?? hours : ?? minutes : ?? seconds and display.
    For example, if you input 4000, you will display message on console:
    4000 seconds = 1 hours : 6 minutes : 40 seconds
  6. Write a program to reads a double number from console using Scanner object, save
    this number into variable celsiusDegree, which represents Celsius degree. Convert
    this number to Fahrenheit degree and display both numbers on console as below:
    Celsius degree: a-celsius-number
    Fahrenheit degree: a-fahrenheit-number
  7. Write a program to calculate the volume of cone (refer below graph and formula.)
    Read number of h from console. This number is measured in feet (1 feet = 0.305
    meters), convert it to meter, calculate and display the result:

The post Create a class, and define variables in main(): a) double variable “var_d” and initialize it to the value 1.0898 appeared first on Vivanswers.org.

 
"Looking for a Similar Assignment? Order now and Get 10% Discount! Use Code "Newclient"

For this project you will be using the NASM assembler to write x86-64 assembly.

For this project you will be using the NASM assembler to write x86-64 assembly.

You can then use your favorite editor to write the program.

To assemble your program:

• Assemble it using: nasm –f elf64 filename.asm

• Link to create executable: gcc –m64 –o filename filename.o

• Execute program: ./filename or filename

Project Description:

Write and submit a NASM assembly language program “string.asm” that:

• Asks the user for an 8 character string.

• A number representing the number of characters that should be cut off the string.

• Displays the unedited string to the user .

• And finally displays the edited string to the user with the number of characters

removed.

Below is a sample run of the program:

Enter Text:

qwertyui

Enter the number of characters to cut off

3

This is what you entered

qwertyui

Here is your text edited

rtyui

Notes:

• The characters will be removed starting with the left most character.

• The characters can be a letter, number, space or others for example #,$ and so

on.

• Remember characters are read in in ASCII.

• You do not need to use Jumps or Loops in this project.

General Project (Hard) Requirements:

• Code that does not compile will receive 50% off

• We are programming for 64 bit Intel Architecture

• This is an individual project and any work submitted should be your own

• You must have a comment at the top of the code detailing what the code does.

• This comment should also include your full name and user ID.

• You must use good coding style with respect to variable names, spacing, labels

and comments.

• Submit only the .asm file named firstname_lastname_string.asm to

blackboard.

• You must submit the code before the deadline – no exceptions!

• You cannot use C/C++ function calls. You have to use system calls

Grading Breakdown: (remember that code that doesn’t compile will not get full credit.

The post For this project you will be using the NASM assembler to write x86-64 assembly. appeared first on Vivanswers.org.

 
"Looking for a Similar Assignment? Order now and Get 10% Discount! Use Code "Newclient"

The goal of this lab is to understand and find simple probabilities and conditional probabilities

Lab Project

LAB Unit 4: Stat Project [(Required/Graded) 25 points) CSLO D, CSLO G]

The goal of this lab is to understand and find simple probabilities and conditional probabilities, and to use the Multiplication Rule and the Addition Rule.

1. List the name for your qualitative variable, V1

 

2. Return to Lab 2. List the name for one of the largest slice in your pie chart. (If a tie, choose either one.)

This name will be the label for Column 1 in your chart.

 

3. Categorize all of the other slices of your graph with a logical label. (This will be very easy if your graph has only two slices; you use the name of the smaller slice. If there are more than two slices, use the labels ‘others’ or a better group name.)

This name will be the label for Column 2 in your chart.

 

4. List the name for your quantitative variable, V2.

 

5. Return to Lab 3, Part 1. What is the median for your V2 ?

 

6. The label for Row 1 will be values at or below the median. For example, if the median $ value of the investment 50 thousands, Row 1 will be labeled ‘investment under ’ or ‘investment equal to 50 thousands or less’ ()

What is your label for Row 1?

 

7. The label for Row 2 will be values above the median. For example, if the median investment is 50 thousands, Row 2 will be labeled ‘over 50 thousands’. (> 50)

What is your label for Row 2?

 

Use the information above to create a table similar to this one.

Qualitative Variable, Political Party

Below are examples (with a sample of n=40)

 

Drug

Others

Total

()(000)

6

8

14

>50(000)

19

7

26

Total

25

15

40

Quantitative

Variable, V2

Age

8. Return to data in Lab 1 and count up the observations for each of the four cells in the table. Place the sums in each cell and be sure that your frequencies add to 100. Also record the totals for each row and each column.

Qualitative Variable, ______________

Quantitative

     

Total

       
       
       

Variable, V2

Find simple probabilities.

9. Compute the probability of being in Row 1. Use the language of your data. (For example, P () = ).

10. Compute the probability of being in Row 2. Use the language of your data. (For example, P(>50) = ).

11. Compute the probability of being in Column 1. Use the language of your data. (For example, P(Drug) = ).

12. Compute the probability of being in Row 1 and Column 1 using the appropriate frequency from your table. Use the language of your data. (For example, P(Drug and) = ).

Find conditional probabilities.

13. Find the probability of being in Row 1, given Column 1. Use the language of your data.

14. (a) Comparing the probability in # 13 to the probability in # 9, decide if Rows and Columns are independent. (b) Clearly explain your reasoning, using a complete sentence and one of these phrases: equally likely, more likely or less likely.

Example

Your Data

13. P(, given Drug) =

14. P() = 0.350

Since P(, given Drug) is less than P(), Drug are less likely to be . These are dependent events.

13.

14.

15. Find the probability of being in Column 1, given Row 2. Use the language of your data. (For example, P(Drug, given >50).

16. comparing the probability in #15 to the probability in #11, determine if Rows and Columns are independent. Clearly explain your reasoning, using a complete sentence and one of these phrases: equally likely, more likely or less likely.

Example

Your Data

15. P(Drug, given >50) =

16. P(Drug) = 0.625

Since P(Drug, given > 50) is higher than P(Drug), investment >$50 are more likely to be Drug. These are dependent events.

15.

16.

Multiplication Rule

17. If you choose two subjects from your sample, use the Multiplication Rule to find the probability that they are both from Column 1.

Example

Your Data

P(Both Drugs) =

P(Drug and Drug) = =0.385

17.

Addition Rule

18. Use the Addition Rule to find the probability of being in Row 1 or Column 1.

19. Use the Addition Rule to find the probability of being in Row 1 or Row 2.

Example

Your Data

18. P(investment $ or Drug ) =

19. P(Investment $ or > 50) =

18.

19.

20. Consider your last two answers and list two mutually exclusive events for your data. Explain your reasoning.

The post The goal of this lab is to understand and find simple probabilities and conditional probabilities appeared first on Vivanswers.org.

 
"Looking for a Similar Assignment? Order now and Get 10% Discount! Use Code "Newclient"

This assignment is based on Exercise 7.21 (Turtle Graphics)

Assignment 5

This assignment is based on Exercise 7.21 (Turtle Graphics) from the textbook (but is not really the same). Please follow the instructions as given below.

This is a more challenging but mainly a longer exercise than the previous exercises. The steps involved are not particualry complex, but there is quite a number of separate steps involved in getting to a working solution.

Take an early look at what this exercise requires, and be prepared to ask questions while there is still time to get answers. Note that this program is a command-line style program, not a GUI program.

Please submit at least the following file for the assignment (together with any additional Java source files you find necessary):

  • TurtleGraphics.java, which implements the TurtleGraphics class with just the two public methods, enterCommands, and executeCommands, as described below. The supplied test program (TurtleGraphicsTest) expects to find the TurtleGraphics class in the same package as the test program.)

Note: that this assignment requires only that this one TurtleGraphics class (plus any other classes you might create to support it) to be submitted. There is a provided test program and a data package (edu.frontrange.csc240.a5.data) that supplies all the needed inputs to test and verify the public implementation of this class.

You may define and use other methods within the TurtleGraphics class. These methods should be private. Such private methods do not affect the public interface of the class.

The same test program will be used to evaluate the submitted work. The test program is described below.

A “skeleton” (i.e., initial but incomplete) version of the class TurtleGraphics, and the complete test program, TurtleGraphicsTest, are supplied in either of the two zipfiles described in the About the Assignment topic, where the content of each is discussed in more detail. There are, also in each file, the test data used by the TurtleGraphicsTest program, a Debug class that you may want to use, as well as all the accompanying Javadoc.

The Scenario

The concept of “turtle graphics” is based on an invention made in 1967, in a language called “Logo” ( https://en.wikipedia.org/wiki/Logo_%28programming_language%29). The idea is that the “turtle” is a mechanical robot that walks around the floor of a room. It carries a “pen.” If the pen is down, it marks a track on the floor when it moves. If the pen is up, it just moves, leaving no mark. The robot is controlled by a “turtle program,” which is a sequence of commands, each controlling an action of the turtle. In this exercise, the commands are represented by integer values. For this program, the floor is assumed to be 20 by 20 units (although the program should be written so that this can be easily changed, by, for example, defining a constant, say, FLOOR_SIZE).

There are two phases to the processing of the commands of a turtle program, just as there is with any programming language.

  • The first phase is reading the program, checking it for correct form and syntax, and storing it in some defined but convenient “compiled” form for later execution.
  • The second phase is the execution, where the “compiled” form is read and the actions indicated are actually taken.

The class to be written, TurtleGraphics, implements both of these phases, by means of its two defined methods.

The two methods of the TurtleGraphics class

The definition of the commands is reproduced here:

Table of Commands
Command Meaning
1 Pen up
2 Pen down
3 Turn right by 90°
4 Turn left by 90°
5,d Move in the current direction “d” spaces
6 Display (print) the current state of the floor
9 Indicates the end of the program
(nothing after this command is part of the
program, and is to be ignored)

There are two public methods of the TurtleGraphics class,

  • enterCommands, which is the “compiler,” and reads the commands of the program and decides whether they are validly formed or not, and the
  • executeCommands method, that actually carries out the steps described under Meaning in the above table.

enterCommands method 

The enterCommands method acts as the “compiler” for a turtle program. Each call to this method enters a new program, overwriting any previous program. The signature and return value of the method is:

public List<String> enterCommands(Scanner source)

The Scanner parameter passed to this method is the source of the “turtle program.” The integer values representing the commands may be obtained from this Scanner instance as has been done for any Scanner seen in previous assignments.

When passed to the enterCommands method, the method should analyze the values delivered by the Scanner.

The tasks to be carried out by the enterCommands method are:

  • to see that the input consists only of the recognizable and valid commands (see the table above);
  • that a “move” command is followed by another integer value (which represent a number of steps of movement); after a “move” command, there must be another integer or the program has an error;
  • to check the program is terminated properly. The program must end with the proper end-of-program command. (Any data beyond this is “junk” and must be ignored)
  • the method should create informative messages; in particular, there should be error messages for any problem recognized in the program (see the examples in the About the Assignment topic). The messages (which are Strings) must be added to a List, and this List is the value to be returned by the method. (The test program will take care of actually printing the messages).
  • The method may also, if you wish, echo the values input as a “listing” of the program, by adding a representation of those values to the same List (as is done in the samples shown in the About the Assignment topic.
  • the enterCommands method should transform the program into a more convenient representation, i.e., more convenient than having to re-analyze the commands read from the Scanner, and at the same time store this more convenient representation in an internal structure ready for execution (see the executeCommands method below).

The TurtleGraphics class is not instantiated again for each new program (it does not have a constructor with any defined requirements). This requires that the enterCommands method must be “serially reusable,” meaning that it should reset all the state of the instance (the variables) that need to be in an initial state in order to process a program.

executeCommands method

The program that was entered may be “executed.” The program is executed by calling the executeCommands method, which is also done by the test program. (Do not call the executeCommands method from the enterCommands method.) The program created in one instance of the TurtleGraphics class may be executed as often as desired. The signature and return value of the method is:

public boolean executeCommands()

This method does not need any parameters, as there is no further input required and it will execute the program most recently processed and stored by the enterCommands method. Executing the program actually does the work to move the turtle over the “floor,” and as it moves, if its pen is down, it makes a mark, otherwise it just continues moving and leaves whatever is already on the floor undisturbed and unchanged. The executeCommands returns a value of false if there is no valid program to execute or if some error arises in the execution of the program.

The floor and how the turtle moves

Assume that the turtle drawing is in a box that has a floor 20 units by 20 units in size (as mentioned above). You yourself may specify what you want the behavior to be when the turtle gets to the edge of the box (since this is not mentioned in the problem description—your choice—but you must write some commentary to say what you have decided the turtle will do when reaching a boundary, so it may be determined whether you have done it as you intend).

When a “display” (that is, a “6”) command is found in the program, the current state of the floor is rendered to the standard output. (A single “*” is suggested in the textbook as a character to represent a mark on the floor, but two characters such as “* ”—an asterisk followed by a space—gives a much better appearance.)

With the pen “down,” the turtle marks the floor only when it is asked to move (not when the pen is put down). When the turtle starts a move it marks the current position where it is, and then moves one position in the required direction (but does not mark the floor again). This is repeated for every position it moves. That means, if the turtle is required, say, to move 3 units, it will mark the current position at the start of the move, and also will mark the next two positions, but will be left over the position after that without marking it. (So, with a move of 3 units, only three positions are marked, not four.)

With the pen “;up”, the turtle simply moves, making no mark, and not disturbing any mark over which it may move.

Format of the Turtle Program

Spaces, end-of-line, blank lines have no significance in a turtle program (just like in a Java program) other than to separate the numbers that make up the commands and distances. A single comma immediately after a number is like a single space. A comma may be replaced by a single space, and the program will be unchanged, and will produce exactly the same drawing. The single comma is allowed in a turtle program just for visual effect, intended to make it easier to read the program when a command has a related move value. It does not have to be there, so need not be checked. All of the five following one-line programs (that draw the box shown in the textbook) are equivalent.

2 5,12 3 5,12 3 5,12 3 5,12 1 6 9

2   5 12 3 5 12    3 5 12 3 5,12  1  6 9

2  5  12  3  5  12  3  5  12  3  5  12  1  6  9

2, 5,12 3, 5,12 3, 5,12 3, 5,12 1, 6, 9, 24,

2, 5  12 3,  5, 12,  3 5, 12,  3 5,12 1 6     9

Initial conditions

When the turtle starts executing a program, it is to be at the point 0,0 (top left-hand corner) of the floor. When the turtle moves, it moves in the direction it is currently facing. The initial direction is in the positive x direction, that is, to the east. Also, the pen must be initially up, so that it makes no mark on the floor.

Test Program

The supplied test program tests drawing samples additional to just the textbook example. These test programs are shown in the About the Assignment topic.

For more information about test program supplied, also see the topic About the Assignment. If you wish, you may write additional test programs and add them to the list of programs. You will note that the test program uses some inputs that are intended to be incorrect, in order to assess that the TurtleGraphics class deals correctly with such problems.

The post This assignment is based on Exercise 7.21 (Turtle Graphics) appeared first on Vivanswers.org.

 
"Looking for a Similar Assignment? Order now and Get 10% Discount! Use Code "Newclient"

Linear Search vs Binary Search

Linear Search vs. Binary Search Before you embark on this, you should already be aware of Linear Search and Binary Search There are two basic ways of doing a search in an array. There is the linear search, and then there is Binary Search. Linear Search In this type of search, the items in an […]

The post Linear Search vs Binary Search appeared first on Custom Essay Writers | Order Essays, Term Papers, Theses, and Research Papers – From $10.

 
"Looking for a Similar Assignment? Order now and Get 10% Discount! Use Code "Newclient"