Question
Use C-Style strings, Pointers, string functions, iterators to do the following: -Write a function that will take a double as a parameter. The function output
Use C-Style strings, Pointers, string functions, iterators to do the following:
-Write a function that will take a "double" as a parameter. The function output the number, formatting it in the following way:
-If the number is negative, it will preface the number with a minus '-' sign
-If the number is a decimal with no digits to the left of the decimal point, it will include a '0' to the left of the decimal point
-The number will be shown with 4 digits to the right of the decimal point. Pad with zeros if necessare. For example: 4 -> 4.0000
-Commas will be place on the left side of the decimal point in their appropriate place. For example: 1,234,567.0000
-Write a main function that will prompt the user for a number then call the display function.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started