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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 11:30, jcazares3558
Awell-diversified portfolio needs about 20-25 stocks from different categories.
Answers: 2
image
Computers and Technology, 22.06.2019 15:00, nika0001
When designing content as part of your content marketing strategy, what does the "think" stage represent in the "see, think, do, care" framework?
Answers: 3
image
Computers and Technology, 22.06.2019 21:00, jarrettashlyn
Write a method so that the main() code below can be replaced by the simpler code that calls method original main(): public class calcmiles { public static void main(string [] args) { double milesperhour; double minutestraveled; double hourstraveled; double milestraveled; milesprhour = scnr. nextdouble(); minutestraveled = scnr. nextdouble(); hourstraveled = minutestraveled / 60.0; milestraveled = hourstraveled * milesperhour; system. out. println("miles: " + milestraveled); } }
Answers: 2
image
Computers and Technology, 23.06.2019 00:20, kathlynskare06
Ihave been given the number of guns per 100, and the total firearm-related deaths per 100,000. i have to find the actual number of guns per country and actual number of gun-related deaths. if somebody could show me how to do 1 question, i can finish the rest, i am just confused. tia
Answers: 3
You know the right answer?
Complete the giftcard class shown below. a giftcard keeps track of the current balance on the card....

Questions in other subjects:

Konu
Mathematics, 11.09.2020 19:01
Konu
Spanish, 11.09.2020 19:01
Konu
Mathematics, 11.09.2020 19:01
Konu
Mathematics, 11.09.2020 19:01
Konu
Mathematics, 11.09.2020 19:01
Konu
Social Studies, 11.09.2020 19:01
Konu
Mathematics, 11.09.2020 19:01
Konu
Mathematics, 11.09.2020 19:01
Konu
Mathematics, 11.09.2020 19:01
Konu
Mathematics, 11.09.2020 19:01