Create a console C# app in which you are required to create the following generic method...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Create a console C# app in which you are required to create the following generic method and test it for integers array and doubles array. A) public static T[] PrintSubArray(T a[], int startIndex, int endindex) which returns a sub array containing the elements between - startIndex value and endindex value (including both). [10 marks] B) You need to add validations for startIndex such as it should not be negative and should not be greater than size of the array and should not be higher than endIndex. Also, for endindex such as it can not be negative, less than startIndex or higher than the size of the array. [3 marks] C) User should enter the value for start index and end index from keyboard. [2 marks] D) Test the method by passing it two arrays - int array and char array. These arrays should have at least 10 elements and you need to populate these arrays with random values (int array between 10 and 100) and char array between ('a' and 'z') [5 marks] Create a console C# app in which you are required to create the following generic method and test it for integers array and doubles array. A) public static T[] PrintSubArray(T a[], int startIndex, int endindex) which returns a sub array containing the elements between - startIndex value and endindex value (including both). [10 marks] B) You need to add validations for startIndex such as it should not be negative and should not be greater than size of the array and should not be higher than endIndex. Also, for endindex such as it can not be negative, less than startIndex or higher than the size of the array. [3 marks] C) User should enter the value for start index and end index from keyboard. [2 marks] D) Test the method by passing it two arrays - int array and char array. These arrays should have at least 10 elements and you need to populate these arrays with random values (int array between 10 and 100) and char array between ('a' and 'z') [5 marks]
Expert Answer:
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
Match the document to the stakeholder(s) who prepares the document. Proforma invoice - Sales contract Purchase order - Commercial invoice A. vendor and buyer B. beneficiary C. Advising bank D....
-
Predictive text entry systems are familiar on touch screens and mobile phones. This question asks you to consider how the same principles might be used in a programming editor for creating Java code....
-
Googles ease of use and superior search results have propelled the search engine to its num- ber one status, ousting the early dominance of competitors such as WebCrawler and Infos- eek. Even later...
-
iHerb Inc. has several herb extractor evaporators that were purchased four years ago at a price of $20,000. These machines currently require annual maintenance costs of $2,000. However, the...
-
The following questions concern Poisson regression models fit to fictitious follow-up study data in which rates of disease are modeled as a function of age and smoking status. The SAS program codes...
-
Sodium hydrogen sulfite is prepared from sodium carbonate and sulfur dioxide: Na2CO3(s) + 2SO2(g) + H2O(l) 2NaHSO3(aq) + CO2(g) How many grams of NaHSO3 can be obtained from 25.0 g of Na2CO3?
-
EuroVirtuals Consolidated Earnings. EuroVirtual pays different tax rates for each of its country operations. a. What are its earnings per share in EUR after deducting taxes? b. What is the proportion...
-
Clover Dairy Products Corp. buys one input, full-cream milk, and refines it in a churning process. From each gallon of milk Clover produces three cups of butter and nine cups of buttermilk. During...
-
6.4 8.3 H Boxplot: Annual Mileage 11.2 15.4 24.7 10 15 20 Thousands of Miles Driven Annually 25 esearcher surveyed 386 adults and recorded the number of miles they drove their car in one year. e...
-
A $ 2 0 0 0 bond was purchased between bond coupon dates for a purchase price ( flat price ) of $ 2 5 0 0 . 2 9 . The accrued interest on the date of sale was $ 5 3 . 7 0 . What is the market quote...
-
what ways can organizations align their business strategies with sustainability and CSR goals, and how does this alignment impact stakeholder relationships and organizational reputation ?
-
From the strongest chemical bond to the weakest, list the three types of chemical bonds. For each type: 1) briefly describe what causes the chemicals to bind AND 2) give one specific example of a...
-
Jason bought a put option on a $100,000 TBond futures contract with an exercise price of 105 and a premium of $2000. (Note: The price of an option is quoted in points that mimic the futures contract,...
-
Describe business ethics issues in precapitalist America. Describe ethical foundation of capitalism (Adam Smith). Discuss the balance between economic growth and stakeholder rights throughout U.S....
-
What is the purpose of SDS in SDS-PAGE? (1 point) Discuss the components and purpose of the 2X sample buffer. (2 points)
-
Your final writing piece is comprised of two parts. The first part of your analysis must be a 3 - 5 page (double space) analysis on your learning around professional writing based on the learning...
-
Evaluate each logarithm to four decimal places. log 0.257
-
Assuming the same data as given in problem 8, was the well in each case profitable? Discuss your answer. Problem 8 Elizabeth Petroleum data in connection with Lease A are as follows: REQUIRED: Should...
-
A saltwater disposal system is added to Lease As gathering system at a cost of $150,000. The expense for the month of May 2016 is $15,000. Record the acquisition cost and the monthly expense assuming...
-
Bore Oil Company pays the following amounts during June 2016 relating to producing leases: Supplies for Lease A. $ 300 Fuel for Lease A... 800 Labor cost for pumpers and gaugers Lease A. 2,000 Fringe...
Study smarter with the SolutionInn App