ELEC 2220 Homework Assignment 2: Sorting ASCII Character Data, Assignments of Electrical and Electronics Engineering

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

Pre 2010

Uploaded on 08/18/2009

koofers-user-aw6
koofers-user-aw6 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ELEC 2220 - Homework Assignment #2
Prerequisite Review
Due Friday, August 22
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

Partial preview of the text

Download ELEC 2220 Homework Assignment 2: Sorting ASCII Character Data and more Assignments Electrical and Electronics Engineering in PDF only on Docsity!

ELEC 2220 - Homework Assignment

Prerequisite Review

Due Friday, August 22

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