Question: Write a program that asks the user to enter the weekly sales goal for his/her coffee shop. Your program should then prompt the user to

Write a program that asks the user to enter the weekly sales goal for his/her coffee shop. Your program should then prompt the user to enter the name of an input file where his or her weekly sales numbers are stored. Once the user enters a valid input file name, a loop should be used to sum the sales numbers in the file by keeping a running total (using an accumulator variable). When the loop finishes, the program should display the sales goal, the weekly sales and a message that states if the sales goal was accomplished or not.

Write a program that asks the user to enter the weekly salesgoal for his/her coffee shop. Your program should then prompt the user

Lab 8: Coffee-Shop Sales-Goal Calculator Write a program that asks the user to enter the weekly sales goal for his/her coffee shop. Your program should then prompt the user to enter the name of an input file where his or her weekly sales numbers are stored. Once the user enters a valid input file name, a loop should be used to sum the sales numbers in the file by keeping a running total (using an accumulator variable). When the loop finishes, the program should display the sales goal, the weekly sales and a message that states if the sales goal was accomplished or not. If the user enters an invalid input file name, then your program should display the message, Invalid input file name. Please try again., and then terminate Download and use the following input files from CourseWeb: weeklSalesData.txt week2SalesData.txt *Hint: See the code examples for Lecture 13 on CourseWeb, especially FileSum.java and FileSum2.java* Here are a few example runs (user input is given in>: 1. Welcome tthe Weekly Sales Goal Program! Enter the input file name: Enter your sales goal (in dollars) Your t tal sales for this week is: $977.75 You reached your goal! Goodbye! 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!