Write a program to read the file, Programming Languages

Suppose you have a ?le orase of city and country names, like this:

Cluj, Romania
Debrecen, Hungary
Klagenfurt, Austria
Berlin, Germany
Szeged, Hungary
Budapest, Hungary
Lintz, Austria

Write a program towns.pl such that when it will read from the ?le orase will produce a sorted output with each country mentioned once, followed by an alphabetical list of the cities in that country:

Austria: Klagenfurt, Lintz.
Hungary: Budapest, Debrecen, Szeged.
Germany: Berlin.
Romania: Cluj.

Run your program against any other ?le (say, myfile) with structure similar to orase. Then execute your program against both ?les (orase and myfile) simultaneously.

Posted Date: 3/12/2013 1:44:44 AM | Location : United States

Related Discussions:- Write a program to read the file, Assignment Help, Ask Question on Write a program to read the file, Get Answer, Expert's Help, Write a program to read the file Discussions

Write discussion on Write a program to read the file
Your posts are moderated
Related Questions
Question: (a) How does HTML allow you to: (i) turn an image into a clickable hyperlink? Include code to switch off the default border (ii) convert the above hyperlink i

Windows Presentation Foundation Designed by Microsoft Technologies, the Microsoft Technologies windows Display Groundwork (or WPF) is a computer-software graphic subsystem for maki

Explain the While Statement - Computer Programming? A 'while statement' is an entry controlled loop statement. When the expression is calculated and the condition is not satisf

Question: (i) All Security authentication mechanism that run on the TRU64 Unix Operating system run under the Security Integration Architecture (SIA ) layer. Explain with di

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

1.) Write a flowchart and program to do the following: A pressure sensor in a cooling system measures the pressure of the refrigerant and is connected to Port -1 of the 8051. If th

i have a database having field name title and comm. I want to search by name and get the all data remaining title and comm(comm is integer)

Programming Project Specification: IRC or Internet Relay Chat is an application that lets multiple users communicate via text messages with each other in common "virtual" rooms.

LALR Parser: Rule Table - Contains definitions of production rules within the grammar. Attributes: Count - Number of production rules in the table Child items: