CS111 Assign 1 2024
CS111 Assign 1 2024
CS111 Assign 1 2024
Section 1: Rules
You have to submit your work before the deadline. Lab computers are scarce, so the trick is to start EARLY.
Also when you finish don’t hold on to your assignment till the last moment. Submit as soon as you are satisfied
with it.
Submitting late:
If you think that you will not be able to submit the assignment on time due to circumstances which are beyond
your control, then you will need to seek approval from the course coordinator prior to the due date. This means
you have to ask for an extension, explaining the reasons, before the deadline, and not after.
A late submission will be penalized by 30% for each 24 hour period it is late. Where possible, it is better to hand
in your work early and get credit for partial work than handing in late. A partial work may earn more points than a
working assignment which is submitted late.
1.3 Submission
You will have to submit exactly two files on Moodle.
Program
Be sure you submit .cpp files only. Name your program file as Assign1YourIdNumber.cpp, where
YourIdNumber is your student id number (e.g. Assign1S01234561.cpp).
Do not submit the .exe executable versions of your program. Also be sure that you submit the assignment only
once you are totally satisfied. We will not accept ”corrected versions” submitted through other channels after the
due date. However, you can submit the assignment as many times as you like on Moodle before the due date!
Write-up
Your write-up will have to be written in English. Try to keep your answers short and clear. Excessively verbose
answers will be penalized. Upload your write-up as a single document. The preferred format is a PDF file. Word
documents are good for editing, but you should export or save the final version as PDF. This is the format for
reading.
1.5 Plagiarism
For this and other work in CS111, it is essential that you avoid plagiarism. Not only do you expose yourself to
possibly serious disciplinary consequences, but you will also cheat yourself of a proper understanding of the
concepts emphasized in the project. You will almost certainly fail the short tests and/or the final which will test
your understanding of the project.
It is not plagiarism to discuss the assignment with your friends and consider solutions to the problems together.
We are using automated tools to assist with the detection of plagiarism. They will highlight any unusual co de
that is similar between students. All cases that are flagged as potential plagiarism will be checked by hand.
So do not leave your flash drives around. Be careful with them. And make sure you log out of the lab machines
when you are finished working with them. Don’t copy part of someone solutions, and do not give somebody else
an electronic copy of your solution. If you give someone your program it is almost guaranteed that part of it will
end up in their program, no matter whether you ask them not to copy.
Any student posting code for this project on Moodle will be considered to be committing plagiarism. Do not
submit your code to any discussion group or mail it to anyone except the lecturers or tutors.
Do not be concerned if Moodle tells you that a file cannot be checked by TurnItIn for plagiarism. This will be your
program file. We will check programs separately once submitted.
1.6 Support
If you have a problem with the assignment, with C++, Dev C++, the exercises, and questions in this assignment,
lecture notes, the book, please ask. First use the forum for your questions. This will also help other students with
the same questions. Then ask your tutor for help, or otherwise the course coordinator.
If you have any problems with the assignment or the course, feel free to email or consult the course coordinator
or any of the TAs.
2.1 Exercises
3. (2 marks) Which types do you use for which variable. Explain why?
4. (2 marks) What type of loop is best to validate the input? What is the loop condition?
Please describe at least three test cases that will allow you to assess whether the program is correct. Which
inputs should you choose, and what outputs would you expect? Answer in less than 300 words. Does your
program actually satisfy those test cases?
The program for this assignment is honest, in that it reports honestly what the user provides as input. Of course,
rather than reporting what the user enters, your program could make a biased report - a preferred option - more
income or less tax if it wants to.
Would this be ethical to do? Would this be in line with the ACS Code of Ethics and with basic Programming
Ethics? Explain. Please answer in less than 300 words.
Design and implement a C++ program that asks user for their:
A. Name (First & Surname);
B. Employee ID;
C. Gender (M/F/O);
D. Year of Birth;
E. Chargeable Income and
F. Residential status.
Program Specifications:
Tax Calculations
You are 36 years old and a resident of Fiji. Based on your provided income of $120 000, you are required to pay
an Income Tax of $17,600.
Best regards
Note:
• The generated output must contain the highlighted fields as shown above.
• In all your program constructs you must write comments where necessary. Don’t write comments for
obvious code, but segments of code which seem complex. Also include your name, student id# and
tutorial group as comments at the top of your program code.
• No need to use functions as it has not been yet covered in the course.
• All input should be validated wherever necessary. For instance, the input for age has to be only in
integers.
Important: In all your program constructs you must write comments where necessary. Do not write comments for
obvious code, but for segments which seem complex. Include your name and student number as comments at
the top of your program code.
Partial Credit:. Even if your program does not work perfectly, you will receive partial credit for each part you get
to work. For example, if your program compiles but gives incorrect results, you can still receive a mark provided
that your code is well-written.
This exercise will be marked using the rubric attached. The following may lead to deductions for the different
categories:
Documentation
Programming Style
• Poor indentation.
• Lack of brackets.
• Poor variable names.
• Poor layout.
• Magic constants.
Semantics
• Uninitialized variables.
• Unused variables.
• Wrong type of loop.
• Wrong data type.
• Wrong Boolean expressions or conditions.
• Wrong use of ifs.
Correctness
Note that this list is not exhaustive. There are many more mistakes that will result in deductions.
(a) Did you copy from other groups, other students, or public sources?
2.
• Did you put your name and student number on the first page? YES/NO
• Did you put your name and student numbers into the program? YES/NO
• Will you upload a write-up for Sections 2 & 4? YES/NO
• Did you upload the program for section 3? YES/NO
• Did you submit before the deadline? YES/NO