Program that accepts an integer input

Assignment Help Business Management
Reference no: EM132331630

1. Make a program that accepts an integer input from the user and display the least number of combinations of 200s, 100s, 50s, 20s, 10s, 5s, and 1s.

[Test your solution using this samples]

a. Input: 250

Output: 1x200s, 1x50s

b. Input: 1127

Output: 5x200s, 1x100s, 1x20s, 1x5s, 2x1s

c. Input: 1127

Output: 5x200s, 1x100s, 1x20s, 1x5s, 2x1s

d. Input: 19

Output: 1x10s, 1x5s, 4x1s

[Hints]

  • Use division to determine the number of occurrence of each element (i.e. 200, 100) in the input (e.g. Given 500 if we divide it by the largest number possible; which is 200; we will get 2. Therefore, there are 2x200s.)
  • Use subtraction to determine the remaining value of the input. (e.g. In the 500 example, since there are 2x200s, we still have 100 to process. The 100 came from 500 - (2*200) = 100.)
  • Use the next largest number possible (i.e. 100) to check the number of occurrence. Continue until the remaining value of the input is zero.

2. Make a program that accepts the firstname and the lastname of the user, and display the first half of the lastname, first half of the firstname, second half of the lastname and second half of the firstname.

[Test your solution using this samples]

a. Firstname Input: Juan

Lastname Input: DelaCruz

Output: DelaJuCruzan

b. Firstname Input: Pedro

Lastname Input: Penduko

Output: PendPedukoro

c. Firstname Input: Johann

Lastname Input: Logan

Output: LogJohanann

d. Firstname Input: Mari

Lastname Input: Santamaria

Output: SantaMamariari

[Hints]

  • To determine the first half of the name, you can use name[0, lengthOfName/2]
  • To determine the second half of the name, you can use name[lengthOfName/2, lengthOfName]
  • To determine the length of the name, you can use lengthOfName = GetLength(name)

Reference no: EM132331630

Questions Cloud

Code for a mortgage loan calculator : I was thinking of utilizing arrays for multiple users that will give the payment amount after the input loan amount, interest rate and years to repay.
Federal government applications residing in the cloud : What risk management framework is best to use for federal government applications residing in the cloud?
What is the importance of clearing cookies from a device : What is the importance of clearing cookies from a device? And what effect could this have on the device if this is not done?
Identify and troubleshoot problems : Discuss how you can use system tools, such as the Task Manager, to help identify and troubleshoot problems?
Program that accepts an integer input : 1. Make a program that accepts an integer input from the user and display the least number of combinations of 200s, 100s, 50s, 20s, 10s, 5s, and 1s.
Create power point presentation : You will create a power point presentation (as you may have chosen throughout previous assignments) designed to demonstrate to Board of Directors organizational
What are the roles that will be interacting with the system : What are the roles that will be interacting with the system and Write down a list of additional features which in principle could be included in the new system
Discuss how cyber laws will have changed 5 years from today : Discuss the technological changes that have been made since now and how those changes have affected humanity, and how those changes have affected themselves
Prepare statement of cash flows using the indirect method : During the year, $70 of common stock was issued in exchange for plant assets. No plant assets were sold in 2017.

Reviews

Write a Review

Business Management Questions & Answers

  People and organizational considerations

You have already selected strategies to implement for the company you chose. In a brief 2-3 page paper, describe what should be done to foster successful implementation of your chosen strategies. Be sure to examine both people and organizational c..

  Managing alliances discussionluthans and doh 2012 discuss

managing alliances discussionluthans and doh 2012 discuss managing alliances. in your professional opinion as an

  Adapting to and implementing new technologies

Managing competitive advantage calls for adapting to and implementing new technologies.

  Compute profit margin and asset turnover

In other words, compute profit margin and asset turnover for each company:

  Discuss why we think and what is thinking

Discuss why we think and what is thinking? Brainstorm the questions and give definitions of thinking with example and relate them to your own experience.

  Provides the real detail on year to year performance

The Management Discussion and Analysis section provides the real detail on year-to-year performance. In your case this will be 2020 vs. 2019.

  Engaging with a couple of marketing professionals

The purpose of this discussion is to get you engaging with a couple of marketing professionals to get their feedback about their experiences and to use their input to help you with your plan for this semester. Find 2 different individuals, from 2..

  Marginal propensity to save

In an economy, when income increases from $400 billion to $500 billion, consumption expenditure changes from $420 billion to $500 billion. Calculate the marginal propensity to consume the change in saving, and the marginal propensity to save.

  Find a match to a stored password

What type of password- guessing attack hashes familiar words and tries to find a match to a stored password?

  How much did you earn

You are in the 33% tax bracket. How much did you earn, both in total and percentage, and what is your tax liability?

  Code containing the hearbleed vulnerability

The person who wrote the portion of Open SSL, code containing the Hearbleed vulnerability said the error slipped through because

  Optimizing dfs replication

What is the importance (and therefore the consequences of not doing it) of optimizing DFS Replication? Please explain.

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