An on line music store offers the following package options: Package A : Price $4.99 per month. You get 10 free songs and $0.99 per song after that. Package B : Price $9.99 per month. You get 20 free...


An on line music store offers the following package options:




Package A:



Price $4.99 per month. You get 10 free songs and $0.99 per song after that.



Package B:



Price $9.99 per month. You get 20 free songs and $0.59 per song after that.



Package C:



Price $14.99 per month. You get 30 free songs and $0.29 per song after that.




  • In this lab you ask for the user of what package they have and how many songs they downloaded. Then you reportthe total due.


  • Sales tax is 6%.

  • Youmustuseswitch case
    for the package choice.

  • Ifs are allowedAFTERthat in your project (to see if thenumber of downloaded songs is legal, etc.).


  • If you have an if statement (or conditional operator) inside the switch statement then you are doing something wrong.


  • If you are using an if (or conditional operator) to distinguish what packet choice they have you are breaking the requirements.


  • If you have repeated code you are doing something wrong.Future labs may need to have if inside the switch, but this one doesn't not.See how the situation is handled inthis handoutthat improves an example of a program found in your book so it no longer has repeated code.

  • The switch is responsible for anything that has to do with the package choice. The if that you need to have after the switch shouldNOThave the package choice in its condition. It is there to see if the number of songs is legal, etc. Anything that depends on the package choice should be "resolved" in the switch!

  • If there are not extra charges you don't have to say anything (run the exampleexewith package A and 9 songs vs 11 songs).

  • Have your code repeat for ever for easy testing. For instructions on how to have your code repeat for ever click
    here
    .



  • Use constants when appropriate and use theEVERYWHEREinstead of the corresponding literal!

  • Try not to have duplicated/repetitivecode!

  • DoNOTmix the input phase with the processing phase and the output phase!

  • Don't forget to follow all the "usual" requirements found
    here
    .




NOTE:



  • Your program should acceptboth upper and lower caseoptions.


  • Have basic input validation(can you negative number of songs? can you have 2.3 songs?)and


  • pay attention to formatting. See my sample exe. It needs to much mineEXACTLY!!


  • Don't forget to observe the grammar! Hint:the conditional operator will be the best tool for this!


  • Test your codeand make sure it behaves like mine in the situations shown below before your group meeting

Feb 12, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here