[Solved]1 Count Median Sketch Consider Count Min Sketch Algorithm Class Determining Heavy Hitters Q37289254

1 Count-Median-Sketch Consider the Count-Min-Sketch algorithm from class for determining heavy hitters in a stream. Suppose t

1 Count-Median-Sketch Consider the Count-Min-Sketch algorithm from class for determining heavy hitters in a stream. Suppose that we change the algorithm to consider median,..Mli, hi(x)] instead of the min function (a) Give an argument that the estimator for heavy hitters is still correct. b) If we allow the stream to both insert and delete elements, show that the median based algorithm works to find heavy hitters. Each item r in the stream now comes with a an element Д E {+1,-1} indicating whether it is an addition operation or deletion. Note that the number of deletions could be more than the number of additions (c) Would Count-Min-Sketch work for the setup above? Show transcribed image text 1 Count-Median-Sketch Consider the Count-Min-Sketch algorithm from class for determining heavy hitters in a stream. Suppose that we change the algorithm to consider median,..Mli, hi(x)] instead of the min function (a) Give an argument that the estimator for heavy hitters is still correct. b) If we allow the stream to both insert and delete elements, show that the median based algorithm works to find heavy hitters. Each item r in the stream now comes with a an element Д E {+1,-1} indicating whether it is an addition operation or deletion. Note that the number of deletions could be more than the number of additions (c) Would Count-Min-Sketch work for the setup above?

Expert Answer


Answer to 1 Count-Median-Sketch Consider the Count-Min-Sketch algorithm from class for determining heavy hitters in a stream. Supp… . . .

[Solved]1 Create Class Called Player Write Proper Attributes Name String Description String Points Q37284981

1)    Create a class called Player: Write theproper attributes

Name (string), Description (string), points[] for every game(array of int) and the correct functions (Accessors and mutatorsthat access and update the info of the variables. Create the rightspecification file and implementation file. (.h and .cpp files)

2)    Create a player (player1) and initializeits members to the following values: name=””, description=”” andpoints [0,0,0,0,0,0,0,0,0,0] through a constructor. (Create aprivate function called by the constructor to build the array)

3)    Create 5 more players using a copyconstructor. (Keep those players in an array.

4)    The program asks to enter every player’sinfo to the user and keep that info in the instance variables ofevery player (Use the mutators).

5)    Create an extra object of the class player(player_extra) and assign player1 to player_extra. (Overload the=operator) Then change Player_extra points (use the mutator toupdate the array contents)

6)    Use the io manipulators to display thetotal points of the team, average points per game, total points perplayer, and avg per player results in the output file.

Use fixed, setw(), setprecision(2), and showpoint.

Expert Answer


Answer to 1) Create a class called Player: Write the proper attributes Name (string), Description (string), points[] for every gam… . . .

[Solved]1 Create C Program Passes Structures Function Arguments Returns Structure Function One Fun Q37279448

1. Create C program that passes structures as function arguments and returns a structure from a function. One can have a func

1. Create C program that passes structures as function arguments and returns a structure from a function. One can have a function of type returning a structure or a pointer to it. Name the structure BuildStructure such as: struct BuilStructure int Value1; int Value2; Buildstructure; The source code is to show how to operate when one has a function taking structure as an argument: Try to implement a passing structure in function and returning structure from function program. You may use a BuildStructure, create function declarations, use a function display_output. Create a structure to get a return from UserInput function, use DisplayOutput to print the input, make BuildStructure function to return a structure after storing the user input into it. Show transcribed image text 1. Create C program that passes structures as function arguments and returns a structure from a function. One can have a function of type returning a structure or a pointer to it. Name the structure BuildStructure such as: struct BuilStructure int Value1; int Value2; Buildstructure; The source code is to show how to operate when one has a function taking structure as an argument: Try to implement a passing structure in function and returning structure from function program. You may use a BuildStructure, create function declarations, use a function display_output. Create a structure to get a return from UserInput function, use DisplayOutput to print the input, make BuildStructure function to return a structure after storing the user input into it.

Expert Answer


Answer to 1. Create C program that passes structures as function arguments and returns a structure from a function. One can have a… . . .

[Solved]1 Create Run Sql Query Return Display First Names Email Last Names Job Identifications Emp Q37280195

1. Create and run an SQL query that will return/display thefirst names, email, last names and job identifications of employeesfrom the EMPLOYEES table and the department identifications anddepartment name from the DEPARTMENTS table.

SELECT first_name, email, last_name, job_id,

(SELECT department_name FROM departments d

WHERE e.department_id = d.department_id) department

FROM employees e ORDER BY department;

2. Based on your SQL statement above, do you need toqualify/prefix any of the column names in the SELECT statement? Ifso, which column names do you have to qualify/prefix. For anycolumns that you don’t need to qualify/prefix, why don’t you haveto?

3. This problem will involve a three-way join using three tablesin our database. Write an SQL query to retrieve/display theemployee identifications, cities, department name, manageridentifications, and location identifications.

4. Rewrite your SQL statement above (for #3) to get the exactsame result but with using different SQL keywords (your SELECTstatement can remain the same).

Expert Answer


Answer to 1. Create and run an SQL query that will return/display the first names, email, last names and job identifications of em… . . .

[Solved]1 Create File Using Word Processing Program Text Editor Write Application Displays File S Q37295451

1. Create a file using any word-processing program or text editor. Write an application that displays the files name, contai

1. Create a file using any word-processing program or text editor. Write an application that displays the file’s name, containing folder, size, and time of last modification. Save the file as FileStatistics.java. Show transcribed image text 1. Create a file using any word-processing program or text editor. Write an application that displays the file’s name, containing folder, size, and time of last modification. Save the file as FileStatistics.java.

Expert Answer


Answer to 1. Create a file using any word-processing program or text editor. Write an application that displays the file’s name, c… . . .

[Solved]1 Create Two Avl Trees 7 Keys B C D E F G 5 040 Different Key Sequences Produce 429 Unique Q37156333

#1 Create two AVL trees with 7 keys: A, B, C, D, E, F, and G.(There are 5,040 different key sequences that produce 429 uniquetrees. Of those trees, 17 are AVL trees.)

a. Draw the shortest AVL tree containing these 7 keys.

b. Draw one of the tallest possible AVL trees containing these 7keys.

Expert Answer


Answer to #1 Create two AVL trees with 7 keys: A, B, C, D, E, F, and G. (There are 5,040 different key sequences that produce 429 … . . .

[Solved]1 Dbms Enforces Delete Restrict Option Referential Integrity Constraint Salesrep Territory Q37158462

SALES REP TERRITORY SRID SRName TerlDTerlD TerName Joe Sue East W West South N North 2 3 4 Meg Bob Joe Pat Lee Joe Central 6

1. If a DBMS enforces a DELETE RESTRICT option on thereferential integrity constraint between SALES_REP and TERRITORY,show the records in tables SALES_REP and TERRITORY after a usertries to delete the fourth record (N, North) fromTERRITORY.

2.  If a DBMS enforces a DELETE CASCADE option on thereferential integrity constraint between SALES_REP and TERRITORY,show the records in tables SALES_REP and TERRITORY after a usertries to delete the fourth record (N, North) fromTERRITORY.

3.   If a DBMS enforces a DELETE SET-TO-NULLoption on the referential integrity constraint between SALES_REPand TERRITORY, show the records in tables SALES_REP and TERRITORYafter a user tries to delete the fourth record (N, North)from TERRITORY.

4  If a DBMS enforces an UPDATE RESTRICT option on thereferential integrity constraint between SALES_REP and TERRITORY,show the records in tables SALES_REP and TERRITORY after a usertries to change the fourth record (N, North) in TERRITORYto (NO, North).

5.  f a DBMS enforces an UPDATE CASCADE option on thereferential integrity constraint between SALES_REP and TERRITORY,show the records in tables SALES_REP and TERRITORY after a usertries to change the fourth record (N, North) in TERRITORYto (NO, North).

6.  If a DBMS enforces an UPDATE SET-TO-NULL option onthe referential integrity constraint between SALES_REP andTERRITORY, show the records in tables SALES_REP and TERRITORY aftera user tries to change the fourth record (N, North) inTERRITORY to (NO, North).

SALES REP TERRITORY SRID SRName TerlDTerlD TerName Joe Sue East W West South N North 2 3 4 Meg Bob Joe Pat Lee Joe Central 6 Show transcribed image text SALES REP TERRITORY SRID SRName TerlDTerlD TerName Joe Sue East W West South N North 2 3 4 Meg Bob Joe Pat Lee Joe Central 6

Expert Answer


Answer to 1. If a DBMS enforces a DELETE RESTRICT option on the referential integrity constraint between SALES_REP and TERRITORY, … . . .

[Solved]1 Date Class Mplement Date Class Following Private Member Variables Month Type Int Day Typ Q37192832

Write the code in C++. Thanks.

1. Date class mplement a Date class that has the following private member variables: month of type int day of type int year o. 3. Account class Account has the following member variables private accountNumber of type int ownerName of type string protprint0: a virtual member function that prints accountNumber, ownerName, balance. This function is called in a few instances i6. Additional Requirements a) What to turn in You should not have any in-line member function and submit the following filesc) Input validation .Show an error message if the withdrawal amount is excessive (result in negative balance for a regular ac7. Implementation Notes For simplicity, you may assume all the data typed is properly formatted (no need to do input validati3. Record a Transaction in history To record a transaction, you should implement recordTransaction, a member function of AccoScreen output sample The below screen output is for output test-1 1->Create regular accnt, 2->Create premium accnt, 3->DeposiAccount created: Premium account , #: 1003, Name : Solo, Balance : 5000.50 Galactic unǐt3 1->Create regular accnt, 2->Create1->Create regular accnt, 2-Create premium accnt, 3->Deposit to accnt 4-Withdraw from accnt, 5->Print info accnts, 6-Quit

1. Date class mplement a Date class that has the following private member variables: month of type int day of type int year of type int hour of type int //hour is in military time, e.g. 23 for 11 PM In what follows, a date will be represented as mm/dd/yyyy/hh and the following member functions: public: set(month day_ year_, hour_) mutator that sets the variables month, day, year, and hour to the parameter values print0: Prints the date in the format “Month dd, yyyy, hh:00”. For example, “March 12,2103, 23:00. getMonth0: accessor that returns the month .getDay0: accessor that returns the day getYearO: accessor that returns the year .getHourO: accessor that returns the hour Do not write a constructor. 2. Transaction structure This structure is declared in Account.h struct Transaction Date date; int transactionType 1, 1, 2 for account creation, deposit and withdrawal respectively double amount; . 3. Account class Account has the following member variables private accountNumber of type int ownerName of type string protected balance of type double .numberAccounts of type static int, initialized to zero transactionHistory of type Transaction*// This variable is declared but not used in the basic version numberTransactions of type int )// This variable is declared but not used in the basic version and the following member functions Account(ownerName, balance_, date_) is the constructor that initializes the account’s member variables ownerName and balance balance_ is the amount deposited when the account is created. accountNumber is set to (numberAccounts+1000) and numberAccounts is incremented. transactionHistory is set to nullptr, numberTransactions set to zero. The date_ is only a place holder for the extra credit version and not used in the basic version. withdraw(amount, date_) a virtual member function to withdraw a specified amount from the account. The function should first check if there is sufficient balance in the account. If the balance is sufficient, withdrawal is processed and the function returns true. Otherwise the withdrawal is not made and the function returns false. If the withdrawal is made, the withdrawal amount is deducted from balance. The date_ is only a place holder for the extra credit version and not used in the basic version deposit(amount, date_) function to deposit a specified amount of money to the account. The function should first check if the deposit amount is positive. If it is positive, deposit is processed and the function returns true. Otherwise the deposit is not made and the function returns false. If the deposit is made, the amount is added to balance. The date_ is only a place holder for the extra credit version and not used in the basic version. . getAccountNumber0: An accessor function that returns the account number. . getBalance0: An accessor function that returns the account balance getNumberAccounts0: A static member function that returns numberAccounts print0: a virtual member function that prints accountNumber, ownerName, balance. This function is called in a few instances in main, print0: a virtual member function that prints accountNumber, ownerName, balance. This function is called in a few instances in main, including when the user chooses “print info for all accounts 4. RegularAccount class Implement a RegularAccount class that is derived from the Account class it has the following public members RegularAccount(ownerName balance_ date_) is the constructor which passes the arguments to the Account constructor print0: overrides the print0 of Account. This function prints the string “Regular account” then prints accountNumber, ownerName, balance To print the accountNumber, ownerName, balance, call the print function of Account with this statement: this->Account print0 5. PremiumAccount class Implement a PremiumAccount class that is derived from the Account class. In addition to the inherited members, it has the following private member variables: MIN BALANCE of type static double, initialized to 1000. The customer of a premium account is required to maintain a balance of at least MIN BALANCE galactic units and the following public member functions PremiumAccount(name, amount) is the constructor which passes the arguments to the Account constructor withdraw(amount, date): overrides the withdraw0 of Account. The function should first check if the existing balance is greater or equal to the withdrawal amount+ MIN BALANCE. If so, withdrawal is processed and the function returns true. Otherwise the withdrawal is not made and the function returns false. If the withdrawal is made, the withdrawal amount is deducted from balance. The date_ is only a place holder for the extra credit version and not used in the basic version. getMinBalance0:A static member function that returns MIN_BALANCE print0: overrides the print0 of Account. This function prints the string “Premium account” then prints accountNumber, ownerName, balance. To print the accountNumber, ownerName, balance, call the print function of Account with this statement: this->Account:print0 6. Additional Requirements a) What to turn in You should not have any in-line member function and submit the following files main.cpp Account.cpp PremiumAccount.cpp RegularAccount.cpp b) Outline of main const int MAX_NUM ACCOUNTS 5; Account accountArray [MAXNUM ACCOUNTS1: Lo p on dǐ3playing the f 11 wing menu f choice3 : 1. Create regular account (user will be prompted for name, date, amount) 2. Create premium account (user will be prompted for name,date, amount) 3. Deposit to account (user will be prompted for account number, date, amount) 4. Withdraw from account (user will be prompted for account number, date, amount) Print info for all accounts Quit When the user chooses to create an account, an account of the appropriate type (regular or premium) should be dynamically created and assigned to the first available element of the accountArray array. The first available element is the element at lowest index which is available c) Input validation .Show an error message if the withdrawal amount is excessive (result in negative balance for a regular account or a balance less than MIN BALANCE for a premium account). No withdrawal should be made in that case .Show an error message if any deposit or withdrawal amount is not >0. No transaction should be made in that case. The main function does the checking and prints the error message. This checking is on top of the checking done in the deposit function. In the context of this HW the amount passed to the deposit function will always be>0. However, the deposit function should still implement the checking, as the Account class may be used in a different context. .Show an error message if the user tries to deposit to or withdraw from an account that has not been created Do not accept to create an account if the maximum number of accounts (MAX NUM_ ACCOUNTS) has been reached .Show an error message if the user attempts to create a regular account with an amount that is not> 0. The account is not created. The checking should be done in the main function . Show an error message if the user attempts to create a premium account with an amount less than MIN_BALANCE. The account is not created. The checking should be done in the main function. d) Output formatting All money amounts should be printed with two digits after the decimal point. e) Style Make sure you follow the style requirements, especially regarding the comment header for functions, to avoid losing points 7. Implementation Notes For simplicity, you may assume all the data typed is properly formatted (no need to do input validation). You may assume none of the data items (names, addresses, etc.) contain a whitespace. Therefore, you don’t need to use getline and should use only inFile .. That will avoid the getline compatibility issues between the Windows, Linux and MAC platforms In some functions, the date_ is only a place holder for the extra credit version and not used in the basic version. You may have a compiler warning that the variable is not used, but that should be expected To pass the unit test, your printTransactions function should be self contained. In particular, it should set the appropriate stream manipulators to print all doubles with two digits after the decimal point Extra Credit For the extra credit, the program should also print the history of transactions when the user chooses Print info for all accounts. .Account class The Account class should be modified as follows Add these members protected recordTransaction(Transaction t): Add t to the transactionHistory, returns void. Details on the function are provided below. public: printTransactions0: Accessor that prints the array of transactions, returns void. This function is called by the main function when the user chooses print info for all accounts These members are modified as follows Account(ownerName_, balance_ date_) is the constructor that initializes the account’s member variables ownerName and balance. balance_ is the amount deposited when the account is created. accountNumber is set to (numberAccounts+1000) and numberAccounts is incremented. transactionHistory is set to nullptr, numberTransactions set to zero. A Transaction structure is statically created and populated with this account creation. The recordTransaction function is called to record the account creation in the transaction history numberTransactions is incremented. We were unable to transcribe this image3. Record a Transaction in history To record a transaction, you should implement recordTransaction, a member function of Account, which takes as argument a Transaction to be recorded. The transaction history is implemented as an array of Transaction structures. Initially, the history is empty and no array is allocated. The first transaction is recorded in the history (account creation is the first transaction) by dynamically allocating an array of size 1, and populating with the transaction to be recorded. /* This function takes as argument a Transaction structure variable and adds it to the transaction history. The transaction history is implemented as an array of Transactions. A new array is dynamically allocated, of size equal to (size of old array) +1, to hold the added transaction. The values of the old azray aze copied into the new array. and the transaction to be added is copied into the last element of the new array. The old array is released through delete. The address returned from dynamic array allocation is assigned to transactionHistory void Account::recordTransaction (Transaction t) //Function body Grading criteria a) Source code inspection (grader) Style: 5 points (refer to the “Homework Notes for the style requirements) Use of base class pointers: dynamically create RegularAccounts and PremiumAccounts and assign to an element of accountArray: 20 points Screen output sample The below screen output is for output test-1 1->Create regular accnt, 2->Create premium accnt, 3->Deposit to accnt 4->Withdraw from accnt, 5->Print info accnts, 6->Quit Enter owner s name: R2-D2 Enter date, in the mm/dd/yyyy/hh format: 06/06/2200/01 Enter amount: 8001.1 Account created: Regular account, #: 1000, Name : R2-D2, Balance : 8001.10 Galactic unit 1->Create regular accnt, 2->Create premium accnt, 3->Deposit to accnt 4->Withdraw from accnt, 5->Print info accnts, 6->Quit Enter owner 3 name: Mr. Spock Enter date, in the mm/dd/yyyy/hh format: 06/05/2100/02 Enter amount: 5000.22 Account created: Premium account , 1001, Name : Mr . Spock, Balance : 5000.22 Galactic units 1->Create regular accnt, 2->Create premium accnt, 3->Deposit to accnt 4->Withdraw from accnt, 5->Print info accnts, 6->Quit Enter owner s name: Chewy Enter date, in the mm/dd/yyyy/hh format: 07/07/2200/03 Enter amount: 2000.11 Account created: Regular account, #: 1002, Name : Chewy, Balance: 2000.11 Galactic unit 1->Create regular accnt, 2->Create premium accnt, 3->Deposit to accnt 4->Withdraw from accnt, 5->Print info accnts, 6->Quit Enter owner’ s name: Solo Enter date, in the mm/dd/yyyy/hh format: 06/05/2100/04 Enter amount: 5000.5 Account created: Premium account , #: 1003, Name : Solo, Balance : 5000.50 Galactic unǐt3 1->Create regular accnt, 2->Create premium accnt, 3->Deposit to accnt 4->Withdraw from accnt, 5->Print info accnts, 6->Quit Enter account number: 1003 Enter date, in the mm/dd/yyyy/hh format: 06/05/2199/05 Enter amount: 400.1 Withdraw executed: Premium account , #: 1003, Name : Solo, Balance : 4600.40 Galactic unit 1->Create regular accnt, 2->Create premium accnt, 3->Deposit to accnt 4->Withdraw from accnt, 5->Print info accnts, 6->Quit Enter account number: 1003 Enter date, in the mm/dd/yyyy/hh format: 06/05/2200/06 Enter amount: 10000.56 Deposit executed: Premium account , 1003, Name : Solo, Balance : 14600.96 Galactic unit 1->Create regular accnt, 2->Create premium accnt, 3->Deposit to accnt 4->Withdraw from accnt, 5->Print info accnts, 6->Quit Enter account number: 1003 Enter date, in the mm/dd/yyyy/hh format: 06/15/2200/07 Enter amount: 555.7 Deposit executed: Premium account, 1003, Name : Solo, Balance : 15156.66 Galactic unit 1->Create regular accnt, 2->Create premium accnt, 3->Deposit to accnt 4->Withdraw from accnt, 5->Print info accnts, 6->Quit Enter account number: 1003 Enter date, in the mm/dd/yyyy/hh format: 06/16/2200/08 Enter amount: 2000.9 Deposit executed: Premium account , #: 1003, Name : Solo, Balance : 17157.56 Galactic unit 1->Create regular accnt, 2-Create premium accnt, 3->Deposit to accnt 4-Withdraw from accnt, 5->Print info accnts, 6-Quit Show transcribed image text 1. Date class mplement a Date class that has the following private member variables: month of type int day of type int year of type int hour of type int //hour is in military time, e.g. 23 for 11 PM In what follows, a date will be represented as mm/dd/yyyy/hh and the following member functions: public: set(month day_ year_, hour_) mutator that sets the variables month, day, year, and hour to the parameter values print0: Prints the date in the format “Month dd, yyyy, hh:00”. For example, “March 12,2103, 23:00. getMonth0: accessor that returns the month .getDay0: accessor that returns the day getYearO: accessor that returns the year .getHourO: accessor that returns the hour Do not write a constructor. 2. Transaction structure This structure is declared in Account.h struct Transaction Date date; int transactionType 1, 1, 2 for account creation, deposit and withdrawal respectively double amount;
. 3. Account class Account has the following member variables private accountNumber of type int ownerName of type string protected balance of type double .numberAccounts of type static int, initialized to zero transactionHistory of type Transaction*// This variable is declared but not used in the basic version numberTransactions of type int )// This variable is declared but not used in the basic version and the following member functions Account(ownerName, balance_, date_) is the constructor that initializes the account’s member variables ownerName and balance balance_ is the amount deposited when the account is created. accountNumber is set to (numberAccounts+1000) and numberAccounts is incremented. transactionHistory is set to nullptr, numberTransactions set to zero. The date_ is only a place holder for the extra credit version and not used in the basic version. withdraw(amount, date_) a virtual member function to withdraw a specified amount from the account. The function should first check if there is sufficient balance in the account. If the balance is sufficient, withdrawal is processed and the function returns true. Otherwise the withdrawal is not made and the function returns false. If the withdrawal is made, the withdrawal amount is deducted from balance. The date_ is only a place holder for the extra credit version and not used in the basic version deposit(amount, date_) function to deposit a specified amount of money to the account. The function should first check if the deposit amount is positive. If it is positive, deposit is processed and the function returns true. Otherwise the deposit is not made and the function returns false. If the deposit is made, the amount is added to balance. The date_ is only a place holder for the extra credit version and not used in the basic version. . getAccountNumber0: An accessor function that returns the account number. . getBalance0: An accessor function that returns the account balance getNumberAccounts0: A static member function that returns numberAccounts print0: a virtual member function that prints accountNumber, ownerName, balance. This function is called in a few instances in main,
print0: a virtual member function that prints accountNumber, ownerName, balance. This function is called in a few instances in main, including when the user chooses “print info for all accounts 4. RegularAccount class Implement a RegularAccount class that is derived from the Account class it has the following public members RegularAccount(ownerName balance_ date_) is the constructor which passes the arguments to the Account constructor print0: overrides the print0 of Account. This function prints the string “Regular account” then prints accountNumber, ownerName, balance To print the accountNumber, ownerName, balance, call the print function of Account with this statement: this->Account print0 5. PremiumAccount class Implement a PremiumAccount class that is derived from the Account class. In addition to the inherited members, it has the following private member variables: MIN BALANCE of type static double, initialized to 1000. The customer of a premium account is required to maintain a balance of at least MIN BALANCE galactic units and the following public member functions PremiumAccount(name, amount) is the constructor which passes the arguments to the Account constructor withdraw(amount, date): overrides the withdraw0 of Account. The function should first check if the existing balance is greater or equal to the withdrawal amount+ MIN BALANCE. If so, withdrawal is processed and the function returns true. Otherwise the withdrawal is not made and the function returns false. If the withdrawal is made, the withdrawal amount is deducted from balance. The date_ is only a place holder for the extra credit version and not used in the basic version. getMinBalance0:A static member function that returns MIN_BALANCE print0: overrides the print0 of Account. This function prints the string “Premium account” then prints accountNumber, ownerName, balance. To print the accountNumber, ownerName, balance, call the print function of Account with this statement: this->Account:print0
6. Additional Requirements a) What to turn in You should not have any in-line member function and submit the following files main.cpp Account.cpp PremiumAccount.cpp RegularAccount.cpp b) Outline of main const int MAX_NUM ACCOUNTS 5; Account accountArray [MAXNUM ACCOUNTS1: Lo p on dǐ3playing the f 11 wing menu f choice3 : 1. Create regular account (user will be prompted for name, date, amount) 2. Create premium account (user will be prompted for name,date, amount) 3. Deposit to account (user will be prompted for account number, date, amount) 4. Withdraw from account (user will be prompted for account number, date, amount) Print info for all accounts Quit When the user chooses to create an account, an account of the appropriate type (regular or premium) should be dynamically created and assigned to the first available element of the accountArray array. The first available element is the element at lowest index which is available
c) Input validation .Show an error message if the withdrawal amount is excessive (result in negative balance for a regular account or a balance less than MIN BALANCE for a premium account). No withdrawal should be made in that case .Show an error message if any deposit or withdrawal amount is not >0. No transaction should be made in that case. The main function does the checking and prints the error message. This checking is on top of the checking done in the deposit function. In the context of this HW the amount passed to the deposit function will always be>0. However, the deposit function should still implement the checking, as the Account class may be used in a different context. .Show an error message if the user tries to deposit to or withdraw from an account that has not been created Do not accept to create an account if the maximum number of accounts (MAX NUM_ ACCOUNTS) has been reached .Show an error message if the user attempts to create a regular account with an amount that is not> 0. The account is not created. The checking should be done in the main function . Show an error message if the user attempts to create a premium account with an amount less than MIN_BALANCE. The account is not created. The checking should be done in the main function. d) Output formatting All money amounts should be printed with two digits after the decimal point. e) Style Make sure you follow the style requirements, especially regarding the comment header for functions, to avoid losing points
7. Implementation Notes For simplicity, you may assume all the data typed is properly formatted (no need to do input validation). You may assume none of the data items (names, addresses, etc.) contain a whitespace. Therefore, you don’t need to use getline and should use only inFile .. That will avoid the getline compatibility issues between the Windows, Linux and MAC platforms In some functions, the date_ is only a place holder for the extra credit version and not used in the basic version. You may have a compiler warning that the variable is not used, but that should be expected To pass the unit test, your printTransactions function should be self contained. In particular, it should set the appropriate stream manipulators to print all doubles with two digits after the decimal point Extra Credit For the extra credit, the program should also print the history of transactions when the user chooses Print info for all accounts. .Account class The Account class should be modified as follows Add these members protected recordTransaction(Transaction t): Add t to the transactionHistory, returns void. Details on the function are provided below. public: printTransactions0: Accessor that prints the array of transactions, returns void. This function is called by the main function when the user chooses print info for all accounts These members are modified as follows Account(ownerName_, balance_ date_) is the constructor that initializes the account’s member variables ownerName and balance. balance_ is the amount deposited when the account is created. accountNumber is set to (numberAccounts+1000) and numberAccounts is incremented. transactionHistory is set to nullptr, numberTransactions set to zero. A Transaction structure is statically created and populated with this account creation. The recordTransaction function is called to record the account creation in the transaction history numberTransactions is incremented.

3. Record a Transaction in history To record a transaction, you should implement recordTransaction, a member function of Account, which takes as argument a Transaction to be recorded. The transaction history is implemented as an array of Transaction structures. Initially, the history is empty and no array is allocated. The first transaction is recorded in the history (account creation is the first transaction) by dynamically allocating an array of size 1, and populating with the transaction to be recorded. /* This function takes as argument a Transaction structure variable and adds it to the transaction history. The transaction history is implemented as an array of Transactions. A new array is dynamically allocated, of size equal to (size of old array) +1, to hold the added transaction. The values of the old azray aze copied into the new array. and the transaction to be added is copied into the last element of the new array. The old array is released through delete. The address returned from dynamic array allocation is assigned to transactionHistory void Account::recordTransaction (Transaction t) //Function body Grading criteria a) Source code inspection (grader) Style: 5 points (refer to the “Homework Notes for the style requirements) Use of base class pointers: dynamically create RegularAccounts and PremiumAccounts and assign to an element of accountArray: 20 points
Screen output sample The below screen output is for output test-1 1->Create regular accnt, 2->Create premium accnt, 3->Deposit to accnt 4->Withdraw from accnt, 5->Print info accnts, 6->Quit Enter owner s name: R2-D2 Enter date, in the mm/dd/yyyy/hh format: 06/06/2200/01 Enter amount: 8001.1 Account created: Regular account, #: 1000, Name : R2-D2, Balance : 8001.10 Galactic unit 1->Create regular accnt, 2->Create premium accnt, 3->Deposit to accnt 4->Withdraw from accnt, 5->Print info accnts, 6->Quit Enter owner 3 name: Mr. Spock Enter date, in the mm/dd/yyyy/hh format: 06/05/2100/02 Enter amount: 5000.22 Account created: Premium account , 1001, Name : Mr . Spock, Balance : 5000.22 Galactic units 1->Create regular accnt, 2->Create premium accnt, 3->Deposit to accnt 4->Withdraw from accnt, 5->Print info accnts, 6->Quit Enter owner s name: Chewy Enter date, in the mm/dd/yyyy/hh format: 07/07/2200/03 Enter amount: 2000.11 Account created: Regular account, #: 1002, Name : Chewy, Balance: 2000.11 Galactic unit 1->Create regular accnt, 2->Create premium accnt, 3->Deposit to accnt 4->Withdraw from accnt, 5->Print info accnts, 6->Quit Enter owner’ s name: Solo Enter date, in the mm/dd/yyyy/hh format: 06/05/2100/04 Enter amount: 5000.5
Account created: Premium account , #: 1003, Name : Solo, Balance : 5000.50 Galactic unǐt3 1->Create regular accnt, 2->Create premium accnt, 3->Deposit to accnt 4->Withdraw from accnt, 5->Print info accnts, 6->Quit Enter account number: 1003 Enter date, in the mm/dd/yyyy/hh format: 06/05/2199/05 Enter amount: 400.1 Withdraw executed: Premium account , #: 1003, Name : Solo, Balance : 4600.40 Galactic unit 1->Create regular accnt, 2->Create premium accnt, 3->Deposit to accnt 4->Withdraw from accnt, 5->Print info accnts, 6->Quit Enter account number: 1003 Enter date, in the mm/dd/yyyy/hh format: 06/05/2200/06 Enter amount: 10000.56 Deposit executed: Premium account , 1003, Name : Solo, Balance : 14600.96 Galactic unit 1->Create regular accnt, 2->Create premium accnt, 3->Deposit to accnt 4->Withdraw from accnt, 5->Print info accnts, 6->Quit Enter account number: 1003 Enter date, in the mm/dd/yyyy/hh format: 06/15/2200/07 Enter amount: 555.7 Deposit executed: Premium account, 1003, Name : Solo, Balance : 15156.66 Galactic unit 1->Create regular accnt, 2->Create premium accnt, 3->Deposit to accnt 4->Withdraw from accnt, 5->Print info accnts, 6->Quit Enter account number: 1003 Enter date, in the mm/dd/yyyy/hh format: 06/16/2200/08 Enter amount: 2000.9 Deposit executed: Premium account , #: 1003, Name : Solo, Balance : 17157.56 Galactic unit
1->Create regular accnt, 2-Create premium accnt, 3->Deposit to accnt 4-Withdraw from accnt, 5->Print info accnts, 6-Quit

Expert Answer


Answer to 1. Date class mplement a Date class that has the following private member variables: month of type int day of type int y… . . .

[Solved]1 Define Card Class Contains Three Private Variables Card Suit Face Value Third Indicate C Q37264380

1. Define a Card class which contains three PRIVATE (why?)variables for card suit, face value and the third to indicate ifthe card is drawn or not (these are states of a card object) plusoperations that can be performed on a card (these are behaviors),The operations include

      ONE method that compares twocards and returns a boolean indicating if one is bigger than theother.

      a constructor that takes threeparameters (suit and face value) to instantiate a card with thethird parameter indicating that the card has not been drawn at thetime of creation of the card.

      One overriding toStringmethod to be able to display the card (suit and face value)

      plus all necessary accessor andmutator methods for accessing private variables of a card

      You can add more methods if youneed to (such as equals method to check if two card are the same),but are not required besides those required methods above.

after the class is defined, save it in a file called card.java.Note that this class does not have the main method so youcannot run it on its own.

2. Write a client code which contains another class calledplayCards that uses the card objects created from the Card classdefined above and actually plays the game. This class contains themain method to execute the program.

3. Your program will start by displaying the greeting, playinginstrucctions and then a menu for user to choose, and it continuesdepending on what user chooses.   

4. When the program exits, it displays a message indicating itis the end of the program.

5. (Bonus) When a user exits the entire game, your program willdisplay number of games played and number of wins.

Expert Answer


Answer to 1. Define a Card class which contains three PRIVATE (why?) variables for card suit, face value and the third to indicate… . . .

[Solved]1 Define H X V2 Fill Two Array X Y X H X Values 41 Uniformly Spaced X Coordinates 4 Q37244715

Please answer using Python Pycharm programming.

1. Define h(x) = = V2 Fill two array X and Y with x and h(x) values for 41 uniformly spaced x coordinates in [-4,

1. Define h(x) = = V2 Fill two array X and Y with x and h(x) values for 41 uniformly spaced x coordinates in [-4, Show transcribed image text 1. Define h(x) = = V2 Fill two array X and Y with x and h(x) values for 41 uniformly spaced x coordinates in [-4,

Expert Answer


Answer to 1. Define h(x) = = V2 Fill two array X and Y with x and h(x) values for 41 uniformly spaced x coordinates in [-4,… . . .