Question: Java Avoid poor programming practices in your assignments. Many web sites contain programs that are poorly written. The text contains many examples of programs that
Java
Avoid poor programming practices in your assignments. Many web sites contain programs that are poorly written. The text contains many examples of programs that use good programming practices. Use the text as a guide.
Here is a list of things for which I will deduct points. We will learn about these as the semester progresses.
You should have comments in your program to explain what your program is doing. They should be meaningful comments. I will deduct points if you dont have comments.
You should have only one exit point from your program and any methods. Do not have multiple return statements I may deduct points if you have multiple exit points.
Do not use the word "invalid" in any user message as it has multiple meanings. I will deduct points if you use invalid
You should use appropriate and meaningful variable names. I will deduct points if you use single letter variable names or names that dont reflect the usage of the variable.
Do not use break, continue, or intentional infinite loops while true in your program to alter the program flow. Fix your logic. I will deduct points if you do
You should use appropriate user prompts. They should be simple, accurate, have good grammar, and not have any misspellings. I may deduct points if you have confusing prompts.
You should properly label and format output or results. It should be obvious what your results mean. I will deduct points if your output or results are confusing or not formatted as they should be for example, currency should either have or decimal places
Each assignment starts with the words "using constructs from this chapter or earlier." You can only use concepts from the chapter the assignment is from, or previous chapters. I will deduct points if you use things we haven't covered or are not in the text.Using constructs from this chapter or earlier, complete an assignment combining Programming Challenge # Person and Customer Classes, and Programming Challenge # PreferredCustomer
Class, on page
For your PreferredCustomer class, have at least, an equals method that returns true if the customer numbers are the same, and have a toString method that returns a String that contains the
information saved in the object, nicely formatted.
For the demo program for your classes:
create an array of PreferredCustomer objects filling in the fields you have defined
remember PreferredCustomer is based on cumulative purchases
do a loop of at least customer purchases
ask for customer number
ask for purchase amount
display the purchase discount $$ saved, if any and the adjusted price if there's a discount
display what they need to spend to get to the next level. Display nothing if there is no next level
make any updates to fields as necessary
after the loop, display the information for the customers using a toString method for PreferredCustomer
Do not have any purchases for at least one customer.
For this combined assignment, there needs to be a separate file for each class definition and for the demo program.
I expect to see comments in your code.
When you are done, find the source files in the project directory and upload them to this assignment.
You also need to include at least one screenshot of the results. Your screenshot needs to display your name somewhere in the results.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
