CSCI 112
Fall 2026 - Assignment 4
Submit deadline: 13:00, 15 October 2026, Thursday
Objectives:
- Learn to develop a simple VBA program
References:
Problem Description
A hypothetical university, such as VIU, charges each domestic student
enrolled in its credit-based undergraduate programs tuition and fees.
The tuition is calculated as $173.12 per credit.
And students are also charged the following four types of fees:
- Lab Fees: For the courses with
compulsory lab, the university charges $24.87 per course;
- Student Activity Fees: Activity fees are assessed at
a rate of $20.78 per month;
- Student Services Fees: Student services fees are assessed
at a rate of three percent (3%) of a student's (credit only)
tuition; and
- Students' Union (SU) Fees: This SU fees are assessed
at $150.32 for each 4-month term.
For example, if a student is enrolled in 5 courses in a term that lasts
4 months, 3 of
the 5 courses are courses with compulsory labs,
and these 5 courses amounts to 16 credits in total,
the this student's total payment for this term would be:
16 * $173.12 (Tuition: $2769.92)
+ 3 * $24.87 (Lab Fee: $74.61)
+ 4 * $20.78 (Student activity fee: $83.12)
+ 0.03 * 16 *$173.12 (Student services fee: $83.10 or 83.0976)
+ $150.32 (SU fee: $150.32)
---------------------------------------
= $3161.07 or $3161.0676
Your tasks
- Download the template file A4-input.xlsx.
- Open the template file you just downloaded and design and
implement a VBA program to calculate a domestic student's tuition
and fees for one term, assuming that a term always lasts 4 months.
Your program should perform the following tasks:
- Ask the user to enter the following information (using InputBox)
- the student's name;
- the number of credits the student enrolled in this term;
- the number of the courses with
compulsory labs the student enrolled in;
- Calculate the student's total payment for this term
according to the information your program just collected from
the student and the tuition and fee schedule stored
in the template file;
- Use a message box to show the student's total payment;
Optionally, also show the breakdown of the payment.
- Enter the input information and the calculated results
to the appropriate cells in row 11 in the Excel file.
You can either assume the active cell is placed on A11,
or use absolute cell reference with literal value (11)
to enter data to row 11.
- Save your work to a Macro-enabled Excel file
with a meaningful file name.
Before submitting your assignment, you need to check at least
the following things:
- "Option Explicit" must be placed at the beginning of your program.
- Do NOT use any literal numbers (such as 173.12, 24.87, 3 percent, etc)
for your program's parameters.
Instead you should either use named constants
for the parameter values or load parameter values from the parameter
area on the worksheet to your program's variables first.
- Consistency is highly valued. That is, if you decide to use
named constants for parameter values, then you should use
named constants for ALL parameter values. Same with loading
parameter values from the worksheet.
- You must give meaningful names to your variables and constants.
- Use proper and easy to understand messages when you ask the student
(the user of your program) to enter data and when you show
the calculation results to the student.
- Finally don't forget to write the raw and calculated data
to the Excel file before terminating your program.
Most importantly, your solution file must be a Macro-enabled
Excel file.
How to submit:
To submit your solution to this assignment,
login to your VIU Learn account, find the CSCI 112 course page,
click on the "Assessment" drop-down menu, click
on the "Assignments" item, then click on the folder named "A4".
Then you can click on the "Add a File" button to browse and upload your
Macro-enabled Excel solution file.
If you have difficulties to make the VIU Learn submission work,
please email me to let me know and attach your solution file
with your email.
Last updated: October 5, 2026