Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Program is not responding due to errors. Please help! Sample Run: Enter the number of items purchased: 5 Enter the price per item $3.25 Is

Program is not responding due to errors. Please help!

image text in transcribedimage text in transcribed
Sample Run: Enter the number of items purchased: 5 Enter the price per item $3.25 Is the purchase taxable: y 5 items at $3.25 each will cost $16.25 For I item(s), tax is $0.18 and final cost would be $3.43 For 2 item (s), tax is $0.36 and final cost would be $6.86 For 3 item(s), tax is $0.54 and final cost would be $10.29 For 4 item (s), tax is $0.72 and final cost would be $13.72 Final bill for 5 item(s), tax is $0.89 and final cost would be $17.14 Enter the number of items purchased: 3 Enter the price per item $8.35 Is the purchase taxable: N For 1 item(s), tax is $0.00 and final cost would be $8.35 For 2 item (s), tax is $0.00 and final cost would be $16.70 Final bill for 3 item(s), tax is $0.00 and final cost would be $25.05+ CD Page view | A Write a program which computes the total cost of purchases made in a store compute the cost plus 5.5% sales tax of purchases made if taxable. This program computes the total cost of purchases made. 1. Prompt the user for number of items purchased and price per item. 2. Prompt the user if the purchases is taxable 3. Calculate the totalCost where a. The number of items and price per item as parameters b. The totalCost of all items, including 5.5% tax if taxable. 4. Display information the number of items purchased, cost per item and the cost of all items in a nicely formatted output where the cost is set to 2 decimal places. (see sample run) 5. Using a for loop display the price from item 1 to total number of items a. Display the tax amount being applied (0 if not taxable) b. Display the total price of purchase with tax applied

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

Students also viewed these Programming questions