Write a complete program that inputs 2 values from the console: first the price
ID: 3648758 • Letter: W
Question
Write a complete program that inputs 2 values from the console: first the price of an item (a real number), and second the discount (as an integer percentage). The program then outputs the final cost of the item. For example, if the price is 108.0 and the discount is 20, then the final cost is 86.4. However, if the discount is negative, your program should instead output "ERROR", and if the discount is 100 or larger, your program should instead output "FREE". Assume the input price is always valid.Explanation / Answer
Try this code: #include using namespace std; int main() { double cost, discount; cout > cost; cout > discount; if(discount < 0) cout = 100) coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.