Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

PART A: Write all code in the main function:

  • make a dictionary for nine Tampa Bay Rays (see below). Use the player names as keys and a list for each value. See page 374.
  • Each value list should hold the position played by the player, the batting order, and current batting average.
  • When the dictionary is complete, use a for loop to display the dictionary keys and values.
  • Next, use loop(s) to print the "lineup" (the dictionary in batting order). Duplicate the sample output for full points.
  • Pull Rivera and DeJesus. Substitute Wilson as catcher and Beckham as DH (see sample output).
  • Reprint the new lineup.

SAMPLE OUTPUT

Rays starters

DeJesus ['DH', 6, 299]
Loney ['1B', 4, 222]
Rivera ['C', 9, 194]
Forsythe ['2B', 5, 304]
Souza Jr ['RF', 2, 229]
Longoria ['3B', 3, 282]
Cabrera ['SS', 7, 214]
Kiermaier ['CF', 1, 240]
Guyer ['LF', 8, 274]

Today's lineup

Batting 1 : CF Kiermaier ,current avg: 240
Batting 2 : RF Souza Jr ,current avg: 229
Batting 3 : 3B Longoria ,current avg: 282
Batting 4 : 1B Loney ,current avg: 222
Batting 5 : 2B Forsythe ,current avg: 304
Batting 6 : DH DeJesus ,current avg: 299
Batting 7 : SS Cabrera ,current avg: 214
Batting 8 : LF Guyer ,current avg: 274
Batting 9 : C Rivera ,current avg: 194

Lineup changed

Batting 1 : CF Kiermaier ,current avg: 240
Batting 2 : RF Souza Jr ,current avg: 229
Batting 3 : 3B Longoria ,current avg: 282
Batting 4 : 1B Loney ,current avg: 222
Batting 5 : 2B Forsythe ,current avg: 304
Batting 6 : DH Beckham ,current avg: 200
Batting 7 : SS Cabrera ,current avg: 214
Batting 8 : LF Guyer ,current avg: 274
Batting 9 : C Wilson ,current avg: 152

PART B: Write all code in the main function:

  • create an empty set.
  • use a loop to add 10 random integers, all from 10 to 30 inclusive, to the set.
  • use another loop to process the set:
    • display all elements of the set on one line separated by ** (see sample outputs).
    • count how many elements are even and how many elements are odd.
  • display the counts.

SAMPLE OUTPUT

12**16**17**18**20**21**22**23**24**28**

Set has 7 even numbers and 3 odd numbers

SAMPLE OUTPUT

10**12**14**16**18**20**21**22**25**26**

Set has 8 even numbers and 2 odd numbers

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92186611
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Computer Engineering

The next four questions are based on the following you

The next four questions are based on the following: You invested a lump sum of $50,000 in a new company ten years ago and left it there without any further investments and now, today, the company listed on the stock exch ...

Question suppose that you have a set of n files that have

Question : Suppose that you have a set of n files that have to be copied on 1GB USB drives. You can assume that the file sizes are known and always less than or equal to 1GB. The objective is to use the minimum possible ...

What is a survey and pros and cons of using this method to

What is a Survey and pros and cons of using this method to collect data are? Have you done a survey? How successful were your results?

Security breachthe administration at st johns hospital

(Security Breach) The administration at St. John's Hospital takes pride in its sound policies and procedures for the protection of confidential client information. In fact, it serves as a model for other institutions in ...

There is a small company which in some months maintains an

There is a small company which in some months maintains an office in Aukland (code A) and in others in Brisbane (code B), and moves back and forth between these two cities (they can only afford to have one office operati ...

What is the transmission type transmission form

What is the Transmission Type, Transmission Form, Transmission Speed, Address for Transmission and Collusion for hubs?

Introduction to software developmentmenu-driven

Introduction to Software Development Menu-Driven Programs TASKS: Language translator. Design a program that display the following menu: Select a language and I will say Good Morning English Italian Spanish German End the ...

String c is considered to be an interleaving of strings a

String C is considered to be an interleaving of strings A and B if it contains all (and only) the characters of both A and of B and their respective order is preserved in C. For example, C = aacabbaa is an interleaving o ...

Can you give me short cut of using excel word access share

Can you give me short cut of using excel, word, access, share point, and powerpoint microsoft, I am always have to rely on the back and forth, fleepng the pages, it is possible

Question suppose there is exactly one packet switch between

Question : Suppose there is exactly one packet switch between a sending host and a receiving host. Assume each link has a distance 1, 250 Km with propagation speed 2.5 times 10 8 mps. Link 1 has a transmission rate 10 Mb ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As