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

  Web programming

Work through the project instructions using the provided base files. Please note the detailed grading rubric included in the instruction document

  Write program which functions similarly to atm

Write program which functions similarly to the ATM. A user must be able to give their account number, choose whether they want to make a deposit or a withdrawal

  Question 1please define sexual harrassment in addition what

question 1please define sexual harrassment. in addition what was discussed in the discussion section of this class

  Write down a program which asks user to type of series of

write a program that asks user to type of series of positive integers. when the user types a negative value the program

  Find whether each shape is two dimensional shape

Find whether each shape is TwoDimensionalShape or a ThreeDimensionalShape. If it is a TwoDimensionalShape, display its area. If it is a ThreeDimensionalShape, display its area and volume.

  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.

  Use a switch statement to calculate a letter grade

Use a switch statement to calculate a letter grade based on a numeric average up to 100. Allow the numeric score to be entered in a text field. A Grade button will display the corresponding letter grade in a label.

  Generate an object-oriented design for a system

Generate an object-oriented design for a system that keeps tracks of your CD and DVD collection. Identify each of the classes, associated data, and operations for the classes.

  Design considerations to comply with ada

Browsing devices that assist people with disabilities, such as an aural browser, are especially dependent on the best use of CSS styles. What design considerations should you be aware to comply with ADA?

  Provide a complete program that performs substitution cipher

Provide a complete program that performs a simple substitution cipher. The program should take plain text and a shift value and produce the encrypted text. Then it should take encrypted text and a shift value and produce the plain text once again.

  Write the sentence in symbolic form

Identify the primitive statements in the sentence "Plate tectonics explains mountain building and continental drift." Assign variable names to the primitive statements, and then write the sentence in symbolic form. (There is more than one primitiv..

  Write down a program which reads an integer between 0 and

write a program that reads an integer between 0 and 10000 by selecting the integer at random then sum the digits. for

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