C++ help
Jan 10, 2015 at 3:08pm UTC
Hello I am currently in the subject of C++ in school. I had done half of the code can you guys help me do the code or at least give me an example of what I'm suppose to do. Here is the code, if you guys do want to learn more of what I'm suppose to do and get a better perspective, please send me a PM.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
#include "stdafx.h"
#include <process.h>
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
void incomeStatement();
void balanceSheet();
bool quitSystem();
int main()
{
bool exitSystem = false ;
string password1;
string password2;
cout << "Please set password:\n" ;
cin >> password1;
cout << "Pleaes reenter the password-_-:\n" ;
cin >> password2;
if (password1==password2)
{
cout << "Hello user, you had successfully entered the password!" ;
}
do
{
system ("cls" );
cout << "1) Income Statement" <<endl << endl;
cout << "2) Balance Sheet" << endl;
cout << "3) Exit" << endl;
cout << "Select 1, 2, or 3 " ;
int userChoice = 0;
cin >> userChoice;
switch (userChoice)
{
case 1:
incomeStatement();
break ;
case 2:
balanceSheet();
break ;
case 3:
exitSystem = quitSystem();
break ;
default :
cout << "Invalid entry" << endl;
}
}
while (exitSystem == false );
system ("pause" );
return 0;
}
void incomeStatement()
{
system ("csl" );
cout << "Hi user!" << endl;
cout << "Please enter your income." << endl;
while (true );
system ("pause" );
}
void balanceSheete()
{
system ("cls" );
cout << "Hi user!" ;
while (true );
system ("pause" );
}
bool quitSystem()
{
char response;
bool retVal = false ;
do
{
system("cls" );
cout << "Are you sure you want to quit? (y/n) " << endl << endl;
cin >> response;
if ( (response == 'y' ) || (response == 'Y' ) )
{
retVal = true ;
break ;
}
else if (( response == 'n' ) || (response == 'N' ))
{
retVal = false ;
break ;
}
}
while (true );
return retVal;
}
Jan 10, 2015 at 4:16pm UTC
if you guys do want to learn more of what I'm suppose to do and get a better perspective, please send me a PM.
If you want help with something isn't it better just to state what's wrong and what specifically you want help with?
edit: also this won't link either. You've declared this:
void balanceSheet();
but implemented this:
void balanceSheete()
edit 2: why have you put infinite while loops in your functions?
I had done half of the code
I think it's better to get some code working first and then move on the next part of the project, rather than three functions that won't work.
Last edited on Jan 10, 2015 at 4:23pm UTC
Topic archived. No new replies allowed.