Commit 1f45263b by chazog

Upload New File

parent a37aaff2
Showing with 89 additions and 0 deletions
#include <stdio.h> //stream redirection
#include <string.h>
#include "lab11.h"
int main(){
int i, check, N, y;
char name[rows][100];
char password[rows][100];
char status[rows][100];
float balance[rows], FutureBal;
char input[10];
for(i = 0; i < rows; i++){
scanf("%s %s %s %f", name[i], password[i], status[i], &balance[i]);
}
do{
printf("input login:\n");
check = 1;
scanf("%s", input);
for(i = 0; i < rows; i++){
if(strcmp(input, name[i]) == 0){
check = 0;
break;
}
}
if(check == 1){
printf("You should try again, dude\n");
}
}while(check == 1);
do{
printf("Input password:\n");
check = 1;
scanf("%s", input);
if(strcmp(input, password[i]) == 0){
check = 0;
break;
}
if(check == 1){
printf("You should try again, dude\n");
}
}while(check == 1);
printf("status:%s \nbalance:%lg", status[i], balance[i]);
printf("\ninput number of years:\n");
scanf("%d", &N);
if((strcmp(status[i], "silver") == 0) || (strcmp(status[i], "SILVER") == 0)){
if(balance[i] > 0){
for(y = 0; y < N; y++){
printf("dicks");
FutureBal = Fbalance(balance[i], y, 1.005);
printf("Balance in %d year is :\t%.2f\n", y, FutureBal);
}
}
else if(balance[i] < 0){
for(y = 0; y < N; y++){
FutureBal = Fbalance(balance[i], y, 1.083);
printf("Balance in %d year is :\t%.2f\n", y, FutureBal);
}
}
else{
printf("Balance in %d years is :\n 0", N);
}
}
else{
if(balance[i] > 0){
for(y = 0; y < N; y++){
FutureBal = Fbalance(balance[i], (y*2), 1.003);
if(y%2 == 0){
printf("Balance in %d year is :\t%.2f\n", y, FutureBal);
}
}
}
else if(balance[i] < 0){
for(y = 0; y < N; y++){
FutureBal = Fbalance(balance[i], y, 1.079);
printf("Balance in %d year is :\t%.2f\n", y, FutureBal);
}
}
else{
printf("Balance in %d years is :\n 0", N);
}
}
puts("booty");
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment