Question

In: Computer Science

I want answers of the following questions My lab assingment: its a program written in netbean...

I want answers of the following questions

My lab assingment:

its a program written in netbean ide 8.2

My topic: Bank Account

Program code:

class Account{
int acc_no;
String name;
float amount;
void insert(int a,String n,float amt){
acc_no=a;
name=n;
amount=amt;
}
void deposit(float amt){
amount=amount+amt;
System.out.println(amt+" deposited");
}
void withdraw(float amt){
if(amount<amt){
System.out.println("Insufficient Balance");
}else{
amount=amount-amt;
System.out.println(amt+" withdrawn");
}
}
void checkBalance(){System.out.println("Balance is: "+amount);}
void display(){System.out.println(acc_no+" "+name+" "+amount);}
}

class TestAccount{
public static void main(String[] args){
Account a1=new Account();
a1.insert(832345,"Ali",1000);
a1.display();
a1.checkBalance();
a1.deposit(40000);
a1.checkBalance();
a1.withdraw(15000);
a1.checkBalance();
}}


Task: Each one of you was given a Lab assignment of choosing a real world object to be represented as a programming object and writing a class code for that object. You have been asked to mimic at least 3 states and 3 behaviors of that object.

Your theory assignment is to provide the detail analysis on your part while you selected and mimic that object in programing language. You are to provide brief insight and analysis you have done in each the following:

1. What was your inspiration to choose that object?

2. Which 3 states you choose and why?

3. Do all the behaviors correspond directly to your states or not?

4. What were the challenges you faced with selecting the object?

5. If you were to asked to choose another object, which object will you choose and why?

Solutions

Expert Solution

1. What was your inspiration to choose that object?

The banking system is fully operated and maintained digitally. There is a program that acts as an interface to provide an easy, flexible, abstracted and highly secure way to maintain the banking system.  

2. Which 3 states you choose and why?

The states of the bank account are:

  • Account Number: Bank account has an account number associated with it.
  • Name: Bank account corresponds to the name of the person.
  • Amount: Bank account has an amount of money associated to it.

3. Do all the behaviors correspond directly to your states or not?

  • deposit: It is used to add money to the corresponding bank account.
  • withdraw: It is used to withdraw money the corresponding bank account.
  • checkBalance: It is used to check the amount balance in the corresponding bank account.

4. What were the challenges you faced with selecting the object?

Choosing a real life common object with appropriate states and behaviours.

5. If you were to asked to choose another object, which object will you choose and why?

A dog object with states as his name, his color and his breed, and behaviour like barking, eating and sleeping.


Related Solutions

This is one of the questions and answers to one of my scholarship questions, I want...
This is one of the questions and answers to one of my scholarship questions, I want help to review/edit/add to make it sound better please! 1. What is your most meaningful achievement, and how does it relate to your field of study and your future goals? The most meaningful achievement I have faced was beating cancer in March 2016 during my senior year of high school. This experience changed my view on many aspects of my life. Being in the...
Please I want answers for these questions. Thanks Note: I want them by typing not by...
Please I want answers for these questions. Thanks Note: I want them by typing not by hand writing Q2 Explain why a market structure in which money is used as a medium of exchange is more conducive to the expansion of trade and exchange than a barter system. What is money? Explain the three functions that money performs. What is the relationship between money and inflation? Explain
There is something wrong with my arduino lab. I want my four leds to light up...
There is something wrong with my arduino lab. I want my four leds to light up one after the other. Then the speaker plays music, and 4 leds change with music. But my code only makes one of them work. Please help me modify my code const int switchPin = 8; unsigned long previousTime = 0; int switchState = 0; int prevSwitchState = 0; int led = 2; // 600000 = 10 minutes in milliseconds long interval = 1000; int...
In python I have my code written and I want just 4 functions to be fix...
In python I have my code written and I want just 4 functions to be fix in my code according to rule. My code is running but it has some problem regarding to rules. (I have did all the other things so you do not have to worry about other functions) 1) all the players has to play until he/she reaches to at least 500 points in first round. When user reach 500 points for the first time, user may...
I want this program written in JAVA with the algorithm(The step by step process for the...
I want this program written in JAVA with the algorithm(The step by step process for the problem) . Please help it is due in a couple of hours. I don't want the C++ program, I want it in JAVA please #20 Theater Ticket Sales Create a TicketManager class and a program that uses it to sell tickets for a single performance theater production. Here are the specifications: • The theater's auditorium has 15 rows, with 30 seats in each row....
I want answers to the following questions regarding "Operations Strategy in a Global Environment": The word...
I want answers to the following questions regarding "Operations Strategy in a Global Environment": The word count is less than 100 words for each question. I just want basic concepts of the following questions. 1. How does a corporation expect to accomplish its missions as well as objectives? 2. What is the concept of an exceptional competitive advantage? 3. Explain some cases of social and moral problems faced by global operations managers? 4. How can the supply chain boost global...
I want answers to the following questions in detail regarding "Operations Strategy in a Global Environment":...
I want answers to the following questions in detail regarding "Operations Strategy in a Global Environment": 1. How does an efficient operations management strategy should have both a mission and a strategy to manage their actions? 2. What is a competitive advantage and what are the ways that a corporation may create one? 3. Many strategies for operations now require a global aspect. Global business is any corporation that engages in foreign trade or investment and these businesses can take...
I marked the correct answers to these questions, but I just want to know how to...
I marked the correct answers to these questions, but I just want to know how to solve them. 1) In a cross of AaBbCcDdEeFf X AaBbccDdEeFf, what proportion will have the ABCDeF phenotype? A. 27/64 B. 27/128 C. 27/512 D. 81/512 E. 81/2048 #### 2.) In a cross of two flies +/vg Cy/+ +/se +/ab X +/vg +/+ se/se ab/ab what proportion of the offspring will be mutant in phenotype for all four markers? A. 0 B. 3/64 C. 1/16...
Good morning, I cannot find the answers to these questions on my book and I would...
Good morning, I cannot find the answers to these questions on my book and I would like some help please. 1. Customer value is defined as the customer's evaluation of the perceived difference between all the benefits and all the costs of a marketing offer relative to those of competing offers. T/F 2. An aspect of managing service differentiation is in the company's service delivery. T/F 3. After carefully questioning your major suppliers and resellers, you ascertain they do not...
Please I need all answers about questions in TLC LAB. (Q1) In our lab, what is...
Please I need all answers about questions in TLC LAB. (Q1) In our lab, what is the mobile phase and what is stationary phase? Discuss the polarity of each. (Q2) Do your results suggest that the chemical characteristics of these pigments might differ according to their color? Explain. (Q3) Which of your pigment molecules was the most non-polar? Polar? (Q4) What is the relationship between Rf values and polarity for this experiment? Is this always true? (Q5) Why should you...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT