Your program should produce a report that indicates: The date, time, price, category, and rating...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Your program should produce a report that indicates: • The date, time, price, category, and rating of the sale with the highest and lowest per unit price. In case of multiple transactions with the same price, it COMP 210 DSA - Fall 2022 - Assignment 2. 2 • should report the transaction that comes later in the input (not necessarily later by date, but simply later as provided to the program at entry). The quantity, average price, rating, and duration of sales by category. Important notes: The average price is a weighted average that needs to consider the quantity of sold items per transaction. The average rating and duration are the average ratings and average duration among all the concerned users, which does not consider the quantity of sold items. Here is what your output should exactly look like (including decimal places) for the above input: Highest per unit sale: When: 4/7/22 20:45 Category: phone Price: 1699.00 Rating: 5.0 Lowest per unit sale: When: 5/19/22 07:16 Category: book Price: 15.50 Rating: 3.0 Averages by book Quantity: 13 Price: 74.73 Rating: 3.55 Duration: 8.50 Averages by jewelry Quantity: 1 Price: 1699.00 Rating: 3.50 Duration: 19.00 Averages by phone Quantity: 57 Price: 788.78 Rating: 4.50 Duration: 6.00 Part B. Write a program to process information about online shopping data. 1. Requirements for your program. Your program will create a database of sales for a small store that sells various categories of merchandise such as books, jewelry, phones, etc. It will have a series of entries representing transactions in this store. You will initially be asked to enter some sample entries and subsequently the program should output some statistics of the entries. The program will work as follows: • Where: The first input will be an integer that indicates how many transactions will be entered in the database. Following this will be information about each transaction on a single line with the following form: MM/DD/YY, HH:MM, Category, Price, Quantity, Rating, Duration • MM/DD/YY represents the date of transaction. • • HH:MM represents the transaction time in hours and minutes in 24-hour format. Category represents a single word descriptor of the category of sold item. Following 3 types of categories must be supported and may be predefined in an array: "phone", "jewelry" and "book". Price is the per unit price of the sold item (e.g. $189.50). Quantity represents the number of items sold in this transaction (e.g. 12). Rating represent the rating by the user of the sale on a scale of 0.0-5.0. Duration is an integer that represents the number of days it took to deliver the item to the user. Here is an example of what your input might look like: 6 10/15/21 17:00 phone 85.50 12 4.0 8 11/24/21 13:30 phone 959.90 44 4.5 7 3/18/22 1:16 jewelry 1699.00 13.5 19 4/7/22 20:45 phone 1699.00 1 5.0 3 5/17/22 23:45 book 85.50 11 4.1 5 5/19/22 07:16 book 15.50 2 3.0 12 The quantity, average price, rating, and duration of sales by category. Important notes: The average price is a weighted average that needs to consider the quantity of sold items per transaction. The average rating and duration are the average ratings and average duration among all the concerned users, which does not consider the quantity of sold items. Here is what your output should exactly look like (including decimal places) for the above input: Highest per unit sale: When: 4/7/22 20:45 Category: phone Price: 1699.00 Rating: 5.0 Lowest per unit sale: When: 5/19/22 07:16 Category: book Price: 15.50 Rating: 3.0 Averages by book Quantity: 13 Price: 74.73 Rating: 3.55 Duration: 8.50 Averages by jewelry Quantity: 1 Price: 1699.00 Rating: 3.50 Duration: 19.00 Averages by phone Quantity: 57 Price: 788.78 Rating: 4.50 Duration: 6.00 Your program should produce a report that indicates: • The date, time, price, category, and rating of the sale with the highest and lowest per unit price. In case of multiple transactions with the same price, it COMP 210 DSA - Fall 2022 - Assignment 2. 2 • should report the transaction that comes later in the input (not necessarily later by date, but simply later as provided to the program at entry). The quantity, average price, rating, and duration of sales by category. Important notes: The average price is a weighted average that needs to consider the quantity of sold items per transaction. The average rating and duration are the average ratings and average duration among all the concerned users, which does not consider the quantity of sold items. Here is what your output should exactly look like (including decimal places) for the above input: Highest per unit sale: When: 4/7/22 20:45 Category: phone Price: 1699.00 Rating: 5.0 Lowest per unit sale: When: 5/19/22 07:16 Category: book Price: 15.50 Rating: 3.0 Averages by book Quantity: 13 Price: 74.73 Rating: 3.55 Duration: 8.50 Averages by jewelry Quantity: 1 Price: 1699.00 Rating: 3.50 Duration: 19.00 Averages by phone Quantity: 57 Price: 788.78 Rating: 4.50 Duration: 6.00 Part B. Write a program to process information about online shopping data. 1. Requirements for your program. Your program will create a database of sales for a small store that sells various categories of merchandise such as books, jewelry, phones, etc. It will have a series of entries representing transactions in this store. You will initially be asked to enter some sample entries and subsequently the program should output some statistics of the entries. The program will work as follows: • Where: The first input will be an integer that indicates how many transactions will be entered in the database. Following this will be information about each transaction on a single line with the following form: MM/DD/YY, HH:MM, Category, Price, Quantity, Rating, Duration • MM/DD/YY represents the date of transaction. • • HH:MM represents the transaction time in hours and minutes in 24-hour format. Category represents a single word descriptor of the category of sold item. Following 3 types of categories must be supported and may be predefined in an array: "phone", "jewelry" and "book". Price is the per unit price of the sold item (e.g. $189.50). Quantity represents the number of items sold in this transaction (e.g. 12). Rating represent the rating by the user of the sale on a scale of 0.0-5.0. Duration is an integer that represents the number of days it took to deliver the item to the user. Here is an example of what your input might look like: 6 10/15/21 17:00 phone 85.50 12 4.0 8 11/24/21 13:30 phone 959.90 44 4.5 7 3/18/22 1:16 jewelry 1699.00 13.5 19 4/7/22 20:45 phone 1699.00 1 5.0 3 5/17/22 23:45 book 85.50 11 4.1 5 5/19/22 07:16 book 15.50 2 3.0 12 The quantity, average price, rating, and duration of sales by category. Important notes: The average price is a weighted average that needs to consider the quantity of sold items per transaction. The average rating and duration are the average ratings and average duration among all the concerned users, which does not consider the quantity of sold items. Here is what your output should exactly look like (including decimal places) for the above input: Highest per unit sale: When: 4/7/22 20:45 Category: phone Price: 1699.00 Rating: 5.0 Lowest per unit sale: When: 5/19/22 07:16 Category: book Price: 15.50 Rating: 3.0 Averages by book Quantity: 13 Price: 74.73 Rating: 3.55 Duration: 8.50 Averages by jewelry Quantity: 1 Price: 1699.00 Rating: 3.50 Duration: 19.00 Averages by phone Quantity: 57 Price: 788.78 Rating: 4.50 Duration: 6.00
Expert Answer:
Answer rating: 100% (QA)
PART A To write the program to produce the desired output you can follow these steps 1 Parse the input data containing information about sales transactions 2 Iterate through the sales transactions to ... View the full answer
Related Book For
Managerial Accounting
ISBN: 9780073526706
12th Edition
Authors: Ray H. Garrison, Eric W. Noreen, Peter C. Brewer
Posted Date:
Students also viewed these programming questions
-
Suppose that you have 6 hours per day to devote to studying economics and accounting. You estimate your benefits of studying for each subject as follows: What is the best way for you to divide up...
-
Welstead Company has the following data for the weekly payroll ending January 31. Employees are paid 112 times the regular hourly rate for all hours worked in excess of 40 hours per week. FICA taxes...
-
prepare a post-closing trial balance. Cash Account Titles Accounts Receivable Supplies Accounts Payable Unearned Service Revenue Owner's Capital Owner's Drawings Service Revenue Salaries and Wages...
-
Dorsey Company manufactures three products from a common input in a joint processing operation. Joint processing costs up to the split-off point total $350,000 per quarter. For financial reporting...
-
Determine whether the statement is true or false. If it is false, explain why or give an example that shows it is false. The mass of a book is a scalar.
-
Identify the four components of an ecosystem. After you do this try to visualize the interactions of these four components of an ecosystem as illustrated by Figure 2. 2 in the textbook. Does this...
-
Stan Weakly can sort a bin of 100 letters in 10 minutes. He typically receives 600 letters an hour. A truck arrives with more bins every 30 minutes. The office uses a safety factor of 10%. How many...
-
Prepare the journal entries to record each of the transactions 1 through 6 as of the date of occurrence. Note: Round answers to the nearest whole dollar. 1. On January 1, new equipment is purchased...
-
Solve the minimum cost network flow problem given in Figure 12.32, using the network simplex algorithm. Start with the initial solution x12 = 5, x13 = 10, x24 = 10, x34 = 30, x35 = 15, x45 = 10, x46...
-
Dell Inc. exports computers to Brazil, whose currency, R$ (reais), has been trading at R$4.00/US$. Dell currently exports 40,000 computers per year at reais equivalent of $400 each. A strong rumor...
-
Lockheed Corporation reported EBITDA of $4,000 million in the year just ended (year 0), prior to interest expenses of $1,000 million and depreciation charges of $600 million. Capital expenditures in...
-
A trustee distributed $12,000 to a beneficiary who is a resident in Australia 16 years old full time school student living with her parents and earns no other income. a) What are the tax consequences...
-
Problem 2 EM Industries is considering a new project involving the acquisition of a new machine that would replace an older machine currently in use. The new machine costs $750,000 (at t-0) and can...
-
How many times will this simulation loop stop and do animation? Dim i as Integer For i = 1 to 100 ...simulation code... If i Mod 20 = 0 Then ...animation code... Application. Wait Now +...
-
From the text, the average rate of change of the function f(x) = Bx2 + 6x over the interval x = 1 to x = 2 is the slope of the line connecting the corresponding points on the function. Hence, we need...
-
MgO prevents premature evaporation of Al in a furnace by maintaining the aluminum as Al2O3. Another type of matrix modifier prevents loss of signal from the atom X that readily forms the molecular...
-
Linden Company manufactures and sells a single product. Cost data for the product follow: Variable costs per unit: Direct materials. . . . . . . . . . . . . . . . . . . . . . . . . $ 6 Direct labor ....
-
Ruedi Bärlach PLC, a company located in Gümligen, Switzerland, manufactures custom-designed high-precision industrial tools. The company has a traditional job-order...
-
Define the following terms: (a) cost behavior and (b) relevant range.
-
The global market presents firms with more complex ethical issues than they would experience if operations were limited to one country and one culture. Moral standards vary across cultures. In some...
-
Bhopal is a city in central India with a population, in 1984 , of 800,000 . Because it was, at that time, home to the largest mosque in India, Bhopal was a major railway junction. Its main industries...
-
PricewaterhouseCoopers (or PwC, as it is known), one of the United States' "Big 4" accounting firms, has had a tax practice in Russia since the time that country changed from Communist rule. One of...
Study smarter with the SolutionInn App