convert the program to java  CODE: #include #include #include #include #include #include #include // header for random number generator (account number) using namespace std; void opt1(); void header(); void menu(); void members(); void newAccount(); void opt(); void enterContinue(); void enterContinue1(); void pinCheck(int& x); /*void close();*/ int length(int x); int main() {     int op1, decide, option, accountNumber, pin, pinLength = 0;     bool openAcc = 0;     double depositAmount, withdrawAmount, totalAmount = 0;     char decide1 = ' ', closeAccount;     srand(time(NULL)); // random number generator     string name;     header();     members();     do     {         header();         menu();         cout << "\n\t\t\tSelect an option (1-7): ";         cin >> option;         system("cls");         switch (option) {                                                  case 3: /////////////////////////////////////////////////////////// Withdraw Amount             header();             cout << "\n\t\t\t       WITHDRAW AMOUNT     " << "\n";             cout << "\n\t\t\t============================ " << endl;             if (openAcc == true) { // If there is an existing account, the program will let the user withdraw.                 pinCheck(pin); // Will ask the user to input their pin for security purposes.                 cout << "\n\t\t\t----------------------------" << endl;                 withdraw:                     cout << "\n\t\t\tHow much would you like to withdraw?" << endl;                     cout << "\n\t\t\t$ ";                     cin >> withdrawAmount;                     if (withdrawAmount > totalAmount) { // The system will not allow the user to withdraw amounts larger than their current balance.                         cout << "\n\t\t\tInsufficient funds.";                         cout << "\n\t\t\tPlease try again." << endl;                         goto withdraw;                     }                     else if (withdrawAmount < 0) { // The system will not allow the user to input a negative amount.                         cout << "\n\t\t\tYou cannot withdraw a negative amount.";                         cout << "\n\t\t\tPlease try again." << endl;                         goto withdraw;                     }                     else { //The total amount will now be updated based on the withdrawal done.                         totalAmount = totalAmount - withdrawAmount;                         cout << "\n\t\t\t----------------------------" << endl;                         cout << "\n\t\t\tYour new balance is $" << totalAmount << "." << endl;                     }                 } case 4: /////////////////////////////////////////////////////////// Balance Inquiry             header();             cout << "\n\t\t\t      BALANCE INQUIRY       " << "\n";             cout << "\n\t\t\t============================" << endl;             if (openAcc == 1) { // The system will only allow the user to continue with the transaction if there is an account open.                 pinCheck(pin); // Will ask the user to input their pin for security purposes.                 cout << "\n\t\t\t----------------------------" << endl;                 cout << "\n\t\t\tYour current balance is $" << totalAmount << "." << endl;             }             else { // Will not let the user to check their balance if there is no existing account.                 cout << "\n\t\t\tPlease create an account first." << endl;             }             cout << "\n\t\t\t----------------------------" << endl;             enterContinue();             break;             else { // Will not let the user withdraw if there is no existing account.                 cout << "\n\t\t\tPlease create an account first." << endl;             }             cout << "\n\t\t\t----------------------------" << endl;             enterContinue();             break;

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

convert the program to java 

CODE:

#include <stdio.h>
#include <direct.h>
#include <stdlib.h>
#include <iostream>
#include <conio.h>
#include <string>
#include <ctime> // header for random number generator (account number)

using namespace std;

void opt1();
void header();
void menu();
void members();
void newAccount();
void opt();
void enterContinue();
void enterContinue1();
void pinCheck(int& x);
/*void close();*/
int length(int x);

int main()
{
    int op1, decide, option, accountNumber, pin, pinLength = 0;
    bool openAcc = 0;
    double depositAmount, withdrawAmount, totalAmount = 0;
    char decide1 = ' ', closeAccount;
    srand(time(NULL)); // random number generator
    string name;

    header();
    members();

    do
    {
        header();
        menu();
        cout << "\n\t\t\tSelect an option (1-7): ";
        cin >> option;
        system("cls");

        switch (option) {

   
              


               

              case 3: /////////////////////////////////////////////////////////// Withdraw Amount
            header();
            cout << "\n\t\t\t       WITHDRAW AMOUNT     " << "\n";
            cout << "\n\t\t\t============================ " << endl;

            if (openAcc == true) { // If there is an existing account, the program will let the user withdraw.
                pinCheck(pin); // Will ask the user to input their pin for security purposes.
                cout << "\n\t\t\t----------------------------" << endl;

                withdraw:
                    cout << "\n\t\t\tHow much would you like to withdraw?" << endl;
                    cout << "\n\t\t\t$ ";
                    cin >> withdrawAmount;

                    if (withdrawAmount > totalAmount) { // The system will not allow the user to withdraw amounts larger than their current balance.
                        cout << "\n\t\t\tInsufficient funds.";
                        cout << "\n\t\t\tPlease try again." << endl;
                        goto withdraw;
                    }
                    else if (withdrawAmount < 0) { // The system will not allow the user to input a negative amount.
                        cout << "\n\t\t\tYou cannot withdraw a negative amount.";
                        cout << "\n\t\t\tPlease try again." << endl;
                        goto withdraw;
                    }
                    else { //The total amount will now be updated based on the withdrawal done.
                        totalAmount = totalAmount - withdrawAmount;
                        cout << "\n\t\t\t----------------------------" << endl;
                        cout << "\n\t\t\tYour new balance is $" << totalAmount << "." << endl;
                    }


                }

case 4: /////////////////////////////////////////////////////////// Balance Inquiry
            header();
            cout << "\n\t\t\t      BALANCE INQUIRY       " << "\n";
            cout << "\n\t\t\t============================" << endl;
            if (openAcc == 1) { // The system will only allow the user to continue with the transaction if there is an account open.
                pinCheck(pin); // Will ask the user to input their pin for security purposes.
                cout << "\n\t\t\t----------------------------" << endl;
                cout << "\n\t\t\tYour current balance is $" << totalAmount << "." << endl;
            }
            else { // Will not let the user to check their balance if there is no existing account.
                cout << "\n\t\t\tPlease create an account first." << endl;
            }
            cout << "\n\t\t\t----------------------------" << endl;
            enterContinue();
            break;
            else { // Will not let the user withdraw if there is no existing account.
                cout << "\n\t\t\tPlease create an account first." << endl;
            }
            cout << "\n\t\t\t----------------------------" << endl;
            enterContinue();
            break;

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY