Value returning method Write a program to calculate items sale price

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter11: More Object-oriented Programming Concepts
Section: Chapter Questions
Problem 11PE
icon
Related questions
Question
Value returning method Write a program to calculate items sale price
Value returning method
Write a program to calculate item's sale price
1) Ask user to enter the name of item e.g t-shirt
2) Ask user to enter the color of the shirt they want to buy
3) Ask user to enter the item's price e.g 10, 100, 200
4) Write a method to calculate discounted price
1) If item's price is more than or equal to 100, get 10% discount
2) Item's color must be 'blue'
3) Return discounted price
4) If less than 100 or not blue, no discount
4) Mainline should display, item name, color and the discounted price
Transcribed Image Text:Value returning method Write a program to calculate item's sale price 1) Ask user to enter the name of item e.g t-shirt 2) Ask user to enter the color of the shirt they want to buy 3) Ask user to enter the item's price e.g 10, 100, 200 4) Write a method to calculate discounted price 1) If item's price is more than or equal to 100, get 10% discount 2) Item's color must be 'blue' 3) Return discounted price 4) If less than 100 or not blue, no discount 4) Mainline should display, item name, color and the discounted price
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
Concept of Parenthesis
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage