CIS 1202 Programming Assignment #4 Pointers 2 Re-write the previous homework assignment using pointers instead of...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 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
Expert Answer:
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these algorithms questions
-
re Regular Languages and Finite Automata (a) Let L be the set of all strings over the alphabet {a, b} that end in a and do not contain the substring bb. Describe a deterministic finite automaton...
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
Which of the following quadratic equations is in standard form? (a) x 2 7x = 5 (b) 9 = x (c) (x + 5)(x - 4) = 0 (d) 0 = 5x - 6x - 1
-
An engineer proposes to store 75 kJ of energy by flowing 1.5 kA of current through a superconducting solenoid that forms an inductor. (a) What is the required inductance L? (b) If the solenoid is to...
-
Dylan is a single taxpayer with $600,000 of taxable income, which results in a regular tax liability of $187,690 in 2018. Dylan is extremely cautious about being subject to AMT and wants to know how...
-
Comparing two types of automobile engines, a consumer testing service obtained the following pickup ( \(0-100 \mathrm{kmph})\) times (rounded to the nearest tenth of a second): Use the \(U\) test at...
-
The financial statements of Ridgeview Employment Services, Inc., reported the following accounts (adapted, with dollar amounts in thousands except for par value): Prepare the stockholders equity...
-
An arrow is shot from a height of 1.95 m toward a cliff of height H . It is shot with a velocity of 25 m/s at an angle of 60 above the horizontal. It lands on the top edge of the cliff 3.67 s later....
-
What is activity-based costing, and what are its potential benefits?
-
Problem B. Consider a gas in a box with N=5 particles, divided by an imaginary line into two regions (left and right). 1. How many micro-states have 3 particles to the left (and 2 to the right)? 2....
-
Q2. The sand (Gs = 2.65) in a deep natural deposit has an effective angle of internal friction of 37 and a dry unit weight of 17 kN/m. Calculate the shear strength of the sand at a depth of 6 m below...
-
Why is Diversity promotes a variety of perspectives, creativity, and a more inclusive organizational culture, leading to better decision-making and problem-solving.diversity important in...
-
Key Figures Alltech Synergy XT Liabilities + owners' equity........... $11,502 $48,823 Net income................................ 3,127 9,276 Sales......................................... 15,453...
-
Visit any social media site with news stories that includes a photograph/snapshot of story (mandatory) . Choose ONE news story. Use the questions below to help you determine validity of that ONE news...
-
Decide which vehicle to purchase: Your team wants to start an independent ride-hailing service like Uber and need to decide the type of vehicle to purchase. The target customer is students who need...
-
Non-Differentiability Corner Illustrate that the following function f(x) is not differentiable at x-2 due to a corner. - x2 + 4x +1 x <2 f(x) x2 - 2x+5 x22 { f(x) = { -x^2 + 4x + 1, x <2 (x^2 - 2x +...
-
Danielle has an insurance policy with a premium of $75 per month. In September she is in an accident and receives a bill worth $2990 for the repair of her own property. Her deductible is $250 and her...
-
Amy is a calendar-year taxpayer reporting on the cash basis. Please indicate how she should treat the following items for 2012: a. She makes a deductible contribution to an IRA on April 15,...
-
Sophie is a single taxpayer. For the first payroll period in October 2012, she is paid wages of $3,250 monthly. Sophie claims three allowances on her Form W-4. a. Use the percentage method to...
-
For each of the following situations, indicate whether the taxpayer(s) is (are) required to file a tax return for 2012. Explain your answer. a. Helen is a single taxpayer with interest income in 2012...
-
Establish the result in Example 41 concerning the difference of two independent normal random variables, \(X\) and \(Y\). Data From Example 41 EXAMPLE 41 Sum of two independent normal random...
-
Let \(X\) be a continuous random variable having probability density function \[f(x)= \begin{cases}2 e^{-2 x} & \text { for } x>0 \\ 0 & \text { elsewhere }\end{cases}\] (a) Find the moment...
-
Let \(X\) and \(Y\) be independent normal random variables with \[\begin{array}{lll}E(X)=4 & \text { and } & \sigma_{X}^{2}=25 \\E(Y)=3 & \text { and } & \sigma_{Y}^{2}=16\end{array}\] (a) Use moment...
Study smarter with the SolutionInn App