Abstract Classes [PDF]

Assignment. Write a program that will compile a list of instruments from different instrument families. A family of musi

13 downloads 21 Views 561KB Size

Recommend Stories


Classes for the Masses (Extended Abstract)
You have survived, EVERY SINGLE bad day so far. Anonymous

Abstract pdf
You often feel tired, not because you've done too much, but because you've done too little of what sparks

Abstract [PDF]
manajemen rumah sakit sehingga terdapat keseimbangan antara pendapatan dan biaya. Dalam hal ini penentuan ... satu satu fungsi sosial rumah sakit atau mengambil profit yang besarnya sesuai dengan kebijakan ... penelitian adalah data rekam medik di Un

SI Classes www.siclasses.com [PDF]
Jun 9, 2018 - Raj would not last forever, and that they would have to devolve ... Which one of the following statements is not correct? (A) 'Neel ...... (A) Autotroph ... Living Modified Organisms. ...... is subject to any of the disqualification und

Fall 2017 Classes – pdf
Why complain about yesterday, when you can make a better tomorrow by making the most of today? Anon

SI Classes www.siclasses.com [PDF]
Jun 9, 2018 - Raj would not last forever, and that they would have to devolve ... Which one of the following statements is not correct? (A) 'Neel ...... (A) Autotroph ... Living Modified Organisms. ...... is subject to any of the disqualification und

PDF Schedule of Classes
In the end only three things matter: how much you loved, how gently you lived, and how gracefully you

SI Classes www.siclasses.com [PDF]
Jun 9, 2018 - Raj would not last forever, and that they would have to devolve ... Which one of the following statements is not correct? (A) 'Neel ...... (A) Autotroph ... Living Modified Organisms. ...... is subject to any of the disqualification und

Extended Abstract (PDF, 89K)
Never let your sense of morals prevent you from doing what is right. Isaac Asimov

abstract and references (pdf)
Life is not meant to be easy, my child; but take courage: it can be delightful. George Bernard Shaw

Idea Transcript


Week 13 Assignment Java Programming I

SDEV-250

Abstract Classes Assignment Write a program that will compile a list of instruments from different instrument families. A family of musical Instruments is a grouping of several different but related sizes or types of instruments. Ref: https://en.wikipedia.org/wiki/Family_(musical_instruments) Some commonly recognized families are:  Brass Family - A brass instrument is a musical instrument that produces sound by sympathetic vibration of air in a tubular resonator in sympathy with the vibration of the player's lips. Ref: https://en.wikipedia.org/wiki/Brass_instrument  Strings Family - String instruments, stringed instruments, or chordophones are musical instruments that produce sound from vibrating strings. Ref: https://en.wikipedia.org/wiki/String_instrument  Woodwind Family - Woodwind instruments are a family of musical instruments within the more general category of wind instruments. There are two main types of woodwind instruments: flutes and reed instruments (otherwise called reed pipes). What differentiates these instruments from other wind instruments is the way in which they produce their sound. Ref: https://en.wikipedia.org/wiki/Woodwind_instrument  Percussion Family - A percussion instrument is a musical instrument that is sounded by being struck or scraped by a beater (including attached or enclosed beaters or rattles); struck, scraped or rubbed by hand; or struck against another similar instrument. Ref: https://en.wikipedia.org/wiki/Percussion_instrument

Constraints   



Limit the number of families to the list above Use one separate (external to the main class) abstract super class: Instrument Use three separate (external to the main class) abstract subclasses that extend Instrument: o BlownInstrument o Fingered o Struck Use four separate (external to the main class) subclasses (families) that extend the appropriate three above o Brass o Strings o Woodwind o Percussion

Requirements       

Display the menu shown in the example output below Request the number of instruments to be entered All instruments should be placed into an array (you can use one array per family or one array for all entered) so they may be displayed Use set and get methods where appropriate Implement a loop that will allow the user to enter more instruments Use exception handling and validation where appropriate This assignment will use coding principles learned from week 1 through 13

Hints 

Make sure you use Java coding conventions © Champlain College

Week 13 Assignment Java Programming I

SDEV-250

Expected Output Below is a sample run where instruments are entered for each family. User input is in red.

Deliverables Please zip your program and submit the zip file by the due date listed in the requirements. Select one of the following instrument families: 1. Brass 2. String 3. Woodwind 4. Percussion 5. Display all instruments 6. Exit ->: 1 How many brass instruments would you like to enter? ->: 3 Enter instrument #1->: bugle Enter instrument #2->: trumpet Enter instrument #3->: tuba Display instruments? (Y for Yes, N for No)->: n Enter more instruments? (Y for Yes, N for No)->: y 1. Brass 2. String 3. Woodwind 4. Percussion 5. Display all instruments 6. Exit ->: 2 How many string instruments would you like to enter? ->: 2 Enter instrument #1->: guitar Enter instrument #2->: harp Display instruments? (Y for Yes, N for No)->: n Enter more instruments? (Y for Yes, N for No)->: y 1. Brass 2. String 3. Woodwind 4. Percussion 5. Display all instruments 6. Exit ->: 3 How many wood wind instruments would you like to enter? ->: 2 Enter instrument #1->: clarinet Enter instrument #2->: oboe Display instruments? (Y for Yes, N for No)->: n Enter more instruments? © Champlain College

Week 13 Assignment SDEV-250

Java Programming I

(Y for Yes, N for No)->: y 1. Brass 2. String 3. Woodwind 4. Percussion 5. Display all instruments 6. Exit ->: 4 How many percussion instruments would you like to enter? ->: 2 Enter instrument #1->: drum Enter instrument #2->: marimba Display instruments? (Y for Yes, N for No)->: n Enter more instruments? (Y for Yes, N for No)->: y 1. Brass 2. String 3. Woodwind 4. Percussion 5. Display all instruments 6. Exit ->: 5 The bugle is a brass instrument and is played by mouth. The trumpet is a brass instrument and is played by mouth. The tuba is a brass instrument and is played by mouth. The clarinet is a woodwind instrument and is played by mouth. The oboe is a woodwind instrument and is played by mouth. The guitar is a string instrument and is played with fingers. The harp is a string instrument and is played with fingers. The drum is a percussion instrument and is struck. The marimba is a percussion instrument and is struck. Enter more instruments? (Y for Yes, N for No)->: n Goodbye

© Champlain College

Smile Life

When life gives you a hundred reasons to cry, show life that you have a thousand reasons to smile

Get in touch

© Copyright 2015 - 2024 PDFFOX.COM - All rights reserved.