web | 代写report | math | 代做app | java代写 | 作业c# | 代写oop | 代写project | assignment – COMP 1406/1006 Summer 2021

COMP 1406/1006 Summer 2021

web | 代写report | math | 代做app | java代写 | 作业c# | 代写oop | 代写project | assignment – 这是利用java进行训练的代写, 对java的流程进行训练解析, 涉及了web/report/math/app/java/c#/oop等代写方面, 这个项目是assignment代写的代写题目

math代写 代写math 数学代做

assignment #1: Displaying Chord-Pro Data

Due Thu July 22 by 10:00pm in brightspace

Assignment Revisions and Corrections will be noted here.

java Console App

In this assignment you are going build, or modify, a small console app that is based on using basic classes like String and ArrayList from the java class library. Specifically you will build an app that displays chord pro formatted (chords and lyrics) songs for the user and allow them to transpose the chords to a different musical key.

This assignment is based on tutorial 02 – you should complete that tutorial first before proceeding with this assignment.

Marking: This assignment is based on 17 design requirements numbered R1.1R4.5 for a total of 34 marks.

Marks are awarded, or deducted, based on requirements as follows:

Req Type Assignment Grading
R0.x Critical Submission and Intent Requirements. Assignment gets 0 if any
critical submission requirement (shown in red) is not met.
R0.x Good Practice Requirements. You lose 2 marks for each good practice^
requirement (shown in amber) not met.
Rx.x
Design Requirements. You earn 2 marks for each design requirement (green)
satisfied, well implemented, and demonstrated in you demonstration video; 1
mark if it's partly met, met but not well implemented, or met but not
demonstrated; and 0 if it's not met or attempted.

Submission and Good Programming Practice Requirements

The following requirements pertain to all your assignments regardless of what your application is supposed to do (i.e. regardless of the design requirements). These requirements are to ensure that your code is usable, readable, and maintainable.

R0.0 UNIQUENESS REQUIREMENT. The solution and code you submit MUST be unique. That is, it cannot be a copy of, or be too similar to, someone else’s code, or other code found elsewhere. You are, however, free to use any code posted on our course website as part of our assignment solution. [Assignment mark =0 if this requirement is not met.]

R0.1 CODE SUBMISSION ORGANIZATION AND COMPILATION: Your brightspace submission should be a single .zip file (no other compression formats accepted). Brightspace will be set up so only the most recent submission is kept -so you can keep re- submitting. You should submit all the code files and data files that make up your Intelij java project. The TA’s will watch your demonstration video and will open your project with Intelij, build the project and then run the application from your class whose name contains the substring "Main". IMPORTANT: The assignment mark is 0 if your code does not compile and launch with Intelij. [Assignment mark =0 if this requirement is not met.]

R0.2 README FILE: Your submission MUST include a README.txt file telling the TA how to launch and run your app and the location of your demonstration video. The TA should not have to look into your code to figure out how to start up your app. Your README.txt MUST contain the following:

Your name, student number and email address.
Version: The java JDK version you were compiling your code with.
A link to your YouTube demo video.
Setup Instructions: Are there any setup instructions like making sure a data file is
located in a special place. Typically this section might just say "None".
Launch and Testing: Tell us which class in your app has your main() function in it. You
should only have one main() function in your application. If there are specific tests you
want the TA to perform tell us what the steps are you want them to perform.
Issues: List any issues that you want the marker to be aware of. In particular, tell us
what requirements you did not implement or that you know are not working correctly in
the submitted code. Here you are giving us your own assessment of your app.

R0.3 Demonstration Video. You must supply a link to a demonstration video (YouTube link in the README.txt fiel) and the Video must be viewable (that is, not private).

R0.4 INTENT REQUIREMENT. Your solution must be in the spirit of the intent of the assignment. For example, if you hard-code answers rather than writing code that solves the intended problems you would be violating the assignment intent.

R0.4 VARIABLE AND FUNCTION NAMES: All of your variables, classes and methods should have meaningful names that reflect their purpose. Don’t follow the convention common in math courses where they say things like: "let x be the number of customers and let y be the number of products…". Instead call your variables numberOfCustomers or numberOfProducts. Your program should not have any variables called "x" unless there is a good reason for them to be called "x". (One exception: It’s OK to call simple for-l oop counters i,j and k etc. when the context is clear and VERY localized.)

Remember: any fool can write code that a computer will understand; the goal is to write code that we can understand. [Minus 2 marks from assignment if this requirement is not met.]

R0.5 HARD CODED CONSTANTS: Your code should not have hard coded constants used in places like if-statements or function parameters. Your constants should have meaningful names. Don’t have if statements like

if(ball.getLocationX() + 40 < 100) …;

instead your code should look more like

if(ball.getLocationX() + ballRadius < rightBoundaryX) …;

If necessary create local variables that reflect the use of the constant. e.g. double rightBoundaryX = 100; then you can refer to that in your program logic. (There is no prize for having fewer lines of code -if more lines makes your code more readable then use more lines). [Minus 2 marks from assignment if this requirement is not met.]

