Mainly due to the fact my book barely explains array's and doesn't really tell how to manually take user-input and feed it into an array, I am having some issues as of now.
I am trying to take three user defined inputs and store them into my array int real.
I get no compile errors as it is, and I am more or less wondering if someone can help me fix up whatever it is that needs fixing. I'v checked online for how to manually put values into an array, however it seems everything I see does it via a counter, which doesn't help me at all. Any help would be appreciated, and i'll post my code below.
(Not finished, just using a printf statement to try and get it so the output is actually real and I know it works properly.)
/* Loan Calculator
Name: Tyler Sinclair-Day
Purpose: To create a calculator which will use a loan calculation to display a table in which how long a loan will take
to pay of, as well as how much each month will be paid, showing other information as showed in the program
int menu(void); //Prototype for int menu(void) function
//Printf showing options to user as what each number represents for entering data//
printf("--------------------\nEnter in the Numeric \nCharacter next to your choice"
printf("||1. Enter the Principal ||\n"
"||2. Enter the annual interest rate ||\n"
"||3. Enter duration of loan in months ||\n"
"||4. Calculate your loan payments. ||\n"
"||5. Show Loan Table. ||\n"
"||0. Exit program ||\n");
real = menu(); //Calling menu function
//printf("Month::Old Balance::Payment::Interest::Principal::New Balance");
printf("%d and %d and %d", real, real, real);
int menu(void)//Menu function for gathering information from user.
while ((scanf("%d", &choice)) != 0)//Runs until recieves '0' than quits
switch (choice)//Case used for gathering data
case 1://Gets data for principal
printf("What is the principal you wish to enter?:\n");
case 2://Gets data interest rate
printf("What is the annual interest rate?:\n");
case 3://Gets data for months
printf("How many months in which does the loan need to be paid?:\n");
case 4://Calculates table
printf("Your payment chart is calculated.\n");
case 5://Prints table out
printf("Below is your loan table.\n\n\n");
default://Will display message if number >5 or <1 is entered.
printf("You entered a value outside of 1 to 5.\nPlease only use 1, 2, 3, 4, 5 or 0 to exit.\n\n");
/*for(int i = 0;i < months; ++i)
printf(" new balance: %d ", newbalance);
principal = principal * (1 + (rate / 12));