
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A homework assignment for a university-level electrical engineering course, elec 2220. Students are required to write a program in any programming language to read and sort five names entered from the keyboard. The assignment includes examples of expected input and output, and instructions for handling capitalized and lower-case letters. Students are also asked to discuss the program's behavior for a specific example and modify it to handle an arbitrary number of names.
Typology: Assignments
1 / 1
This page cannot be seen from the preview
Don't miss anything!

The first assignment was a program to manipulate numeric data. This assignment is a program to manipulate non-numeric (ASCII) character data.
Write a short program (in any language) that will read five names from the keyboard, and then print the names in alphabetical order.
Run your program twice, with the names entered exactly as listed below, and in the given order. One has all of the names capitalized, and the second has a mixture of upper and lower-case letters. Turn in a printout of your program and the two sorted lists printed by the program for the two runs.
In addition, discuss: (1) whether the program produced what you expected for Example 2, and (2) how you would modify the program to handle any number of names.
Example 1: Enter Sorted Susan Bob Ralph George Marie Marie Bob Ralph George Susan
Example 2: Enter Sorted Susan? RALPH marie bob GeorGe