Ruby Problem Create a template for an email letterhead with the following variables. The letter head will...

90.2K

Verified Solution

Question

Programming

Ruby Problem

Create a template for an email letterhead with the followingvariables. The letter head will have format place holders for:

Company name

Street address

City, State and zip code

Telephone

Email

Web site URL

Use the array of data below to fill your template placeholders:

Run your finished script and capture the output to a file namedemail_template.txt.

# Two pieces of data in one array (multi dimensional array)contact_data = [ ['Company 1','123 Main Street', 'Anytown','Anystate', 88888,'444-444-4444','[email protected]','https://company1.com'], ['Company 2','77 Market Street', 'San Francisco','California', 94111,'415-444-4444','[email protected]','https://company2.com']]######### CREATE YOUR EMAIL TEMPLATE HERE #########email_template = \"\"# Process the data one array at a timecontact_data.each do |arr|  # your code goes here.end

Your output should end up looking something like this:

 Company 1 123 Main Street Anytown, Anystate 88888 Tel: 444-444-4444 Email: [email protected] URL: https://company1.com------------------------------ Company 2 77 Market Street San Francisco, California 94111 Tel: 415-444-4444 Email: [email protected] URL: https://company2.com------------------------------

Answer & Explanation Solved by verified expert
3.8 Ratings (576 Votes)
Answer Two pieces of data in one array multi dimensionalarraycontactdata Company 1123    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students