Program / Task Name:

   Corporate Name Changer

Level:

 

 Novice

Point Value:

 

 4

 

Task Description

Congratulations!  Your company, WidgetCo, has just merged with the much larger SuperMegaCorp, but don't worry, you've got a new assignment! WidgetCo has hundreds and hundreds of press releases and user manuals that mention the company by name.  But since you're now part of SuperMegaCorp, all those documents need to be changed.

Your assignment is to write a program to read in a text file, find and replace every occurrence of "WidgetCo" with "SuperMegaCorp", and write out the updated document to another file.  The file will be a simple ASCII text file containing up to 2 pages of text.

Program Input

The input file, prob04.in, contains a press release you need to modify:

WidgetCo, Houston, TX - April 1, 2003.  For immediate release.

WidgetCo announced today the immediate availability of the UltraWidget 3000, the first all-titanium widget in a 26cm diameter form factor.  The UltraWidget 3000 not only increases cross-phase velocity, but also reduces temporal drag by 16% (when compared to other widgets in its class).  WidgetCo Vice President Bill Hottaire said this morning that "the WidgetCo UltraWidget 3000 is the most advanced non-carbon-fiber widget available".  The UltraWidget 3000 will be available from all WidgetCo dealers by the end of September.  Pricing has not been finalized, but is expected to be under $7000 per widget in quantities of 1000 or more.

Program Output

Change each instance of WidgetCo to SuperMegaCorp and output the modified press release to prob04.out.

SuperMegaCorp, Houston, TX - April 1, 2003.  For immediate release.

SuperMegaCorp announced today the immediate availability of the UltraWidget 3000, the first all-titanium widget in a 26cm diameter form factor.  The UltraWidget 3000 not only increases cross-phase velocity, but also reduces temporal drag by 16% (when compared to other widgets in its class).  SuperMegaCorp Vice President Bill Hottaire said this morning that "the SuperMegaCorp UltraWidget 3000 is the most advanced non-carbon-fiber widget available".  The UltraWidget 3000 will be available from all SuperMegaCorp dealers by the end of September.  Pricing has not been finalized, but is expected to be under $7000 per widget in quantities of 1000 or more.

 

   
  (c) 2004 Hewlett-Packard Company