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

pseudocode please! Assignment 5B: Moneyball: Part 2. Similar to the previous assignment, you’re going to read...
pseudocode please! Assignment 5B: Moneyball: Part 2. 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...
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...
i need a pseudocode for a program in java that will convert dollars into euros and...
i need a pseudocode for a program in java that will convert dollars into euros and japanese yen using the print and prinln methods an if, if -else, statement a switch statement a while statement utilizes the file class uses the random class and random number generator and uses at least three methods other than main
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...
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 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...
I need a pseudocode and UML for this program. import java.util.Random; public class SortandSwapCount {   ...
I need a pseudocode and UML for this program. import java.util.Random; public class SortandSwapCount {    public static void main(String[] args) {        //Generate random array for test and copy that into 3 arrays        int[] arr1=new int[20];        int[] arr2=new int[20];        int[] arr3=new int[20];        int[] arr4=new int[20];        Random rand = new Random();        for (int i = 0; i < arr1.length; i++) {            //Generate random array...
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
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT