Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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.
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:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started