Question: Using pointers how do I write a c++ program for? Write a program that will total your wages for a pay period. As a user,
Using pointers how do I write a c++ program for?
Write a program that will total your wages for a pay period. As a user, I should be asked to enter how many days I worked, the hours worked per each of those days, and then be asked for how much per hour I make. I should then see in a neatly formatted display, my total gross earnings for that pay period of days entered.
Start by asking the user how many days they have worked and their hourly rate while working those hours. Store these into variables as they will become handy later.
Create a pointer to a dynamically allocated array of the size equal to days worked. Remember this is done with the "new" keyword. Recall the relationship between pointers and arrays.
Ask the user how many hours they worked for each day.
Display each day using a loop and total the number of hours worked and multiply the total times the hourly rate. Use any functions you feel is necessary to write in this program. You will be critiqued on your structure. There should be at least one other function besides main. Determine what you feel is necessary. Remember to delete the dynamic array after use before the program ends and it is deallocated automatically.
Please help.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
