c# coding 1. Price Check There is a shop with old-style cash registers. Rather than scanning items
Fantastic news! We've Found the answer you've been seeking!
Question:
c# coding
Transcribed Image Text:
1. Price Check There is a shop with old-style cash registers. Rather than scanning items and pulling the price from a database, the price of each item is typed in manually. This method sometimes leads to errors. Given a list of items and their correct prices, compare the prices to those entered when each item was sold. Determine the number of errors in selling prices. Example products = ['eggs', 'milk', 'cheese'] productPrices = [2.89, 3.29, 5.79] productSold = ['eggs', 'eggs', 'cheese', 'milk'] soldPrice = [2.89, 2.99, 5.97, 3.291. Price Product Actual Expected 2.89 2.99 5.97 3.29 eggs eggs cheese milk Expected Error 2.89 2.89 5.79 3.29 1 1 The second sale of eggs has a wrong price, as does the sale of cheese. There are 2 errors in pricing. Function Description Complete the function priceCheck in the editor below. priceCheck has the following parameter(s): string products[n]: each products[i] is the name of an item for sale string productPrices[n]: each productPrices[i] is the price of products[i] string productSold[m]: each productSold[i] is the name of a product sold float soldPrice[m]: each soldPrice[j] contains the sale price recorded for productSold [j]. Returns: int: the number of sale prices that were entered incorrectly 1 > using System.CodeDom.Compiler; ... 16 T 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 class Result { } /* * Complete the 'priceCheck' function below. * The function is expected to return an INTEGER. * The function accepts following parameters: * * */ 1. STRING ARRAY products 2. FLOAT ARRAY product Prices 3. STRING_ARRAY productSold 4. FLOAT_ARRAY soldPrice public static int priceCheck(List products, List product Prices, List productSold, List soldPrice) { } 37 38 class Solution... 1. Price Check There is a shop with old-style cash registers. Rather than scanning items and pulling the price from a database, the price of each item is typed in manually. This method sometimes leads to errors. Given a list of items and their correct prices, compare the prices to those entered when each item was sold. Determine the number of errors in selling prices. Example products = ['eggs', 'milk', 'cheese'] productPrices = [2.89, 3.29, 5.79] productSold = ['eggs', 'eggs', 'cheese', 'milk'] soldPrice = [2.89, 2.99, 5.97, 3.291. Price Product Actual Expected 2.89 2.99 5.97 3.29 eggs eggs cheese milk Expected Error 2.89 2.89 5.79 3.29 1 1 The second sale of eggs has a wrong price, as does the sale of cheese. There are 2 errors in pricing. Function Description Complete the function priceCheck in the editor below. priceCheck has the following parameter(s): string products[n]: each products[i] is the name of an item for sale string productPrices[n]: each productPrices[i] is the price of products[i] string productSold[m]: each productSold[i] is the name of a product sold float soldPrice[m]: each soldPrice[j] contains the sale price recorded for productSold [j]. Returns: int: the number of sale prices that were entered incorrectly 1 > using System.CodeDom.Compiler; ... 16 T 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 class Result { } /* * Complete the 'priceCheck' function below. * The function is expected to return an INTEGER. * The function accepts following parameters: * * */ 1. STRING ARRAY products 2. FLOAT ARRAY product Prices 3. STRING_ARRAY productSold 4. FLOAT_ARRAY soldPrice public static int priceCheck(List products, List product Prices, List productSold, List soldPrice) { } 37 38 class Solution...
Expert Answer:
Answer rating: 100% (QA)
C program to create a method that returns the number of errors in selling prices of the products ... View the full answer
Related Book For
Concepts of Database Management
ISBN: 978-1285427102
8th edition
Authors: Philip J. Pratt, Mary Z. Last
Posted Date:
Students also viewed these electrical engineering questions
-
Using the C or C++ coding language or most easily done with MatLab write a program that does the following Included is this First order ODE Here begins the question it is all one question but stepped...
-
5. Using the coding techniques described in this chapter,carefully read through the case study and determine the mostaccurate CPT code(s) and HCPCS code(s) andmodifier(s), if appropriate. Answer the...
-
Consider the position of coding specialist at University Hospital, positions or job descriptions-inpatient coding specialist and outpatient coding specialist. As the coding supervisor have been asked...
-
Data collected at elementary schools in DeKalb County, GA suggest that each year roughly 25% of students miss exactly one day of school, 15% miss 2 days, and 28% miss 3 or more days due to sickness....
-
1. Should inside traders, who are nonviolent, white collar criminals, be subject to Mafia-style investigation tools? 2. How can a stock trader know when she or he is receiving inside information that...
-
Two coils, one mounted on a stator and the other on a rotor, have self- and mutual inductances of L11 = 3.5mH L22 = 1.8mH L12 = 2.1cos mH where is the angle between the axes of the coils. The coils...
-
Heritage, a general contractor, had filed a breach of contract action against an electrical subcontracting firm that had withdrawn its bid right before the contract was to be performed. A jury had...
-
Mozena Corporation has collected the following information after its first year of sales. Sales were $1,500,000 on 100,000 units; selling expenses $250,000 (40% variable and 60% fixed); direct...
-
Jacinta had a bad experience with an insurance agent when her house flooded. The insurance agent was generally unhelpful and rude. She found herself becoming distrustful of all insurance agents,...
-
1. The model should list the given financial information for all potential projects. 2. The model should associate with each proposed project a cell that is 1 if the project is approved and 0 if it...
-
What are some strengths and weaknesses about a new product sleep lotion? What would be the SWOT analysis? What would be the compeititon? ( use resources)
-
Consider an actively managed fund, Fund A, that generates a 15% p.a. gross return and charges a 2% p.a. expense ratio. There is also a passively managed fund, Fund P, that generates only an 10% p.a....
-
You plan to enhance your company's technology infrastructure by investing $55,000 in a new software system. This software will be depreciated using the straight-line method over 6 years to a terminal...
-
calculate the New expected return Expected return using CAPM: E(RIAG) E(RMOG) 0.356133963 0.377599269 Since the calculated data is in % we need to divide by 100 and multiply by 12 because we are...
-
Find a topic that is in some way related to employment law. It does not have to be a topic covered in the textbook. Write an initial post discussing your topic due by Thursday night. Then, respond to...
-
post, read the following scenario and provide your answer to the following questions: Scenario: Marge Johnson is a gymnastics coach who owns a gymnastics academy. She conducts age group classes at...
-
Leesum Company has two divisions: the Leone Division and the Letwo Division. The following information pertains to last year's results: Leone Division Letwo Division $623,150 4,800,000 Net...
-
Write a program that initializes an array. It inputs a value from the user and searches the number in the array.
-
Using a document at your own school (for example, a class schedule), determine the attributes present in the document. Using your knowledge of the policies at your school, determine the functional...
-
What is a form?
-
Describe the purpose of the UNION command in relational algebra.
-
Draw Bode plots for a sixth-order Pade approximation to a pure delay of 1 second.
-
A rejection network that can be utilised instead of the twin-T network is the bridged-T network shown below. The transfer function of this network is given by \[...
-
Sketch the polar plot of the frequency response for the following transfer functions: 1 (a) KG(s): = (1+0.5s) (1+2s) (1+0.5s) (b) KG(s) = $2 s+10 (c) KG(s) = s2+6s+10 30(s+8) (d) KG(s) = s(s+2)(s+4)
Study smarter with the SolutionInn App