nsider proper alignment and indentation of statem e questions. Write a void function named GetData that uses tw rameter variables for the following -This function sh enter two values namely for an item price and quar ad will be stored in the parameter variables. Input v

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter6: User-defined Functions
Section: Chapter Questions
Problem 1TF: Mark the following statements as true or false: a. To use a predefined function in a program, you...
icon
Related questions
Question
Consider proper alignment and indentation of statements when answering
the questions.
(a) Write a void function named GetData that uses two double reference
parameter variables for the following -This function should prompt the user
to enter two values namely for an item price and quantity sold. The values
read will be stored in the parameter variables. Input validation iş not
required. (Assume the user will enter values that are valid). (4
ks)
(b) Write a value returning function with parameters. The function named
CalcTotalPrice receives the item price and quantity sold. It calculates and
return the total price of items purchased. (4.
(6)
(c) Assume the following declaration:
double price;
int quantity:
Write the calls to the two functions written in (a) and (b). Display the
value returned.
sarks)
Transcribed Image Text:Consider proper alignment and indentation of statements when answering the questions. (a) Write a void function named GetData that uses two double reference parameter variables for the following -This function should prompt the user to enter two values namely for an item price and quantity sold. The values read will be stored in the parameter variables. Input validation iş not required. (Assume the user will enter values that are valid). (4 ks) (b) Write a value returning function with parameters. The function named CalcTotalPrice receives the item price and quantity sold. It calculates and return the total price of items purchased. (4. (6) (c) Assume the following declaration: double price; int quantity: Write the calls to the two functions written in (a) and (b). Display the value returned. sarks)
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Variables
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
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
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr