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 program to input the temperature in celsius

Write a program to input the temperature in Celsius and convert it to Fahrenheit. Try your program with C = -40°, C = 20°, and C = 100°

  Report on a seminar or webinar

A report must be written regarding a seminar or webinar. Describe the key points of the seminar or webinar.

  Find the negation of each of statements

Use de Morgans law to find the negation of each of the subsequent statements - kwame will take a job in industry or go to graduate school.

  Write functions to change and display attributes

Write class player which contains attributes for players name,average and team. Write three functions to change and display these attributes.

  What type of hurricane you have

Prepare a VBA statements that employ a CASE statement to determine what type of hurricane you have based on a given wind speed stored in a variable WIND.

  Write recursive boolean method search array for value

Write down the recursive boolean method named isMember. Method must search the array for specified value, and retun true if value is found, or false if value is not foundin array.

  Write the constructor function makestk

Write the constructor function makestk, predicate function emptystk and mutator functions pushstk and popstk

  Write program to accept number from user-fibonacci series

Write a program that accepts a number 'n' from the user and generates Fibonacci series till n (Fibonacci series starts with 0 and 1.

  Application development and programming languages

Application Development and Programming Languages,  Programming languages have evolved since the First Generation Languages (1GLs) in the 1940s. The 1GLs were machine languages, which interacted directly with hardware. 2GLs were assembly languages. F..

  Write pseudocode-read in data file containing student name

Write a pseudocode to do the following Read in data file containing student names, ID number, and gender into an array.

  Distinguish class templates and program with heading

Clearly distinguish each class templates and their program with heading. Elaborate each step and give it without errors. Develop classes or class templates for the following.

  Electro-magnetic force in newtons

The topic of this assignment was chosen so that you won't allow mathematical equations and scientific notation to intimidate you. No knowledge is required to complete the assignment beyond knowing how to perform mathematical operations within a fo..

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