Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CIS 1202 Programming Assignment #4 Pointers 2 Re-write the previous homework assignment using pointers instead of subscripts. Also add a total option. Monthly rental

image

image  

CIS 1202 Programming Assignment #4 Pointers 2 Re-write the previous homework assignment using pointers instead of subscripts. Also add a "total" option. Monthly rental amounts for the seven properties: 1300 500 850 1740 610 990 1225 Requirements 1. Write a menu-driven program with the following commands: a. Enter rent amounts b. Display rents c. Sort rent amounts, low to high d. Calculate the total rents e. Display memory locations f. Exit 2. Define these functions according to these prototypes: a. int getMenuItem(); Displays the menu, gets the user's selection, validates it, and returns a valid menu choice. b. void enterRents (float*, int); Uses a for loop to input the rent amounts into an array using pointers (not subscripts) to access the array elements. c. void displayRents (float *, int); Uses a for loop to display the contents of the rents array using pointers (not subscripts) to access the array elements. d. float sumRents (float *, int); wwwwww Uses a for loop to add up the rents array using pointers (not subscripts) to access the array elements. e. void displayMemoryLocations (float *, int); Uses a for loop to display the memory locations of the array elements. f. void selectionSort (float *, int); 3. In the main function, repeatedly ask for a menu choice and call the appropriate function based on the menu selection. Use the selection sort algorithm to sort the rents array into ascending order using using pointers (not subscripts) to access the array elements. 4. Use the data types which accurately represent the data, and show to two decimal places whenever displaying dollars and cents. 5. Functions must pass parameters and return values as needed, using only local variables. Global variables are not allowed. 6. Use comments to document your program as you see fit. Include comments at the beginning of your program with your name, the class (with section), and the date. // Josh Junior // CIS 1202 101 // January 31, 2021 7. Submit your source code and screen shots of your program output to the dropbox. Sample Output CC:\Users\jeff OneDrive - Sinclair Community Collegel1202 1. Enter rent amounts 2. Display rent amounts 3. Sort rent amounts from low to high 4. Total rents 5. Display memory locations 6. Exit Enter selection: 1 Enter rent amount 1: 1300 Enter rent amount 2: 500 Enter rent amount 3: 850 Enter rent amount 4: 1740 Enter rent amount 5: 610 Enter rent amount 6: 990 Enter rent amount 7: 1225 1. Enter rent amounts 2. Display rent amounts 3. Sort rent amounts from low to high 4. Total rents 5. Display memory locations 6. Exit Enter selection: 2 Rents: 1300.00 500.00 850.00 1740.00 610.00 990.00 1225.00 1. Enter rent amounts 2. Display rent amounts 3. Sort rent amounts from low to high 4. Total rents 5. Display memory locations 6. Exit Enter selection: 3 1. Enter rent amounts 2. Display rent amounts 3. Sort rent amounts from low to high 4. Total rents 5. Display memory locations 6. Exit Enter selection: 2 Rents: 500.00 610.00 850.00 990.00 1225.00 1300.00 1740.00 1. Enter rent amounts 2. Display rent amounts 3. Sort rent amounts from low to high 4. Total rents 5. Display memory locations 6. Exit Enter selection: 5 0083FB5C 0083F860 0083FB64 0083FB68 0083FB6C 0083F870 0083FB74 1. Enter rent amounts 2. Display rent amounts 3. Sort rent amounts from low to high 4. Total rents 5. Display memory locations

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Algorithms questions

Question

Name the different levels of the hierarchy of needs. (p. 264)

Answered: 1 week ago

Question

Solve y" + y = 1 - t 2 / 2 ? if 0 Answered: 1 week ago

Answered: 1 week ago