Assignment 3
Assignment 3
Assignment 3
Deadline: 8-Nov-2022 (Tue) 23:59
Objectives
This assignment allows you to practice using arrays.
Task
Given a list of integers, the mode is the integer that appears most frequently. For example, the mode of
the list of integers [1, 3, 3, 1, 4, 4, 5, 4] is 4. In some cases, it is possible that there is more than one
mode. For example, there are three modes in the list of integers [16, 10, 10, 11, 11, 15, 16] and they are
10, 11, and 16.
In this assignment, your task is to write a Visual Basic console application to first read an integer n from
the user, then read n integers, and output the mode and the frequency. If there are two or more modes,
please print all of them in ascending order.
However, if the frequencies of all numbers are the same, the program will display the message “The
frequencies of all numbers are the same.” Instead. Some examples are [1, 2 ,3, 4, 5], [1, 1, 2, 2, 3, 3],
and [1, 1, 1].
You can assume all user inputs are always valid, 1 ≤ n ≤ 100, and all n integers are between -1000 and
1000 inclusively.
1
Sample Run
Underlined bold characters in blue are inputs from the user.
Assessment Scheme
Correctness 90%
Program readability (E.g., comments, meaningful variable names) 10%
Testing Platform
Microsoft Visual Studio Community 2022, Windows 10
2
Declaration
As required by the University, please place the following declaration as the comment in the beginning of
your VB source code.
Submission
Please follow the following steps to submit your work.
Step 1: Zip your Visual Basic project folder into a zip file Assg3_<your_student_id>.zip, where
<your_student_id> should be replaced by your student ID (e.g., Assg3_1234567890.zip).
C:\Users\<user_name>\source\repos\<project_name>
Step 2: Go to BlackBoard and login your account by using your OnePass (CWEM) password.
Resubmissions are allowed. But only the latest one will be counted. 10% of your marks will be
deducted for late submission each day after the deadline. Late submissions more than three days will
not be graded.