In: Computer Science
Requirements: The company that needed the flowchart and pseudocode for calculating the final price of the TV set and sound bar has given you the responsibility of creating a program for that purpose. The requirements remain the same as those indicated for the flowchart: The program will be used to enter the price of the TV set and the sound bar, in that order. The place of residence will also be entered in order to calculate the sales tax Residents of New Jersey pay 6.625% sales tax Residents of New York City pay 8.875% sales tax. • Residents of New York State (outside New York City) pay 4.375% sales tax The place of residence will be entered as NJ, NYC or NYS After the calculation is performed, the final result will be displayed
/* Here price of TV is denoted by float variable TV*/
/* Here price of SOUND BAR is denoted by float variable SB */
/* Here the total price of TV and SOUND BAR is denoted by float variable TOT*/
/* Here price of LOCATION is denoted by character type array variable LOC */
Declare TV, SB, TOT and LOC as float variable
Input the price of TV and SB
Input the LOC // LOC may be NJ,NYC,NYS
if LOC is NJ
set TV=TV+TV*(6.625/100)
SB=SB+SB*(6.625/100 )
TOT=TV+SB
print the TV /* Final price of TV */
print the SB /* Final price of SB */
print the TOT /* Final price of total */
else if LOC is NYC
set TV=TV+TV*(8.875/100 )
SB=SB+SB*(8.875/100 )
TOT=TV+SB
print the TV /* Final price of TV */
print the SB /* Final price of SB */
print the TOT /* Final price of total */
else if LOC is NYS
set TV=TV+TV*(4.375/100 )
SB=SB+SB*(4.375/100 )
TOT=TV+SB
print the TV /* Final price of TV */
print the SB /* Final price of SB */
print the TOT /* Final price of SB */
else
print “ location does not match “ /* no location within NJ,NYC,NYS */
endif