Question

In: Computer Science

I need this in pseudocode: Similar to the previous assignment, you’re going to read in the...

I need this in pseudocode:

Similar to the previous assignment, you’re going to read in the number of years the player played and the starting year of that player – followed by the statistics for those years. This time, however, you’re going to print out the years from worst to best in sorted order. Hint: this will require a second array to store years. If you can sort one array, can you sort both? Sample Output #1: Enter the number of years: 5

Enter the starting year: 2003

Enter stat for year 2003: 5

Enter stat for year 2004: 4

Enter stat for year 2005: 7

Enter stat for year 2006: 1

Enter stat for year 2007: 3

2006|2007|2004|2003|2005|

Sample Output #2: Enter the number of years: 6

Enter the starting year: 1879

Enter stat for year 1879: 70

Enter stat for year 1880: 89

Enter stat for year 1881: 111

Enter stat for year 1882: 65

Enter stat for year 1883: 105

Enter stat for year 1884: 98

1882|1879|1880|1884|1883|1881|

Solutions

Expert Solution

PseudoCode:

1.start
2.print "Enter number of years"
3. Read n
4.print "Enter starting year"
5.Read s
6.Declare two arrays of type integer
Declare original[n],sort[n]
7.Declare i,j,temp
8.Define j<-0,temp<-0
9.for i=s to s+n
BEGIN
       print "Enter stat for year ",i
       Read temp
       original[j]<-temp
       sort[j]<-temp
       j<-j+1
   END
10. Sort the array 'sort'
11. for i=0 to n
   BEGIN
       temp<-get index of sort[i] from original[] array
       print "temp+s"
       print "|"
   END
12.Stop

Screenshot:

The screenshot is attached for better understanding of indentations.


Related Solutions

Buh-RING IT! For this assignment, you’re going to simulate a text-based Role-Playing Game (RPG). Design (pseudocode)...
Buh-RING IT! For this assignment, you’re going to simulate a text-based Role-Playing Game (RPG). Design (pseudocode) and implement (source) for a program that reads in 1) the hero’s Hit Points (HP – or health), 2) the maximum damage the hero does per attack, 3) the monster’s HP and 4) the maximum monster’s damage per attack.   When the player attacks, it will pick a random number between 0 and up to the maximum damage the player does, and then subtract that...
MBA 5010 Week 4 Integrative Assignment This week, you’re going to build on the knowledge you...
MBA 5010 Week 4 Integrative Assignment This week, you’re going to build on the knowledge you gained. Your assignment is to deconstruct the economics underlying Airbnb. Specifically, I want you to answer the following questions: • Does Airbnb capture a sufficient amount of any value generated to remain a viable business? The purpose of this question is to provide you an opportunity to demonstrate your understanding of the economics of value creation. So, emphasize this aspect of your answer. Try...
PLEASE READ ALL OF THESE INSTRUCTIONS BEFORE BEGINNING THIS ASSIGNMENT. For this assignment, you need to...
PLEASE READ ALL OF THESE INSTRUCTIONS BEFORE BEGINNING THIS ASSIGNMENT. For this assignment, you need to analyze the information below from BOTH the management AND the employee perspective. This information pertains to a labor union in a simulated/made up/not real firm in Glen Ellyn. The first part of your information relates to Management – the second part relates to the Labor Union employees. I have provided you with information from the last union negotiations at the plant in 2016. It...
For this assignment, I'm going to give a series of problem statements and you need to...
For this assignment, I'm going to give a series of problem statements and you need to state whether the problem would be more appropriately solved with a linear or logistic regression. You also have to give a short defense of why this is the correct regression for each one (only need a sentence or two for each). I have a dataset of soil sample attributes (acidity, density, clay content, etc.) and whether Kentucky bluegrass successfully grew in the soil. I...
You determined in the previous assignment the exact volume of 50X TAE that you will need....
You determined in the previous assignment the exact volume of 50X TAE that you will need. I suggest that you make 40 ml of 50X TAE so that you have some extra (just in case you need it). The recipe for one liter of 50X TAE is as follows: ¥ 242g Tris base ¥ 57.1 ml glacial acetic acid ¥ 100 ml 0.5 M EDTA pH 8.0 9. Provide a recipe for 40 ml of 50X TAE. 10. When you...
For an assignment I need to write a 5 page essay about any topic. I need...
For an assignment I need to write a 5 page essay about any topic. I need some some thinking of a topic and outlining of the topic.
Need to read the article from the link I provided and need to come up with...
Need to read the article from the link I provided and need to come up with a 2-3 page summary and critique and providing real life examples. https://motherboard.vice.com/en_us/article/qkv5a3/apocalypse-neuro-why-our-brain-cant-process-the-planets-gravest-threats or https://www.islamicboard.com/general/134342488-apocalypse-neuro-brains-dont-process-gravest-threats-humanity.html
I read somewhere that sometimes it is better going with projects that have a higher NPV...
I read somewhere that sometimes it is better going with projects that have a higher NPV even with high risk. How does time play a role into this equation? Because if you have a high NPV but the project is shorter and more risky, should a business take more account for the time basis as well?
B has to be matched with A so please I need both in Java. the previous...
B has to be matched with A so please I need both in Java. the previous project mean A A. Write a class that maintains the top ten scores for a game application, implementing the add and remove methods but using a singly linked list instead of an array. B. Perform the previous project, but use a doubly linked list. Moreover, your implementation of remove(i) should make the fewest number of pointer hops to get to the game entry at...
To complete each assignment, you will need to read the case study. Assume that the client...
To complete each assignment, you will need to read the case study. Assume that the client described in each case study meets criteria for a DSM-5 disorder. You will then consult the DSM-5 criteria and write 1-2 detailed paragraphs in which you assign a primary diagnosis for the client and justify that diagnosis. In this section you should reference EACH of the DSM-5 criteria for the diagnosis you are assigning and provide evidence from the case study for or against...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT