Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I've been seeing answers using the try and catch method for this problem but I've already started working without that method. I would like an
I've been seeing answers using the try and catch method for this problem but I've already started working without that method. I would like an answer not using the try and catch method to see what I'm doing wrong. Thank you.
Problem 1: SalespersonOfTheMonth (file operations, nested loops, 2 d arrays, formatting output) Problem: Four salespeople (numbered 1 to 4 ) sell six different products (numbered 1 to 6 ). Each salesperson passes in a slip for each sale which contains the following information: - the salesperson I.D. number (1,2,3, or 4) - the product number (1,2,3,4,5, or 6) - the total dollar value of that product sold that day. The information from the slips for the last month is available in the file salesSlips.txt . Write a program that will read it and summarize the total sales by salesperson and by product. All totals should be stored in a two-dimensional array, called sales. Cross total each row and column to get the total sales of each product and by each salesperson. Print the results in a tabular format (see example below). Required: - SalespersonOfTheMonth class: when its main method is run produces results below - Include a 2-dimensional array - Include at least one double nested loop - Include printf statement(s) to format your tableStep 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