Demonstrate an understanding of static variables and methods

Assignment Help Programming Languages
Reference no: EM13802224

Goal: The purpose of this lab is to demonstrate an understanding of static variables and methods.

Problem: You are working for Plastercard, Inc., a company that specializes in credit cards for handymen.

The company plans to launch a new credit card and needs your help in designing an object-oriented application to run usage of the credit card.

Based on some requirements analysis, you create the following detailed UML diagram for a CreditCard class:

(+) DEFAULT_CREDIT_LIMIT: double The default credit limit across all credit cards ($1000.00)

(-) numOpenAccounts: int The number of open credit card accounts

(-) lastAccountNumber: int Starting at 200, the last account number assigned

(-) accountNumber: int The account number of the credit card

(-) numCyclePurchases: int The number of purchases made in a billing cycle of the credit card

(-) balance: double The balance of the credit card

(-) creditLimit: double The credit limit of the credit card

(-) open: boolean The status of the credit card (open or closed)

(+) CreditCard() Constructs a default CreditCard object with an account number, number of purchases made in a billing cycle, balance,credit limit, and open status

(+) CreditCard(creditLimit : double) Constructs a CreditCard object with a specified credit limit

(+) getAccountNumber(): int Returns the account number of this credit card

(+) getNumCyclePurchases(): int Returns the number of purchases made in a billing cycle of this credit card

(+) getBalance(): String Returns the balance of this credit card

(+) getCreditLimit() : double Returns the credit limit of this credit card

(+) isOpen(): boolean Returns the status of this credit card (open or closed)

(+) getNumOpenAccounts(): int Returns the number of open credit card accounts

(+) charge(amount : double): boolean Returns if a credit card charge was successful if the account was open, a valid amount was provided, and the balancewould not exceed the credit limit. The amount is added to the balance and the number of purchases made in the billing cycle is incremented

(+) payBill(amount : double): boolean Returns if the credit card bill was successfully paid if theaccount was open and the amount to pay equaled the amount of the balance. The balance and number of purchases made inthe billing cycle is reset to 0

(+) close(): boolean Returns if the credit card was successfully closed only If thecredit card was open

(+) toString(): String Returns a string representation of this Credit Card

First, create a data definition class based solely on the above detailed UML diagram. Then, create animplementation class that tests each of the methods of the data definition class. No user input is required in the implementation class. Rather, data can be hardcoded. Attempt to replicate a running of the application as shown in the screenshots below. You can start with the following skeleton which may help you:

import javax.swing.JOptionPane;

public class Lab3_CreditCardImplementation {

public static void main(String[] args) {

Lab3_CreditCard creditCard1 = new Lab3_CreditCard();

Lab3_CreditCard creditCard2 = new Lab3_CreditCard(2000.00);

}

}

Reference no: EM13802224

Questions Cloud

Starbucks decision form a capital budgeting outline : Recently, Starbucks acquired Teavana for $620 million for the company which represented at 50% premium from Teavana’s then valuation. Discuss the recent acquisition, the probable growth of the tea industry and Starbucks’ decision form a capital budge..
Interest rate statements as either nominal or effective : Identify the following interest rate statements as either nominal or effective: (a) 1% per month compounded weekly; (b) 0.5% per week compounded weekly; (c) effective 15% per year com- pounded monthly;
Block booking-full line forcing anticompetitive : Why would the Department of Justice consider activities like blind booking, block booking, and full line forcing anticompetitive?
Would your portfolio be riskless-explain : Suppose you own a portfolio consisting of $250,000 of long-term U.S. government bonds. What is the least risky security you can think of? Explain. Would your portfolio be riskless? Explain.
Demonstrate an understanding of static variables and methods : Goal: The purpose of this lab is to demonstrate an understanding of static variables and methods. Problem: You are working for Plastercard, Inc., a company that specializes in credit cards for handymen
Firm produce to maximize profits or minimize losses : Suppose the cost function for your firm is: C = 10 +2Q + 5Q2. If the firm sells output in a perfectly competitive market and other firms in the industry sell output at a price of $35, What level of output should the firm produce to maximize profits o..
Write a persuasive essay about national current event : Write a persuasive essay of approximately 700 to 1,050-words on a local, regional, or national current event or political issue that has affected you, your family, or your community recently.
Impact interest rates-consumption and investment : Explain the 4 ways the Federal Reserve would increase the money Supply and explain and graph how this would impact interest rates, consumption, and investment, AD, GDP, Prices and Unemployment. (Make sure to include both the money and the goods graph..
Assignment on hypothesis identification article analysis : Individual Assignment: Hypothesis Identification Article Analysis

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd