Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Income calculator
#include <bits/stdc++.h> using namespace std; /** * To run this program, please enter below data. * 1) Enter Age: * 2) Enter yeraly income: * 3) Total expense yeraly: * 4) Already invested amount by customer (for example how much customer has invested in LIC/FD/Other sector already) * */ int main() { long age, yearlyIncome, yearlyExpense, alreadyInvestedAmount, factor; cin>>age>>yearlyIncome>>yearlyExpense>>alreadyInvestedAmount; if(age <=0 || age > 60) { cout<<"Entered age is negative or greater than 60, please enter age between 1 to 60"; return 0; } if(age <= 30) { factor = 22; } else if(age > 30 && age <=40 ) { factor = 18; } else { factor = 10; } long ans = yearlyIncome*factor - yearlyExpense - alreadyInvestedAmount; cout<<"Customer age: "<<age<<endl; cout<<"Customer yearly Income: "<<yearlyIncome<<endl; cout<<"Customer yearly Expense: "<<yearlyExpense<<endl; cout<<"Customer already Invested Amount: "<<alreadyInvestedAmount<<endl; cout<<"Amount customer should Invest: "<<ans<<endl; return 0; }
run
|
edit
|
history
|
help
0
Two pointer - MUST DO
5
-Wall -std=c++14 -O0 -o a.out source_file.cpp
Scope guarding
nearest
Regression Line
stack::swap_30-Seconds-of-C++
ONP
scemo le
precision and fixed point notation