Novice Challenge 3: What Do I Owe You?
Office Programs Required |
Microsoft Excel 2007 |
Goldfish Awarded |
10 |
Deadline for Submission |
Friday, April 24, 2009 (8:00 AM Pacific Daylight Time) |
Files Required |
NoviceChallenge03.xlsm in the OfficePalooza Challenge Pack. |
When you open NoviceChallenge03.xslm in Microsoft Office Excel, you’ll see a spreadsheet with information (fictional, of course), about authors and their book sales. Like this:
Notice that column A designates whether an author is an experienced author (E) or a new author (N). In our fictional publishing company, the amount of royalties an author receives depends on his or her experience. A new author receives 10% of the book sales; an experienced author receives 15%.
To correctly solve this challenge, write code that – for each author – determines the percentage an author should receive, uses that percentage to calculate the royalties, then puts the royalty amount in column D.
When you open the Visual Basic editor (which you can do by pressing Alt+F11), there should already be a window open with the subroutine CalculateRoyalties showing. Insert your code into this subroutine. (If you don’t see this subroutine, double-click on Sheet1 in the Project pane on the left under VBAProject (NoviceChallenge03).) Do not create any other subroutines – all your code should go in here.
Important: Do not add code to save the spreadsheet.
Submitting Your Entry
The OfficePalooza sweepstakes is over, but you’re welcome to try the challenges and learn on your own. Good luck!