What's wrong with my pseudocode?            // The calcDiscountPrice function accepts an item’s price and             // the discount percentage as arguments. It uses those             // values to calculate and return the discounted price.             Function Real calcDiscountPrice(Real price, Real percentage)                         // Calculate the discount.                         Declare Real discount = price * percentage                           // Subtract the discount from the price.                         Declare Real discountPrice = price – discount                           // Return the discount price.                         Return discount             End Function

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter7: User-defined Simple Data Types, Namespaces, And The String Type
Section: Chapter Questions
Problem 7PE
icon
Related questions
Question

What's wrong with my pseudocode?

            // The calcDiscountPrice function accepts an item’s price and

            // the discount percentage as arguments. It uses those

            // values to calculate and return the discounted price.

            Function Real calcDiscountPrice(Real price, Real percentage)

                        // Calculate the discount.

                        Declare Real discount = price * percentage

 

                        // Subtract the discount from the price.

                        Declare Real discountPrice = price – discount

 

                        // Return the discount price.

                        Return discount

            End Function

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT