Find the largest number in a list

Assignment Help Basic Computer Science
Reference no: EM131302246

1. Write and test a recursive function max to find the largest number in a list. The max is the larger of the first item and the max of all the other items.

2. Computer scientists and mathematicians often use numbering systems other than base 10. Write a program that allows a user to enter a number and a base and then prints out the digits of the number in the new base. Use a recursive function baseConversion(num,base) to print the digits.

Hint: Consider base 10. To get the rightmost digit of a base 10 number, simply look at the remainder after dividing by 10. For example, 153%10 is 3. To get the remaining digits, you repeat the process on 15, which is just 153/10. This same process works for any base. The only problem is that we get the digits in reverse order (right to left).

Write a recursive function that first prints the digits of num//base and then prints the last digit, namely num%base. You should put a space between successive digits, since bases greater than 10 will print out with multi-character digits. For example, baseConversion(245, 16) should print 15 5.

Reference no: EM131302246

Questions Cloud

Market value of the house-mortgage : A person has a net asset of $1 million, including a $300,000 net equity of a house (market value of the house – mortgage). Specifically, the house has a market value of $600,000 including $400,000 for the structure and $200,000 for the land, and a mo..
Provides a good overview of cost volume profit analysis : PowerPoint discussing CVP - Provides a good overview of Cost Volume Profit analysis, the various equations that you can use, and how to use it. Some examples are provided showing how to use the CVP Calculator.
Find coefficient of correlation between los and age : Provide the following descriptive statistics for gender: mean, median, mode, standard deviation, range. Find the coefficient of correlation between LOS and age of the patient. Interpret this value
Total ocean freight chargeable : A consignment of 5 cases each case measuring 2.45 x 1.20 x 1.35 Meters each weighing 3850 kilos has to be shipped from Chennai, Sydney, Australia. What will be the total ocean freight chargeable, if the liner rate is USD 85.00 w/m?
Find the largest number in a list : Computer scientists and mathematicians often use numbering systems other than base 10. Write a program that allows a user to enter a number and a base and then prints out the digits of the number in the new base. Use a recursive function baseConve..
Derive the lpe model for the limiter : Derive the LPE model for the limiter given and plot A versus f(A). Note that the Fourier integral will have to be evaluated using numerical integration procedures.
Types of immigrants better for america : 1. Is it good or bad that immigrants are willing to work for less? Why? 2. Are some types of immigrants better for America than others? Why? 3. What are the differences in the effects of illegal vs. legal immigration?
Simulate the band pass and the lpe models : Simulate the band pass and the LPE models and compare the simulated power levels with the computed power levels. Do this for at least three different sampling rates and compare the results.
Write a summary on human resources management : Write a summary on Human Resources Management and Summary of the Recommended Action Plan of Major Tasks, Persons or Departments Accountable, Time to Complete,Metrics for Evaluating the Results of the Transformation,Risks of Not Implementing the Chang..

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Prayer group reflection essay

Ministry requires discipline and ministers must grow in their spiritual lives through spiritual disciplines. Ministers must also know how to help those who are entrusted in their care to grow spiritually. Consider prayer group meeting on a weekly bas..

  Assignment school engineering and information technology

atrobe Valley Product Gallery (LVPG) specialises in promoting and selling both (i) stand space at trade fairs and (ii) tickets for visitors to trade fairs in Latrobe Valley, Gippsland area.

  Create a spreadsheet to track personal expenses

Creating a spreadsheet to track personal expenses is an excellent use of Microsoft Excel. For this exercise, you will create a spreadsheet to enter a personal budget and track actual expenses for the year.

  What is the necessity of including idf in the weight

What is the necessity of including IDF in the weight of a term?

  Propose remedies the law provides for the violations

Propose remedies the law provides for the violations. Write a summary of your findings. Prior summarizing, list your major findings from the discussion and this assignment in a bullet-point list. Collate all your findings in the summary keeping ..

  Describe what factors or variables contribute to a strong

The text emphasizes the need for strong business/IT relationships for managing IT. Describe what factors or variables contribute to a strong cross-unit relationship. Provide examples and cite your sources as appropriate.

  What effect does this limit have on users

Some operating systems have a tree-structured file system but limit the depth of the tree to some small number of levels. What effect does this limit have on users? How does this simplify file system design (if it does)?

  Effective advanced filtering and search interface

Describe the most effective advanced filtering and search interface. Argue why the interface you chose is more effective than others, and describe who benefits most from the interface you are describing.

  Explain the characteristics of a virtual server

Explain the characteristics of a virtual server infrastructure. Describe the difference between physical server and virtual server environments.Describe the various types of cloud-based architectures: SaaS, IaaS, PaaS.

  Dividends and earning approach to value a share

Use the Dividends and Earning approach to value a share of Merck (MRK) stock. Your investment horizon is 5 years. You expect to earn dividends according to the chart below. Your forecast of sales and profit margins leads you to expect to be able t..

  Propose a dhcp configuration

Your organization has expanded its network from one subnet to two subnets and is putting 200 computers on the new subnet, with plans for adding up to 100 more computers over the next few years.

  Previous windows installations

You are trying to clean up a hard drive to free some disk space. You notice the hard drive has a C:Windows. Old folder that takes up 10 GB of valuable hard drive space. However, in the Disk Cleanup dialog box, you don't see the option to delete Pr..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd