Statement mistakes?

Tell us what’s happening:

The assignment statement should consider a few things to prevent us from assuming. I will quote a thing I think you can not assume:

When the budget object is printed it should display:

  • A title line of 30 characters where the name of the category is centered in a >line of * characters.

… What about category names with odd length?

  • A list of the items in the ledger. Each line should show the description and amount. The first 23 characters of the description should be displayed, then the amount. The amount should be right aligned, contain two decimal places, and display a maximum of 7 characters.

… What about an amount with more than 7 characters like 12345.67?

Challenge: Budget App

Link to the challenge:

1 Like

Welcome to the forums.

For a real program, these are valid points, but for this project you just have to worry about the tests. The header test uses a title with an even number of characters and avoids this problem. Likewise the money amounts all stay under the upper limit of $10k. I can see how it would be helpful to include these details in the project instructions to avoid any confusion.

In reality, both of these points are important issues to consider if you are writing a text based program that relies on specific sizes of fields.

Good luck with the project.


Thank you! For any doubt, I will look at the tests!