Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

Question

MUST BE IN PYTHON PROGRAMMING CODE!!!!! NO C++ or Java!!

Directions: Design a program with a loop that lets the user enter a series of names (in no particular order). After the final person’s name has been entered, the program should display the name that is first alphabetically and the name that is last alphabetically. For example, if the user enters the names Kristin, Joel, Adam, Beth, Zeb, and Chris, the program would display Adam and Zeb.

Additional requirements: Note that the possible set of input values can include negative, 0, or positive values, but not the sentinel value of -99.

DESIGN HINT: • When determining the largest (or smallest) value in a set of numbers, remember to use variables to keep track of the current largest (or smallest) number found thus far. These variables can then be used as a comparison to each subsequent input number to see if the new number is larger (or smaller) than the current largest (or smallest) number and updated appropriately. At the end of all input, these variables will then contain the largest (or smallest) of all values input. Be careful on variable initialization—you will need to use a value that is in the set of possible input values. The IPO chart for this program is given below:

Input:

Series of numbers (-99 indicates end of input) 

Processing:

Read user input numbers while input number does not equal -99. Keep track of largest and smallest numbers input by comparing each user input number with current smallest and largest numbers. Reset largest and smallest values based upon user input: 

If inputNum < smallest Then 

Set smallest = inputNum 

Else If inputNum > largest Then 

Set largest = inputNum 

End If 

Output: 

Largest and smallest number entered 

Additional Problem Requirements:

• Create a main module as your program start module. Include comparisons to determine highest/lowest input values in the main module.

• Only use simple data types, not arrays, in your implementation (i.e. do not use Python lists or min/max functions).

• Include a separate module that uses pass by value parameters to descriptively display the passed largest and smallest numbers. Call this module from your main module with appropriate arguments.

• Do not use global variables.

Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education