0% found this document useful (0 votes)
5 views3 pages

CSCI1580 Assignment 3: Mode Calculation

Uploaded by

fukchuntse
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views3 pages

CSCI1580 Assignment 3: Mode Calculation

Uploaded by

fukchuntse
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CSCI1580 Visual Programming

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.

Sample Run 1 Sample Run 2


Enter n: Enter n:
6 8
Enter integer(s): Enter integer(s):
6 2
-1000 1
-1000 2
6 1
1000 -1000
-1000 1000
Mode(s): -1
-1000 x 3 -1
Mode(s):
-1 x 2
1x2
2x2
Sample Run 3 Sample Run 4
Enter n: Enter n:
5 1
Enter integer(s): Enter integer(s):
1 1
2 Mode(s):
3 The frequencies of all numbers are the same.
4
5
Mode(s):
The frequencies of all numbers are the same.

Assessment Scheme
 Correctness 90%
 Program readability (E.g., comments, meaningful variable names) 10%

Testing Platform
Microsoft Visual Studio Community 2022, Windows 10

Saving the Project Files


Please use “Save All” to save all the project files in one location but not “Save <file_name>.vb As” to
save some files in other locations. Otherwise, we may not be able to open your submission successfully.

2
Declaration
As required by the University, please place the following declaration as the comment in the beginning of
your VB source code.

' CSCI1580 Visual Programming


'
' Assignment <assignment_number>
'
' I declare that the assignment here submitted is original except for source
' material explicitly acknowledged. I also acknowledge that I am aware of
' University policy and regulations on honesty in academic work, and of the
' disciplinary guidelines and procedures applicable to breaches of such policy
' and regulations, as contained in the following University website:
' [Link]
'
' Student Name: <your_name>
' Student ID: <your_student_ID>
' Date: <date>

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).

The default project folder for Visual Studio 2022:

C:\Users\<user_name>\source\repos\<project_name>

Step 2: Go to BlackBoard and login your account by using your OnePass (CWEM) password.

Step 3: Go to the page for CSCI1580, choose Assignments => Assignment 3

Step 4: Upload your zip file prepared in Step 1.

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.

Common questions

Powered by AI

Meaningful variable names and comments enhance the readability and maintainability of code by making it clear what each variable represents and what specific sections of the code aim to accomplish. This practice is crucial in collaborative settings where multiple developers might work on the same codebase, or for students who might revisit the code in the future. Clear documentation within the code helps ensure that the logic is transparent, reducing the risk of errors and making debugging and reviews more efficient .

Allowing resubmissions offers students the chance to correct mistakes and improve their work post-initial submission, promoting a learning-focused approach rather than a one-shot evaluation. This flexibility can reduce anxiety and encourage thorough review and iterative improvements. However, it might also lead students to rely on the ability to resubmit, potentially reducing motivation to ensure the first submission is their best effort. The process of managing multiple submissions could also increase workload for both students and instructors if not carefully organized .

The academic honesty declaration is crucial as it underscores the university's commitment to integrity and ethical conduct. By requiring students to include this declaration in their source code, the assignment emphasizes the importance of original work and acknowledges the student's understanding of their responsibilities under the academic honesty policy. This fosters a culture of integrity and deters plagiarism, thus maintaining the credibility of the academic assessment .

Specifying the method for saving project files helps ensure that all necessary components are included in the submission, minimizing the risk that important files are misplaced or omitted. Using "Save All" as opposed to "Save <file_name>.vb As" also prevents potential issues with file paths that could prevent the project from being opened successfully by the instructor. This guidance fosters best practices in file management and submission, ultimately aiding smoother grading and feedback processes .

The assignment ensures fair evaluation by specifying that the program should print all modes in ascending order when there is more than one mode. Additionally, a message should be displayed if all numbers have the same frequency, ensuring the output is clear and accurate in each scenario. This approach allows for consistent handling of various input cases and ensures that students implement robust solutions .

The example-driven approach allows students to see practical applications of the concepts they are learning. By providing specific examples of input and expected output, students can better understand the requirements for determining the mode, including how to handle multiple modes or equal frequencies. This approach helps them visualize the problem and reinforces learning by guiding them through common scenarios and edge cases they need to manage in their programs .

The late submission penalties, which deduct 10% of the marks per day late, could significantly impact a student's overall performance by reducing their ability to perform well in this assessment. For students who may experience unforeseen circumstances or technical difficulties near the deadline, these penalties might lead to stress and could potentially lower grades significantly if submissions are delayed. Moreover, as submissions more than three days late are not graded, there is a risk of receiving zero for the assignment, which could affect their final course grade .

Using Visual Studio 2022 as the required platform ensures consistency in the development environment, which can minimize compatibility issues and provide a standard set of tools for all students. However, it may pose challenges for students unfamiliar with the IDE or those using other operating systems that do not support Visual Studio natively. This requirement might necessitate additional learning and adaptation, potentially affecting student performance if they are not comfortable with the tool .

Students might encounter difficulties related to technical issues such as problems with logging into BlackBoard, navigating to the correct submission page, or uploading the zip file due to file size restrictions or internet connectivity issues. Additionally, resubmission policies could cause anxiety, especially if there is a high volume of last-minute submissions. The requirement to ensure the file name follows a specific format also adds a layer of complexity that could result in accidental errors leading to submission failures .

By defining specific bounds for the input (1 ≤ n ≤ 100, integers between -1000 and 1000), the assignment reduces the complexity of input validation and edge case handling. This allows students to focus on implementing the core logic for finding the mode without being overly concerned about handling unexpected inputs or errors, simplifying the development process .

You might also like