You have been commissioned to write part of an application that reads values from a text...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
You have been commissioned to write part of an application that reads values from a text file, and then writes a customer report to another text file. Step 1: Create a Netbeans project called Assignment1HProject. Step 2: Write the Java code for a class (or classes) to perform the following tasks: a) Read the contents of the given text file, Stakeholder.txt The file contains records of suppliers and customers. This program must produce a report for the customer records ONLY. The first field of the records contains an alphanumeric code. A code with the letter C as the first character means it is a customer record. o A code with the letter S as the first character means it is a supplier record. The contents of the text file is shown below: Stakeholder Notepad Eile Edit Format View Help C150, Luke, Atmyass, Bellville $270, Grand Theft Auto, Toyota, Nyanga C130, Stu, Padassol, Sea Point C290, Lerato, Mbedi, Nyanga S400, Prime Motors, Lexus, Langa C280, Bongi, Khoza, Nyanga S300, We got Cars, Toyota, Langa C100, Mike, Rohsopht, Bellville C300, Ivana.B, Withew, Langa $350, Auto Delight, BMW, Bellville C310, Oupa, Smith, Nyanga $290, MotorMania, Hyundai, Bellville C250, Eileen, Sideways, Nyanga C260, Ima, Stewpidas, Bellville C350, Penelope, Lusedi, Nyanga b) You must use 2 Hashmaps in your solution. The first hashmap must be populated with the customer codes and locations that were read from the file. The second one must be used for counting the number of customers living in the different locations. c) Determine the total number of customers d) Write a report to another text file, CustomerReport.txt You must reference the hashmaps to provide all the output data written to the file. All the data in section A of the output file must come from the one hashmap, and the data in section B of the output file must come from the other hashmap. A sample of the required report is shown below: 3211-11-12 13 14 15 16 7 8 9 10 11 12 13 14 15 16 17 18 SECTION A Customer Code Location C310 C100 C130 C350 C250 C150 Nyangal Bellville Sea Point Nyanga Nyanga. Bellville C260 Bellville C280 Nyanga C290 Nyanga C300 Langa SECTION B Total customers: Customers living in Customers living in Customers living in Customers living in 10 Langa Sea Point Bellville Nyanga : 1 : 3 : 5 100% Additional instructions: Make use of good programming practices: You MUST have at least 3 methods in your solution, as we discussed during our lectures. You will be penalized by 50% if your solution only consists of a main method. If the data in the output file was referenced directly from the input file, or the totals were calculated without using a hashmap then you will receive a mark of zero. You have been commissioned to write part of an application that reads values from a text file, and then writes a customer report to another text file. Step 1: Create a Netbeans project called Assignment1HProject. Step 2: Write the Java code for a class (or classes) to perform the following tasks: a) Read the contents of the given text file, Stakeholder.txt The file contains records of suppliers and customers. This program must produce a report for the customer records ONLY. The first field of the records contains an alphanumeric code. A code with the letter C as the first character means it is a customer record. o A code with the letter S as the first character means it is a supplier record. The contents of the text file is shown below: Stakeholder Notepad Eile Edit Format View Help C150, Luke, Atmyass, Bellville $270, Grand Theft Auto, Toyota, Nyanga C130, Stu, Padassol, Sea Point C290, Lerato, Mbedi, Nyanga S400, Prime Motors, Lexus, Langa C280, Bongi, Khoza, Nyanga S300, We got Cars, Toyota, Langa C100, Mike, Rohsopht, Bellville C300, Ivana.B, Withew, Langa $350, Auto Delight, BMW, Bellville C310, Oupa, Smith, Nyanga $290, MotorMania, Hyundai, Bellville C250, Eileen, Sideways, Nyanga C260, Ima, Stewpidas, Bellville C350, Penelope, Lusedi, Nyanga b) You must use 2 Hashmaps in your solution. The first hashmap must be populated with the customer codes and locations that were read from the file. The second one must be used for counting the number of customers living in the different locations. c) Determine the total number of customers d) Write a report to another text file, CustomerReport.txt You must reference the hashmaps to provide all the output data written to the file. All the data in section A of the output file must come from the one hashmap, and the data in section B of the output file must come from the other hashmap. A sample of the required report is shown below: 3211-11-12 13 14 15 16 7 8 9 10 11 12 13 14 15 16 17 18 SECTION A Customer Code Location C310 C100 C130 C350 C250 C150 Nyangal Bellville Sea Point Nyanga Nyanga. Bellville C260 Bellville C280 Nyanga C290 Nyanga C300 Langa SECTION B Total customers: Customers living in Customers living in Customers living in Customers living in 10 Langa Sea Point Bellville Nyanga : 1 : 3 : 5 100% Additional instructions: Make use of good programming practices: You MUST have at least 3 methods in your solution, as we discussed during our lectures. You will be penalized by 50% if your solution only consists of a main method. If the data in the output file was referenced directly from the input file, or the totals were calculated without using a hashmap then you will receive a mark of zero.
Expert Answer:
Answer rating: 100% (QA)
In the statement mentioned a program is to be written in Python language which contains library classThe general purpose interactive object oriented and a high level programming language is mostly use... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Write an alternative definition that is tail-recursive (iterative) and makes use of accumulator variables. [10 marks] Explain why your alternative definition executes more efficiently. [3 marks] 1...
-
You have been provided with the description of a programming language, J, intended for scripting applications. Its syntax is similar to a cut-down version of Java in that it consists of function...
-
A) Draw the output waveforms and then find the repeated sequence of the following ripple counter [6 mark CLK 1 1 K A A' B J 11 1 B K J K C
-
Roadrunner, Inc., is an exempt medical organization. Quail, Inc., a sporting goods retailer, is a wholly owned subsidiary of Roadrunner. Roadrunner inherited the Quail stock last year from a major...
-
Discuss the various ways to pay online in B2C. Which method(s) would you prefer and why?
-
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...
-
Jupiter Company sells goods on January 1 that have a cost of $500,000 to Danone Inc. for $700,000, with payment due in 1 year. The cash price for these goods is $610,000, with payment due in 30 days....
-
There are essentially two aspects of data management: data definition and data manipulation. Data definition is operationalized by way of data definition languages (DDL). Data manipulation undergoes...
-
2.64 In computing the equivalent present worth of each given cash flow series at period zero, which of the following expressions is incorrect? (a) P= $500(P/A, i, 4)(P/F, i, 4). (b) P = $500(F/A, i,...
-
1. An object is standing in front of a concave mirror with a focal length of 10.0 m. If its image is real and is 13.0 m from the mirror, how far away is the object? 2. What is the focal length of a...
-
A plane is landing and reported having a decibel reading of 67 d. 1. What is the intensity of the plane? 2. If the power of the noise at a distance of 9500 m above ground? 3. How much more intense is...
-
Matt is client relationship manager at a local bank is trying to make an interest rate offer to his corporate client who has applied for a long-term loan. Client is looking for a 5 year loan. Matt...
-
What is the importance of the IPS? What information is explained about the investor? Would you expect institutional investors, such as insurance companies and pension funds, to develop and follow an...
-
An electron, starting from rest, is accelerated by a uniform electric field of magnitude 1 7 5 N / C . ( a ) Through what distance, in meters, has the electron traveled when its kinetic energy...
-
Sallie Company applies factory overhead on the basis of a rate per direct labor-hour. The company provides you with the following data for the month of May 20X1. Selected inventories have different...
-
Complete the equations for the following equilibria and calculate Keq where the Keq expression includes [HO]. Be sure to enter Keq in proper scientific notation. (a) ammonia (acting as a base) reacts...
-
a. Create a CollegeCourse class. The class contains fields for the course ID (for example, CIS 210), credit hours (for example, 3), and a letter grade (for example, A). Include get and set methods...
-
Write an application that prompts the user for a password that contains at least two uppercase letters, at least three lowercase letters, and at least one digit. Continuously reprompt the user until...
-
The toString() method converts a(n) ____________ to a String. a. char b. int c. float d. All of the above
-
Baggai Enterprises has an ROA of 10 percent, retains 30 percent of earnings, and has an equity multiplier of 1.25. Mondale Enterprises also has an ROA of 10 percent, but it retains two-thirds of...
-
International Business Machines (NYSE: IBM), which currently pays a dividend of \($3.40\) per share, has been the subject of two other examples in this reading. In one example, an analyst estimated...
-
An analyst is preparing a forecast of dividends for Hoshino Distributors for the next five years. He uses a spreadsheet model with the following assumptions: Sales are $100 million in Year 1. They...
Study smarter with the SolutionInn App