Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
chazog
/
iax0583
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
1f45263b
authored
Dec 16, 2018
by
chazog
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
a37aaff2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
89 additions
and
0 deletions
Lab10/Bonus.c
Lab10/Bonus.c
0 → 100644
View file @
1f45263b
#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
\n
balance:%lg"
,
status
[
i
],
balance
[
i
]);
printf
(
"
\n
input 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
.
07
9
);
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
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment