Python
Write an interactive program for a board game called Parcheesi.
Objective
Develop an interface system using techniques and design patterns seen in class through a problem with realistic constraints.
Specs
put the program output
In: Computer Science
I am just trying to make confNum static so all my classes can use. Can me help with that please.
.h
#include <stdio.h>
#include <iomanip>
#include <stdlib.h>
#include <time.h>
#include "Customer.hpp"
#include "Employee.hpp"
class BankAccount: public Customer
{
protected:
long AccountNumber;
double Balance;
int confNum;
public:
BankAccount(const string&, const string&, const string&, const string&,long , double, int);//constructor
void setAccountNumber(long);
long getAccountNumber()const;
void setBalance(double);
double getBalance()const;
void setConfNum(int);
int getConfNum();
virtual void deposit(double);
virtual void withdrawl(double);
virtual void writeCheck(double);
virtual void print();
};
#endif /* Bank_Account_hpp */
.cpp
#include "Bank Account.hpp"
#include "Teller.hpp"
double Teller::registerCash;//Static member
BankAccount::BankAccount(const string& first, const string& last, const string& social,const string& IDN,long AccNum, double balance,int num): Customer(first,last,social,AccNum,IDN)
{
setAccountNumber(AccNum);
setBalance(balance);
setConfNum(num);
}
void BankAccount::setAccountNumber(long AccNum)
{
if(AccNum>1000000000 && AccNum<9999999999)
{
AccountNumber=AccNum;
}
}
long BankAccount::getAccountNumber()const
{
return AccountNumber;
}
void BankAccount::setBalance(double balance)
{
if(balance>0)
{
Balance = balance;
}
}
double BankAccount:: getBalance() const
{
return Balance;
}
void BankAccount:: setConfNum(int num)
{
num=(num+1);
confNum=num;
}
int BankAccount::getConfNum()
{
return confNum;
}
void BankAccount::deposit(double amount)
{
Teller::registerCash=amount+Teller::registerCash;
Balance=Balance+amount;
cout<<"The amount of $"<<amount<<" was deposited to the Account #"<<getAccountNumber()<<"."<<endl;
cout<<"The confirmation number: "<< getConfNum()<<"."<<endl<<endl;
}
void BankAccount:: withdrawl(double amount)
{
if(Balance>= amount)
{
Teller::registerCash=Teller::registerCash-amount;
Balance=Balance-amount;
cout<<"The amount of $"<<amount<<" was withdrawn from the Account # "<<getAccountNumber()<<"."<<endl;
cout<<"The confirmation number: "<< getConfNum()<<"."<<endl<<endl;
}
else
{
cout<<"There is not enough money to withdrawl";
}
}
void BankAccount::writeCheck(double amount)
{
if(amount<=Balance)
{
cout<<endl<< "A check was written from the account and the ammount of the check is $"<<amount<<"."<<endl;
withdrawl(amount);
}
else
{
cout<<"There is not enough money available for writing this check"<<endl;
}
}
void BankAccount:: print()
{
cout<<"Bank Account#: "<<getAccountNumber()<<" Balance: $"<< setprecision(2) << fixed << getBalance()<<"."<<endl<<endl;
}
In: Computer Science
Use python to solve
For f (x) = x ln(x), (1) use appropriate Lagrange interpolating polynomial of degree three to approximate f(8.4). Use the following data: f(8.1) = 16.94410, f(8.3) = 17.56492, f(8.6) = 18.50515, f(8.7) = 18.82091. (2) use appropriate Newton interpolation polynomial again to redo the work.
In: Computer Science
Justify
the
following statements
a) Performance
of
the pipelined
processor
increases
with
increase
in the
number of
stages
.
b) Forwarding
can
eliminate
all
possible
stalls
arises
out of
data dependencies
COA ( computer organization and architecture)
In: Computer Science
Instructions
Write a program that prompts the user to enter 50 integers and stores them in an array. The program then determines and outputs which numbers in the array are sum of two other array elements. If an array element is the sum of two other array elements, then for this array element, the program should output all such pairs separated by a ';'.
An example of the program is shown below:
list[0] = 15 is the sum of: ---------------------- list[1] = 25 is the sum of: list[5], list[14]; list[13], list[47]; list[46], list[47]; ---------------------- list[2] = 23 is the sum of: list[0], list[33]; ---------------------- list[3] = 65 is the sum of: list[4], list[32]; list[13], list[20]; list[20], list[46]; list[21], list[34]; list[32], list[38]; ---------------------- list[4] = 34 is the sum of: list[0], list[14]; list[6], list[48]; ---------------------- list[5] = 6 is the sum of: ...
If no two elements can equal the value of an element, the line can remain empty, as shown above for list[0] and list[5].
C++
In: Computer Science
One approach to addressing this problem is to install a more secure data access control problem. The cost of access control software is is $50,000 with 80% effectiveness. Here is the summary of risk and control:
Determine the expected annual costs due to loss and controls. Also, determine whether the costs outweigh the benefits of preventing or mitigating the risks. (5 points)
In: Computer Science
In: Computer Science
Write and Compile a python script to solve the 4-queens problem using. The code should allow for random starting, and for placed starting using numpy
"The 4-Queens Problem[1] consists in placing four queens on a 4 x 4 chessboard so that no two queens can capture each other. That is, no two queens are allowed to be placed on the same row, the same column or the same diagonal."
Display the iterations until the final solution
Arc consistency
In: Computer Science
Design an IP Addressing Scheme; please provide explanation with the answers
Subnet the 192.168.1.0 network into the appropriate number of subnets.
|
Subnet Number |
Subnet Address |
1st Usable Host Address |
Last Usable Host Address |
Broadcast Address |
In: Computer Science
How to fit an example of non-stationary data into GARCH model in R programming.
In: Computer Science
Description of the Assignment: Write a Python program to create a deque and append few elements to the left and right, then remove some elements from the left, right sides and reverse the deque.
Please use the following comments in your python script:
# *************************************************
# COP3375
# Student's full name ( <<< your name goes here)
# Week 9: Assignment 1
# *************************************************
# Write your code below:
# Create a deque
# Print a deque
# Append to the left
# Print a deque
# Append to the right
# Print a deque
# Remove from the right
# Print a deque
# Remove from the left
# Print a deque
# Reverse the dequeue
# Print a deque
Sample Output - Your output should look like something similar to the following:
deque(['Red', 'Green', 'White'])
Adding to the left:
deque(['Pink', 'Red', 'Green', 'White'])
Adding to the right:
deque(['Pink', 'Red', 'Green', 'White', 'Orange'])
Removing from the right:
deque(['Pink', 'Red', 'Green', 'White'])
Removing from the left:
deque(['Red', 'Green', 'White'])
Reversing the deque:
deque(['White', 'Green', 'Red'])
In: Computer Science
In: Computer Science
algorithms coures
In: Computer Science
Week 1 - Map and Critique a Control Flow.
Initial Post
Describe and map a sample of a control flow.
Group Discussion Critique the control flow of two other submissions.
This should include why it is either an effective or ineffective control flow.
If effective, describe why. Examples would be its thoroughness of structures, substantial interactions and flows, etc.
If ineffective, describe why. Examples would be missing steps, flow is incorrectly lined, etc.
In: Computer Science
Java
Algorithmic Performance as you are aware, consists (mainly) of 2 dimensions: Time and Space. From a technical perspective, discuss the following:
In: Computer Science