Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write correct pseudocode (not an actual C program) for the following: 1. Write a

ID: 3770026 • Letter: W

Question

Write correct pseudocode (not an actual C program) for the following:

1. Write a program that will read in five positive integers (one at a time) and print out the largest and smallest number of the five numbers. The program should read the numbers one at a time. (Extra credit: Write the program such that it takes an unlimited amount of positive integers.)
2. Write the pseudocode for the manager of the Jeter County softball team, who wants to compute batting averages for his players. A batting average is computed as hits divided by at-bats, and is usually expressed to three decimal positions (for example, .235). The program should prompt the user for a player jersey number, the number of hits, and the number of at-bats. The program should calculate the batting average. Once calculated, the program should print “excellent hitter”, the jersey number, the batting average, number of at-bats and number of hits for all players with a batting average greater than .400. For all other players, the program should print the players jersey number and batting average. The program accepts players continuously until 0 is entered for the jersey number. Use appropriate modules, including one that displays “End of job” after the sentinel is entered for the jersey number. Hint: You should read the jersey number in the housekeeping module

Explanation / Answer

1. Reader rdr = new Reader(input);
int lowest=0, highest=0;
if (rdr>0) lowest=rdr;

while(rdr != "q") {
if (rdr<0) println("please enter a positive integer");
else if (rdr>highest) highest=rdr;
else if (rdr<lowest) lowest=rdr;
}
println("the lowest and highest integers, respectively, are: (" + lowest + ", " + highest + ")");

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote