CS111 Assignment 1, Semester II, 2017: 1 Rules
CS111 Assignment 1, Semester II, 2017: 1 Rules
1 Rules
1.1 Every student has to make a submission
You may collaborate1 in pairs on the assignment. However every student has to
make a submission. This tells us that you consider it as your own submission.
If your team members submit the assignment, but you don’t, they will get
appropriate marks and you won’t.
Submitting late: If you think that you will not be able to submit the assign-
ment 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
Submission instructions are on the Assignment 1 Drop Box page.
1 You don’t have to collaborate, but it is allowed.
1
1.4 Plagiariasm
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. However, it is plagiarism for you to copy
all or part of each others programs. If you find somebody has stolen your
assignment and produced it as their own, it will be considered plagiarism.
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. Dont 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.5 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,
visit or call the course coordinator.
All contact information is on Moodle.
2 Exercises
Read Problem statement in Section 3 before answering Exercises 1-5]
2
Exercise 2 [Find & Generate] (8 marks) Please answer the following:
• (2 marks) Which variables do you need?
• (2 marks) Which variables do you use for input?
• (2 marks) Which types do you use for which variable. Explain why?
• (2 marks) What type of loop is best to validate the input? What is the
loop condition?
Exercise 3 [Evaluate & Reflect] (10 marks) 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?
– Did you copy from other groups, other students, or public sources?
– Did you let other students copy from you?
3 Problem Statement
This assignment asks you to implement a cup and ball game https://www.youtube.com/watch?v=n81uK0y70L8
as a C++ program. You will implement a program with six (6) cups and 1 ball.
For this you need to familiarize yourself with variables, ifs (nested and multiple
ifs), random numbers, and loops. The program should do the following:
3
∗ If they are equal then the user has won. Print appropriate mes-
sage.
∗ If they are not equal then give the user the answer (i.e. the
generated random number) and provide two more turns to the
user, generating a random number for each turn. (Total number
of tries at guessing is three (3))
Scenario 1
Scenario 2
4
Scenario 3
Note:
1. In all your program constructs you must write comments where necessary.
Dont write comments for obvious code, but segments of code which seem
complex. Also include your name, student id number as comments at the
top of your program code.
2. No need to use functions as it has not been yet covered in the course.
3. All input should be validated wherever necessary.
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.
4 4
• 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