Set up prerequisites. Get started on Duke
Ensure you have met the following prerequisites:
Prerequisites:
Relevant: [
Revision control: You are required to use Git. Other revision control software are not allowed.
The recommended GUI client for Git is SourceTree (which comes bundled with Git), but you may use any other, or none.
Install Git and a Git GUI client on your computer.
SourceTree comes with bundled with Git i.e., if you install SourceTree, you get both Git and a GUI client in one shot.
Set Git user.name
: We use various tools to analyze your code. For us to be able to identify your commits, we encourage you to set your Git user.name
in all computers you use to a sensible string that uniquely identify you. You can to GitHub username or as your Git username. If this user name is not set properly or if you use multiple user names for Git, our tools might miss some of your work and as a result you might not get credit for some of your work.
After installing Git in a computer, you can set the Git username as follows:
git config --global user.name YOUR_GITHUB_USERNAME
(omit the --global
flag to limit the setting to the current repo repo)git config --global user.name JohnDoe
or from within the repo git config user.name JohnDoe
More info about setting Git username is here.
Relevant: [
Collaboration platform: You are required to use GitHub as the hosting and collaboration platform of your project (i.e., to hold the Code repository, Issue Tracker, etc.). See Appendix E for more info on how to setup and use GitHub for your project.
Create a GitHub account (if you don't have one yet), as explained in the panel below.
Relevant: [
Create a personal GitHub account if you don't have one yet.
You are advised to choose a sensible GitHub username as you are likely to use it for years to come in professional contexts.
Strongly recommended: Complete your GitHub profile. In particular,
The GitHub profile is useful for the tutors and classmates to identify you. If you are reluctant to share your info in your long-term GitHub account, you can remove those details after the module is over or create a separate GitHub account just for the module.
You are discouraged from changing your GitHub username during the semester/exam/grading period as it can cause our auto-grading scripts to miss your GitHub activities. If you do change your GitHub username during that period, please let us know immediately.
The purpose of the profile photo is for the teaching team to identify you. Therefore, you should choose a recent individual photo showing your face clearly (i.e., not too small) -- somewhat similar to a passport photo. Some examples can be seen in the 'Teaching team' page. Given below are some examples of good and bad profile photos.
If you are uncomfortable posting your photo due to security reasons, you can post a lower resolution image so that it is hard for someone to misuse that image for fraudulent purposes. If you are concerned about privacy, you can request permission to omit your photo from the page by writing to prof.
See Appendix E - Using GitHub for more information.
Relevant: [
IDE: You are recommended to use Intellij IDEA for module-related programming work. You may use the community edition (free) or the ultimate edition (free for students). While the use of Intellij is not compulsory, note that module materials are optimized for Intellij. Use other IDEs at your own risk.
Implement the following
git tag
the commit with the exact increment ID e.g., Level-2
, A-TextUiTesting
git push
the code and the tags to your forkLevel-1
: Greet, Echo, Exit
In this initial skeletal version of Duke, it starts by greeting the user, simply echos commands entered by the user, and exits when the user types bye
.
Example:
____________________________________________________________
Hello! I'm Duke
What can I do for you?
____________________________________________________________
list
____________________________________________________________
list
____________________________________________________________
blah
____________________________________________________________
blah
____________________________________________________________
bye
____________________________________________________________
Bye. Hope to see you again soon!
____________________________________________________________
Level-2
: Add, List
Add the ability to store whatever text entered by the user and display them back to the user when requested.
Example:
____________________________________________________________
Hello! I'm Duke
What can I do for you?
____________________________________________________________
read book
____________________________________________________________
added: read book
____________________________________________________________
return book
____________________________________________________________
added: return book
____________________________________________________________
list
____________________________________________________________
1. read book
2. return book
____________________________________________________________
bye
____________________________________________________________
Bye. Hope to see you again soon!
____________________________________________________________
String[100]
) to store the items.Level-3
: Mark as Done
Add the ability to mark tasks as done.
list
____________________________________________________________
Here are the tasks in your list:
1.[✓] read book
2.[✗] return book
3.[✗] buy bread
____________________________________________________________
done 2
____________________________________________________________
Nice! I've marked this task as done:
[✓] return book
____________________________________________________________
When implementing this feature, you are also recommended to implement the following extension:
While it is possible to represent a task list as a multi-dimensional array containing Task
class to represent tasks.
public class Task {
protected String description;
protected boolean isDone;
public Task(String description) {
this.description = description;
this.isDone = false;
}
public String getStatusIcon() {
return (isDone ? "\u2713" : "\u2718"); //return tick or X symbols
}
//...
}
Task t = new Taks("read book");
t.markAsDone()