Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Code below is interest rate code and need to create a multidimensional array with all requirements given in question. Thank you!! /* * To change

image text in transcribed

Code below is interest rate code and need to create a multidimensional array with all requirements given in question. Thank you!!

/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */

/*Prints a table of compound interest*/

#include

#define NUM_RATES ((int) (sizeof(value) / sizeof(value[0]))) #define INITIAL_BALANCE 100.00 int main(void) {

int AskUserInput(int flag) { int input = 0; if(flag == 1) { printf("Enter interest rate:"); } else { printf("Enter number of years:"); } scanf("%d", &input); return input; } void Printrates (double valueArray[], int rate, int i) { printf("%8d%%", rate + i); valueArray[i] = INITIAL_BALANCE; }

void PrintMonitary(int years, int rate, double valueArray[], int size) { for (int year = 1; year

int main(void) { int i, low_rate, num_years; double value[5]; low_rate = AskUserInput(1); num_years = AskUserInput(2); printf(" Years"); for ( i= 0; i

{ int i, low_rate, num_years, year; double value[5]; printf("Enter interest rate:"); scanf("%d", &low_rate); printf("Enter number of years:"); scanf("%d", &num_years); printf(" Years");

for (i= 0; i ZD Arrays - Interest Rates Assignment The assignment In this assignment you will take the in class Interest Rates code example and create a multi-dimensional array to store the rate values in and to print output. See included PowerPoints for examples. 1. 2. 3. 4. Make sure you put your name in comments in your code Make sure you comment your code to show your understanding of the processes Add comments before each function to explain the input, output, and purpose of the function. Adhere to correct naming conventions, no one letter variable names (modify original code as needed), correct tabbing, and spacing. Unreadable code will not be graded If your code does not run, do not submit it. You will receive a 0. Email me or see me in my office if you have trouble. Make backups of functioning code versions. Use the grading rubric at the bottom as an additional completion checklist. 5. 6. Requirements List Declare 2 new constant variables: (Constants must adhere to correct naming conventions and styles) 1. A variable for rows of size 10 A variable for columns of size 5 Delete the initial balance constant and declare it as a float variable in the main instead a. b. c. 2. In the main, you will create two arrays: Initialize them both to 0 a. A 1D array called Rates of size num rates b. Turn values into a 2D array of size rows and columns. 3. Modify the functions to pass and utilize the 1D and 2D arrays as needed. a. PrintRates b. PrintMonitary Modify the AskUserlnput function to ask for an initial investment instead of years. (Since 2D arrays must be of constant size, we cannot allow them to enter a number of years anymore.) Modify the code in main to create looping input. le, after accepting user input and printing the table, ask if they want to continue or exit. If they continue, ask for new input, and reprint the table 4. 5. ZD Arrays - Interest Rates Assignment The assignment In this assignment you will take the in class Interest Rates code example and create a multi-dimensional array to store the rate values in and to print output. See included PowerPoints for examples. 1. 2. 3. 4. Make sure you put your name in comments in your code Make sure you comment your code to show your understanding of the processes Add comments before each function to explain the input, output, and purpose of the function. Adhere to correct naming conventions, no one letter variable names (modify original code as needed), correct tabbing, and spacing. Unreadable code will not be graded If your code does not run, do not submit it. You will receive a 0. Email me or see me in my office if you have trouble. Make backups of functioning code versions. Use the grading rubric at the bottom as an additional completion checklist. 5. 6. Requirements List Declare 2 new constant variables: (Constants must adhere to correct naming conventions and styles) 1. A variable for rows of size 10 A variable for columns of size 5 Delete the initial balance constant and declare it as a float variable in the main instead a. b. c. 2. In the main, you will create two arrays: Initialize them both to 0 a. A 1D array called Rates of size num rates b. Turn values into a 2D array of size rows and columns. 3. Modify the functions to pass and utilize the 1D and 2D arrays as needed. a. PrintRates b. PrintMonitary Modify the AskUserlnput function to ask for an initial investment instead of years. (Since 2D arrays must be of constant size, we cannot allow them to enter a number of years anymore.) Modify the code in main to create looping input. le, after accepting user input and printing the table, ask if they want to continue or exit. If they continue, ask for new input, and reprint the table 4. 5

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

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

Students also viewed these Databases questions