cdplayer

cdplayer - % This program simulates a CD player allowing...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
% This program simulates a CD player allowing you to choose a desired CD % and a desired track inwhich you can listen. % First the program tells the listener the number of tracks on each CD using the numtracks funtion. fprintf('\n'); tracks1 = numtracks(); tracks2 = numtracks(); tracks3 = numtracks(); fprintf('\n'); % Here the program is asking the listener to identify their desired CD and % then their desired track on that CD. % If the CD and track is valid the program will play the selected song. % However, if the listener enters an invalid CD or track number ie one that % does not exist the program will explain that the selected CD and or track % does not exist and will prompted the listener to enter another. % A while loop is used to do this because the programer is unsure of % exactly how many times the listener will enter an invalid CD or track. % The while loop allows for mulitple mistakes and corrections. display('What''s your favorite track?')
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 07/19/2010 for the course EK 211 taught by Professor Attaway during the Spring '10 term at BU.

Page1 / 2

cdplayer - % This program simulates a CD player allowing...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online