R0.5 COMMENTS: Comments in your code must coincide with what the code actually does. It is a common bug to modify, or cut-and-paste code, and forget to modify the comments and so you end up with comments that say one thing and code that actually does another. Don’t over-comment your code – instead choose good variable names and function names that make the code "self commenting". Don’t be reluctant to create local variables so that the variable name provides more clarity -there is no prize for having the fewest lines of code. [Minus 2 marks from assignment if this requirement is not met.]

R0.6 DEMONSTRATION VIDEO: Your YouTube demonstration video should not be longer the 7 minutes for assignments (or at least the TA’s won’t be obliged to watch more than that). Your video so be a demonstration of completed work show perhaps the most important use-cases and illustrate the design requirements have been met. The video should have voice narration. It should NOT be a video of you coding the solution but rather a video of the completed work. We must be able to hear your voice-over and see the intended code and mouse pointer (make sure your font is approriate). [Minus 2 marks from assignment if this requirement is not met.]

R0.7 CITATION REQUIREMENT: If you use code from other sources you should cite the source in comments that appear with the code. If the source is an internet website then put the URL in the comments. You may use bits of code from outside sources but this may not form the complete solution you are handing in. You DON’T have to cite demo code we provide on the course web site or with tutorials and assignments, however that code should not be used for things you post publicly (like on GitHub). [Minus 2 marks from assignment if this requirement is not met.]

VERY IMPORTANT: Any sample code fragments provided may have bugs (although none are put there intentionally). You must be prepared to find errors in the requirements and sample code. Please report errors so they can be fixed and an assignment revision posted.

Application Design Requirements

Background

In tutorial 02 you will have done an exercise where you displayed output representing a landscape profile as multiples lines of console output. Now we will apply this idea to something that is actually useful. Chord-Pro is a popular text format for storing song lyrics and chords. In this format the chord symbols are embedded within the song lyrics inside [] brackets. This format is convenient for storage because the chords always stay in the correct relative position within the lyrics and is independent of the font used. The demo code we have provided creates a small library of song objects with their chords and lyrics in chord-pro format.

Chord Pro Text File:

Sister Golden Hair -America

verse1: Well i [E] tried to make it sunday but i [G#min] got so damned depressed That i [A] set my sights on [E] monday and i [G#min] got myself undressed I ain’t ready for the alter, but i [C#min] do [G#min] believe there’s [A] times When a [F#min] woman sure can [A] be a friend of [E] mine [Esus2] [E]

verse2: Well i [E] keep on thinkin bout you sister [G#min] golden hair surprise That i just can’t live without you can’t you [G#min] see it in my eyes I’ve been [A] one poor corre[F#min]spondent, i’ve been [C#min] too too [G#min] hard to [A] find But it [F#min] doesn’t mean you [A] ain’t been on my [E] mind [Esus2] [E]

chorus: Will you [B] meet me in the middle will you [A] meet me in the [E] end Will you [B] love me just a little just en[A]ough to show you [E] care Well i [F#min] tried to fake it i [G#min] don’t mind sayin i [A] just can’t make it

repeat intro, then verse 2, then chorus, then they do this doo-wop thing that uses the chorus (B – A – E) thing

While this format is great for storage and keeping chords in the right place within the lyrics it is not how it is meant to be displayed for the user. Instead songs should be displayed for the user with the chord symbols shown above the lyrics as follows:

Even better would be if the chords and lyrics are displayed in different colours:

We want you to change the demo app so that when the user executes a "show" command it will display the songs with the chords shown above the lyrics in their proper place and in different colours.

To do this you will have to spilt each of the chord-pro formated lines into two lines: one with just the lyrics and the other with just the chords but in the correct location above the lyrics. So the line with the chords only will have to have blanks to pad the position where the chords should appear. (We are assuming a mono-space font will be used in the console.) Be aware we are NOT modifying the actual songs -they will always be in chord pro format. We are just changing how the songs are displayed for the user. It is OK to add methods to the Song class to help with this if you want.

Play around with the demo code provided. It implements a small console application that supports the following commands:

find:XXX //find songs whose title contains the substring XXX

show:2 //show the title and lines of song 2 in the list of found results

help //show a list of available commands.

transpose:2 //NOT IMPLEMENTED YET

1) General Application Requirements

R1.1 Your application should retain the Song, SongLibrary, and CommandInterpreter classes and they should keep to their intended responsibilities. You are free to add whatever other classes you want though.

R1.2 The Song objects should represent their data in Chord-Pro format. That is, don’t change the internal representation of the song to already store the chords and lyrics on separate lines -that would, in fact, violate R0.3. (We anticipate that songs will be read from disk in chord-pro format but this is not part of the assignment).

R1.3 The program should not crash as a result of input typed by the user. That is, your program should scrutinize and filter that data so as to ignore user’s requests that don’t make sense.

2) Song Search Requirements

(Note: Familiarize yourself with the demo code before dealing with the specific requirements.)

R2.1 The user should be able to find songs using the find command (as is already done in the demo code). Searches should NOT be case sensitive.

R2.2 The user should be able to search for a song with a command like: find:Feeling Easy and this should match any songs that contain the substrings "Feeling" and "Easy" within their title BUT IN ANY ORDER. This example should match the song "Peaceful Easy Feeling". The demo code does not currently allow keywords in any order.

R2.3 If a search produces only one song (i.e the search returns an ArrayList with justs one entry) that song should become the currently selected song in the application. The demo code does not currently do this.

3) Song Display Requirements

