Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help coding in c++! Requirements This program offers an opportunity to use pointers and reference parameters. Write five functions (not including main) per the

Please help coding in c++!

image text in transcribed

Requirements This program offers an opportunity to use pointers and reference parameters. Write five functions (not including main) per the specifications below. Output the results in main() after each function call. Again, output the results of each function call in main(). Function One - void calculateDiscount(). Obtain the following data from your user in main(): listPrice and discountPercentage. Call calculateDiscount() to calculate the discounted price. Pass the discounted price back to main() via a reference parameter. Function Two - void determineLarger(). Obtain the following data from your user in main(): intOne and intTwo. Call determineLarger() to determine the larger of the two numbers. Pass the larger of the two back to main() via a pointer parameter. Function Three - bool compareArrays(). Obtain the following data from your user in main(): Populate two built-in arrays of strings. Call compareArrays() to determine if the arrays contain the exact same data. Send the bool result back to main() via a return value. Function Four - void sortArrays(). Call sortArrays() with a built-in array of strings and a Class Template array object of strings. Sort both. Function Five - void demoPtrTechniques(). Demonstrate the four ways to pass a pointer to a function

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions