View the step-by-step solution to:

Test class needed to test the JustSold() method as well.

Please help me define a class level "standID" type of variable to hold the stand's ID. Also please help me correct my typo in my constructor. Test class needed to test the JustSold() method as well.


Thank you



import java.util.Scanner;


public class BudgetPlan {

public static void main(String[] args) {


Scanner in = new Scanner(System.in);

System.out.print("Enter the current price: ");

double cost = in.nextDouble();

System.out.print("Enter the inflation rate in percentage: ");

double rate = in.nextDouble();

 // convert the percentage rate into units

rate = rate / 100;

System.out.print("Enter the number of years the item will be purchased: ");

int years = in.nextInt();

 // for each year, increment the price after calculating it

for(int i=0; i<years; i++) {

cost += cost * rate;

}

System.out.printf("nThe cost of the item after %d years will be %.2fn", years, cost);

 in.close();


              }


}

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question