R3.1 The show: command should display a song in "chords above lyrics" format, not in the chord-pro format the way the demo code currently does.

R3.2 A show: command with no arguments should show the currently selected song in chords above lyrics format.

R3.3 A show:chordpro command should allow the user to see the currently selected song in its "raw" chordpro format. [This command does not need to show songs transposed but rather can show the original chordpro data for the selected song.]

R3.4 The chords shown above the lyrics should NOT be in square brackets the way they are in the chord pro storage format.

R3.5 Whenever chords are shown above the lyrics the colour of the chords and lyrics should be different and neither should be the same colour as the interface console text. The console text is typically black so the lyrics might be blue and the chords green for example. In the demo code the show: command displays lyrics in blue. See how that is done and display the chords in yet another colour.

R3.6 If chords are embedded inside a word in the chord pro format then the chord should appear above the word and not have the word split. For example, if the chord pro data looks like dep[G#min]ressed. Then the display should be like this:

G#mim depressed

and not like this:

G#mim dep ressed

4) Transposition Requirements

Musicians often need to transpose the chords of a song to another key. That is, transpose the chords up or down by a certain number of semi-tones (or half-steps). You will implement this feature by providing a transpose: command.

R4.1 If the user enters transpose:n (e.g. transpose:2) the chords should be transposed up n semitones (or half-steps) as they say in music. For example, if you are transposing up by one semitone, an Am7 chord should be become A#m7 (or Bbm7), F# should become G7, Ebmin should become Emin etc. (see below for more explanation of what chord transposition means, and be prepared to google for more understanding.) [Transpostions are intended to be applied cummulatively to the current song. That is, the effect of a transpose:2 command followed by the transpose:3 command should be the same as a single transpose:5 command.]

R4.2 If the user enters transpose:-n (e.g transpose:-3) the chords should be transposed down n semitones (or half-step) as they say in music. For example if you transposing down by one semitone an Am7 chord should be become Abm7 (or G#m7), F# should become F7, Ebmin should become Dmin etc. (see below for more explanation of what chord transposition means, and be prepared to google for more understanding.) [Transpostions are intended to be applied cummulatively to the current song. That is, the effect of a transpose:2 command followed by the transpose:3 command should be the same as a single transpose:5 command.]

R4.3 Transposition should work correctly for chords that have more than one letter name in them. For example an A7/ c# chord. Here both the "A" and "C#" letter names appear within the same chord. This is called a slash chords -because of the forward slash. It means the musician should play an A7 chord with a C# note in the bass. The example song "Never My Love" contains some slash chords.

R4.4 Transposition should not alter the original song object’s data. Transposition is only displayed for the user but not stored.

R4.5 When chords are transposed they should appear in a different colour than that used for the original key. When the user transposes chords up and down it should be obvious when they have returned to the original key by the colour of the chords.

Here is an explanation of how chords are transposed but you should google this concept if you need more clarification -remember the programer will need to learn the domain that the app is about.

In western music there are 12 notes whose names are A, A# or Bb, B, C, C# or Db, D, D# or Eb, E, F, F# or Gb, G, G# or Ab. Moving from one note to the next one is called a

distance of a semitone (or a half-step). It’s perhaps easiest to visualize these as a table or array.

0 1 2 3 4 5 6 7 8 9 10 11
A A# B C C# D D# E F F# G G#
A Bb B C Db D Eb E F Gb G Ab

Seven of the notes have simple letter names (A,B,C,D,E,F, or G) and five of the notes have two names: a sharp (#) or flat (b) name (A#=Bb, C#=Db, D#=Eb, F#=Gb, G#=Ab).

To transpose a chord Dm7 up 4 semitones you would locate the chord’s root name D in the table at index 5 and then look up the new root name at location 5 + 4 = 9. That is, Dm transposed up 4 semitones is F#m7. (If you end up going off the end of the table you would wrap around to the start -i.e. do a mod 12 operation on the index sum.)

To transpose a chord Dbmaj down 6 semitones you would locate Db which is at index 4 then subtract 6 which would be -2 or 10 if we are wrapping around. Thus Dbmaj transposed down 6 semitones would be Gmaj.

Thus transposing up is moving to the right by the required number of semitones wrapping around if necessary. Transposing down is moving to the left by the required number of semitones wrapping around if necessary.

Additional Notes.

We’ve simplified the four example songs provided so they only consist of one verse or chorus of text. That is sufficient for the assignment -you don’t need to use full songs unless you are interested in that.

There are lots of chord pro formatted songs on the internet. See if you can find some.