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...
For this assignment I need to use information from a previous assignment which I will paste...
For this assignment I need to use information from a previous assignment which I will paste here: #ifndef TODO #define TODO #include <string> using std::string; const int MAXLIST = 10; struct myToDo {     string description;     string dueDate;     int priority; }; bool addToList(const MyToDo &td); bool addToList(string description, string date, int priority); bool getNextItem(MyToDo &td); bool getNextItem(string &description, string &date, int &priority); bool getByPriority(MyToDo list[], int priority int &count); void printToDo(); #endif #include <iostream> #include "ToDo.h" using namespace std; myToDo ToDoList[MAXLIST];...
Take the pseudocode that you developed in your previous assignment - and convert it into a...
Take the pseudocode that you developed in your previous assignment - and convert it into a working program. Or if you think of a better way of creating a working program – such as what we discuss in class. The task was: Write the pseudocode for helping a cashier give you the correct change. Assume that a person brings hundreds to pennies to you and wishes to the receive quarters, dimes, and nickels back. There is a single input of...
I NEED THIS IN PSEUDOCODE: SWITCH/CASE 2 - Complete the pseudocode below by including a SWITCH...
I NEED THIS IN PSEUDOCODE: SWITCH/CASE 2 - Complete the pseudocode below by including a SWITCH statement that takes the user input (an integer between 26-30) and prints out a count up in its English equivalent. For example: if the user inputs “26”, the code will print “twenty-six”, “twenty-seven” on the next line, and so on up to “thirty”. If the user inputs “30”, the code will print “thirty” and finish. CREATE inputNum PRINT ("Please enter a number between 26-30...
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...
DO THIS IN C# (PSEUDOCODE)Social Security Payout. If you’re taking this course, chances are that you’re...
DO THIS IN C# (PSEUDOCODE)Social Security Payout. If you’re taking this course, chances are that you’re going to make a pretty good salary – especially 3 to 5 years after you graduate. When you look at your paycheck, one of the taxes you pay is called Social Security. In simplest terms, it’s a way to pay into a system and receive money back when you retire (and the longer you work and the higher your salary, the higher your monthly...
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...
I need assistance on this problem in Pseudocode and in C++ Program 1: Stay on the...
I need assistance on this problem in Pseudocode and in C++ Program 1: Stay on the Screen! Animation in video games is just like animation in movies – it’s drawn image by image (called “frames”). Before the game can draw a frame, it needs to update the position of the objects based on their velocities (among other things). To do that is relatively simple: add the velocity to the position of the object each frame. For this program, imagine we...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT