Frenchness concentration

Challenge
No

About this exercise

This is another in a continuing series of exercises about my fave podcast, Nobody Listens To Paula Poundstone. It's dedicated to my fellow Nobodies.

Adam Felber is a writer, musician, and cohost of Nobody Listens To Paula Poundstone. He's on every show.

Recently, he fainted at a party full of French people. Medical tests found Adam is allergic to Frenchness. Any more than 2.85 Frenchness per cubic meter in the room, and Adam's in danger of fainting.

Write a VBA program to estimate the concentration of Frenchness in a room. Download this workbook as a starting point.

Here's how your worksheet should start:

Start

The user types values in the People cells, and clicks Run. Here's some output:

Output

Here's some more output:

More output

Frenchess per cubic meter is the number of people from Paris (2 in the example above) times Paris' concentration (0.11) plus the number of people from Nice (3 in the example) times Nice's concentration (0.18), etc.

Requirements:

  • Don't put the concentration values (like 0.11) directly in your code. They may change over time.
  • Follow the secluded Cells rule.
  • Use the IPO pattern. Add comments identifying each section, e.g., 'Input.
  • No lines of code should be more than 60 characters long. Check the dialogs lesson if you need a reminder.
  • The usual standards apply (like good variable names, and Option Explicit).

Upload your solution as usual.

Attachments