Encerrado

Quick Help with C++ for experienced pros!

What am I doing wrong?

What the software is supposed to do:

-------------------------------

Take input values from user

amount, zip, security code

then compare them with the "card.json" file

if the value are correct then proceed to create a new file named "out.json" which will have the contents of the original "card.json" file but will have the new available balance

----------------------------------

using namespace std;

int main()

{

int zip, scode;

double amount;

cout<< "Enter Amount: ";

cin >> amount;

cout << "Enter Zip: ";

cin >> zip;

cout << "Enter Security Code: " ;

cin >> scode;

cout << endl;

ifstream in;

[url removed, login to view] ("card.json");

string f_name,l_name,issuer;

int exp_month, exp_year, s_code, zip_code, c_number;

double avail_b;

[url removed, login to view](15);

getline(in, f_name);

[url removed, login to view](15);

getline (in, l_name);

[url removed, login to view](11);

getline(in, issuer);

[url removed, login to view](12);

in >> c_number;

[url removed, login to view](16);

in >> exp_month;

[url removed, login to view](17);

in >> exp_year;

[url removed, login to view](11);

in >> s_code;

[url removed, login to view](11);

in >> zip_code;

[url removed, login to view](17);

in >> avail_b;

cout << "Verifying ..." <<endl;

cout << endl;

cout <<"Authorization response: " << endl;

cout << "First Name: " << f_name<<endl;

cout << "Last Name: " << l_name<<endl;

cout <<"Issuer : " << issuer<<endl;

cout <<"Card Number: " << c_number <<endl;

cout <<"Experation Month: " << exp_month<<endl;

cout << "Experation Year: " << exp_year<<endl;

cout << "Security Code: " << s_code <<endl;

cout << "Zip Code: " << zip_code << endl;

cout <<"Available Balance: " << avail_b <<endl<<endl;

if( s_code!=scode)

cout << "DENIED: Security Code Mismatch" << endl;

else if( zip_code != zip)

cout << "DENIED: Zip Code Mismatch" <<endl;

else if(exp_month <= 12 && exp_year < 2009 )

cout << "DENIED: Card has Expired" << endl;

else if( avail_b <= amount)

cout << "DENIED: Insufficient Funds" <<endl;

else

cout <<" APPROVED"<<endl<<endl<<"Saving new data..."<<endl;

ifstream open;

[url removed, login to view]("card.json");

string fname, lname, issuer2,number, emonth,eyear,code,zip2;

getline(open,fname);

getline(open,lname);

getline(open,issuer2);

getline(open,number);

getline(open,emonth);

getline(open,eyear);

getline(open,code);

getline(open,zip2);

ofstream out;

[url removed, login to view]("out.json");

out << fname <<endl;

out << lname <<endl;

out << issuer2<< endl;

out << emonth<<endl;

out << eyear<<endl;

out << code <<endl;

out << zip2<<endl;

return 0;

}

<<<<<<< BELOW IS THE JSON FILE>>>>>>>>>>>>{

"first_name": "Arthur" ,

"last_name" : "Dent" ,

"issuer": "Visa" ,

"number" : 987654321 ,

"exp_month": 12 ,

"exp_year" : 2009 ,

"code": 1022 ,

"zip" : 92831 ,

"available: " 12000.0

}

Habilidades: Programação C, Programação C#

Ver mais: lt security, quick help, std, pros, open c, new year card, json c, int, endl, arthur, create balance, json string, quick json, help data, json response, wrong number values, help using, experienced user, json amp, json input, quick data, authorization, software expired, value double, string compare

Acerca do Empregador:
( 7 comentários ) New York, United States

ID do Projeto: #538544

22 freelancers estão ofertando em média $38 para este trabalho

gurux18

Hello! Please check PM.

$30 USD in 0 dias
(10 Comentários)
5.0
infoaio

Hi I have already fixed your problem! Please see my demo at (http://www.mediafire.com/download.php?jl3mwznzi4l) if you accept me then i will send to you all new source code! Thanks!

$30 USD in 0 dias
(30 Comentários)
4.1
vishumalka

I am experienced c++ programmer.I can do this.

$30 USD in 0 dias
(6 Comentários)
2.8
venkii1

Hi, Please check PM. Thanks. Venky

$30 USD em 1 dia
(2 Comentários)
2.4
Profprogram

So easy. Check PMB, thanks. REgards.

$30 USD in 0 dias
(3 Comentários)
0.0
patsfan1290

I have the Source code completed in the format that CSUF CPSC 120 wouldn't question and would find quite adaquit. The code asks for Amount spent, Zip, and Security code. Then Reads from a JSON file, examines and us Mais

$30 USD in 0 dias
(0 Comentários)
0.0
cmancuso

PM for more details if necessary.

$50 USD in 7 dias
(0 Comentários)
0.0
tichca

I can do this.. Thanks, Ted

$30 USD em 1 dia
(0 Comentários)
0.0
RageCoder911

hi mr, i have solved your problem. The file main.cpp is written and to ready to be given to you. regards.

$30 USD in 0 dias
(0 Comentários)
0.0
moiseman

I can help you immediately. Solved your issue.

$30 USD in 0 dias
(0 Comentários)
0.0
ShubhabrataKarma

I am confident of helping you.

$100 USD in 5 dias
(0 Comentários)
0.0
vsreelesh

I have already checked the code. Can give the solution immediately if you give me the project.

$30 USD em 1 dia
(0 Comentários)
0.0
vkozlov

I can help you, i missed some stl headers.

$30 USD em 1 dia
(0 Comentários)
0.0
yadavram

ii am intrested in this project please give me a positive respomse thanks.

$100 USD in 5 dias
(0 Comentários)
0.0
sreeiit

please check PMB

$30 USD in 0 dias
(0 Comentários)
0.0
fbaig

Sir, I am interesred in figuring out your mistake rather already figured out. Ready to help you at lower rates Regards

$30 USD em 1 dia
(0 Comentários)
0.0
shaina2231

i hv designed various desktop applications in c++ so plz contact me

$30 USD em 1 dia
(0 Comentários)
0.0
RS42

hi Please check PM. I can provide corrected code with explanation in a day. RS42

$30 USD em 1 dia
(0 Comentários)
0.0
GoodDevelopers

Please check PM.

$30 USD em 1 dia
(0 Comentários)
0.0
alexpena

Hi, I can help you with this file, it's easy. I can give you some recommendations as well.

$30 USD em 1 dia
(0 Comentários)
0.0