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

Info icon This 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 an indefinate number of mistakes and corrections. display('What''s your favorite track?') fvcd = input('Please enter the number of the CD:'); while (fvcd < 1 || fvcd > 3) display('Sorry, that''s not a valid CD.');
Image of page 1

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

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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern