During the summer months, Midway, KY, hosts Midsummer Nights in Midway. The event offers live music,...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
During the summer months, Midway, KY, hosts Midsummer Nights in Midway. The event offers live music, shopping late at local shops, face painting, kids activities, and food vendors. One vendor sells. kettle popcorn ($4.50 a bag) and soft drinks ($1.00 each) on a cash-only basis. Develop a Java application that will print (display) receipts for popcorn vendor (to give to customers). Since this is a monetary application and we want to be accurate with our calculations, use integers for all monetary values (representing the values in terms of pennies) until the final answer is calculated at which time you can divide by 100 to get the correct floating-point value. For example, $4.50 would be 450 pennies. Input: Using the Scanner class, the application should input the following: • date of purchase o In format mmddyyyy - for example: 09172016) * * o Make sure you do not input month, day and year separately ⚫ buyer's first name • ⚫ buyer's last name • the number of bags of popcorn purchased ⚫ the number of soft drinks purchased • a street vendor's ID (any 5 characters) * Create any constants you may need for this program. * Items that contain all digits are not necessarily numeric values. You should declare a data item (variable or constant) as an integer or floating-point value ONLY IF it is reasonable to use that data item in a mathematical calculation. For example, zipcodes are all numeric in the U.S. but we never use them in calculations. We do not total zipcodes, we do not calculate averages of zipcodes, etc. A zipcode should be declared as a String. The same would be true for social security numbers, dates, phone numbers, credit card numbers, student IDs, vendor IDs, etc. HINT: If you attempt to read a String (nextLine() method) after reading a number (nextByte(), nextInt(), nextFloat(), or nextDouble() methods), you will first need to: • Write a nextLine() method to clear the input buffer (this reads the enter from the previously read number • Write another nextLine() to read the actual String you want Processing Generate a 4-digit random number in the range 1000-4999. Make sure 1000 and 4999 are included in the range of numbers that could be generated. Using String methods and concatenation, build a confirmation "number" for the buyer and store it in a String variable. It should include: •the string POPCORN followed by the character #, followed by the buyer's last name, followed by the character #, followed by the first initial of the buyer's first name (use the substring() method), followed • • During the summer months, Midway, KY, hosts Midsummer Nights in Midway. The event offers live music, shopping late at local shops, face painting, kids activities, and food vendors. One vendor sells. kettle popcorn ($4.50 a bag) and soft drinks ($1.00 each) on a cash-only basis. Develop a Java application that will print (display) receipts for popcorn vendor (to give to customers). Since this is a monetary application and we want to be accurate with our calculations, use integers for all monetary values (representing the values in terms of pennies) until the final answer is calculated at which time you can divide by 100 to get the correct floating-point value. For example, $4.50 would be 450 pennies. Input: Using the Scanner class, the application should input the following: • date of purchase o In format mmddyyyy - for example: 09172016) * * o Make sure you do not input month, day and year separately ⚫ buyer's first name • ⚫ buyer's last name • the number of bags of popcorn purchased ⚫ the number of soft drinks purchased • a street vendor's ID (any 5 characters) * Create any constants you may need for this program. * Items that contain all digits are not necessarily numeric values. You should declare a data item (variable or constant) as an integer or floating-point value ONLY IF it is reasonable to use that data item in a mathematical calculation. For example, zipcodes are all numeric in the U.S. but we never use them in calculations. We do not total zipcodes, we do not calculate averages of zipcodes, etc. A zipcode should be declared as a String. The same would be true for social security numbers, dates, phone numbers, credit card numbers, student IDs, vendor IDs, etc. HINT: If you attempt to read a String (nextLine() method) after reading a number (nextByte(), nextInt(), nextFloat(), or nextDouble() methods), you will first need to: • Write a nextLine() method to clear the input buffer (this reads the enter from the previously read number • Write another nextLine() to read the actual String you want Processing Generate a 4-digit random number in the range 1000-4999. Make sure 1000 and 4999 are included in the range of numbers that could be generated. Using String methods and concatenation, build a confirmation "number" for the buyer and store it in a String variable. It should include: •the string POPCORN followed by the character #, followed by the buyer's last name, followed by the character #, followed by the first initial of the buyer's first name (use the substring() method), followed • •
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
The Crazy Eddie fraud may appear smaller and gentler than the massive billion-dollar frauds exposed in recent times, such as Bernie Madoffs Ponzi scheme, frauds in the subprime mortgage market, the...
-
Harvold Company's quality cost report is to be based on the following data: Test and inspection of incoming materials. $71,000 Supplies used in testing and inspection . Re-entering data because of...
-
You are trying to push your stalled car. Although you apply a horizontal force of 400 N to the car, it doesn't budge, and neither do you. Which force(s) must also have a magnitude of 400 N? (a) The...
-
Consider the hypothetical reaction between A 2 and AB pictured below. What is the balanced equation? If 2.50 moles of A 2 are reacted with excess AB, what amount (moles) of product will form? If the...
-
Copy your worksheet from Question 6 into another worksheet. Change the increase from 10% to 18%. Protect the worksheet, so that changes cannot be made. Question 6 Open a new spreadsheet. Type...
-
At December 31, 2014, Navaro Corporation reported the following plant assets. During 2015, the following selected cash transactions occurred. Apr. 1 Purchased land for $2,200,000. May 1 Sold...
-
A. Calculate the work, w , (in J) when 8.9 litre of an ideal gas at an initial pressure of 83.1 atm is expanded to a final pressure of 0.66 atm against a constant exteral pressure of 0.66 atm. Assume...
-
Match the marketing data to the marketing mix component (product, price, place, or promotion) that it would be most helpful for analyzing. Marketing Data Competitor price Order fulfillment time...
-
Use the following financial statements for Lake of Egypt Marina, Inc., Assets Current assets: Cash and marketable securities Accounts receivable Inventory Total Fixed assets: Gross plant and...
-
Discuss the hierarchy of evidence, specifically as it relates to your literature review. What level of evidence are you finding most abundant? What level of evidence is most difficult to find? Why do...
-
Discuss your knowledge or experiences working with technology. Discussed the impact you think technology has had and/or will have on organizational processes, leadership, operational efficiencies,...
-
discuss a post that explores and explains the marketing mix elements of the airport Miami international airport identify at least one example related to your chosen airport in each of the four...
-
1. We have two different code sequences. The table bellow shows the instruction counts for each instruction class. The CPI's for each instruction class are 4, 3, 2, and 1, respectively. a. What is...
-
Discuss the benefits of studying competitors' promotion plan before developing a promotion plan for any given small service provider in BC and explain your perspectives of value added to the customer...
-
Q2. JLT Corporation requires a funding of $300 million. The firm is contemplating to use Common Stock, Prefered Stock, Coupon Paying bonds, Zero Coupon Bonds in combination or any one of the sources...
-
Use the information given about the angles and to find the exact value of: (a) sin( + ) (b) cos( + ) (c) sin( - ) (d) tan ( + ) (e) sin(2) (f) cos (2) (g) sin /2 (h) cos/2 cos = 4/5, 0 < < /2; cos =...
-
During the war in Afghanistan, the Terraco Motor Company produced a lightweight, all-terrain vehicle code-named "J99 Terra" for the military. The company is now planning to sell the Terra to the...
-
Place-Plus, a real estate development firm, is considering several alternative development projects. These include building and leasing an office park, purchasing a parcel of land and building an...
-
The copy center at the college of business at State University has become an increasingly contentious item among the college administrators. The department heads have complained to the associate dean...
-
Given the following information, answer the questions about this project: a. Draw the network as a Gantt chart. b. What is the critical path? Which activities have slack time? c. What would happen if...
-
Develop a Gantt chart with the following information. What is the expected duration of the project? What is the critical path? Activity Expected Duration Predecessors A BL 12 8 None None C 5 None D...
-
Consider a project with the following information. Construct the project activity network using AOA methodology and label each node and arrow appropriately. Identify all dummy activities required to...
Study smarter with the SolutionInn App