subject

Complete the giftcard class shown below. a giftcard keeps track of the current balance on the card. a gift card starts with a beginning balance. a giftcard can be used to make a purchase, funds can be added to a giftcard, and the balance can be checked at any time. the balance can never be negative. if the amount added to the card is $100 or more, a bonus of $10 is also added.

public class giftcard
{
// declare instance variables

// precondition: the starting balance is not negative
// postcondition: all instance variables are initialized
public giftcard(double startbal)
{

}

// postcondition: amount is subtracted from balance
// if there are insufficient funds, the balance is set to zero and a message
// is displayed to indicate how much of the transaction is still owed
public void spendfunds(double amount)
{

}
// postcondition: amount is added to balance, if the amount is at least 100 dollars,
// 10 dollars is added
public void addfunds(double amount)
{

}

// postcondition: the current balance is returned
public double checkbalance()
{

}
}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:50
The file sales data.xlsx contains monthly sales amounts for 40 sales regions. write a sub that uses a for loop to color the interior of every other row (rows 3, 5, etc.) gray. color only the data area, columns a to m. (check the file colors in excel.xlsm to find a nice color of gray.)
Answers: 2
question
Computers and Technology, 22.06.2019 17:30
Ou listened to a song on your computer. did you use hardware or software?
Answers: 2
question
Computers and Technology, 23.06.2019 02:30
Which component acts as a platform on which application software runs
Answers: 2
question
Computers and Technology, 24.06.2019 02:30
Assume a class window with accessor method getwidth that accepts no parameters and returns an integer. assume further an array of 3 window elements named winarr, has been declared and initialized. write a sequence of statements that prints out the width of the widest window in the array.
Answers: 2
You know the right answer?
Complete the giftcard class shown below. a giftcard keeps track of the current balance on the card....
Questions
question
Mathematics, 19.10.2021 14:00
question
Mathematics, 19.10.2021 14:00
question
Mathematics, 19.10.2021 14:00