Make a program that accepts an integer

Assignment Help Business Management
Reference no: EM132341164

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]

o 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.)

o 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.)

o 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]

o To determine the first half of the name, you can use name[0, lengthOfName/2]

o 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: EM132341164

Questions Cloud

The appropriateness of certain employee displays : There has been some controversy in your workplace lately over the appropriateness of certain employee displays.How does context, such as different employee role
Essential component of the original bitcoin white paper : Besides the Merkle Tree - a data structure, the other essential component of the Original Bitcoin White Paper, is the cryptographic aspect.
Develop skills in Project communication planning : PMIT Project Management Case Study Assignment- Compare your assessment with sound project management practices. Develop skills in Project communication planning
Queues of sorted items as arguments and returns : Merging sorted queues. Develop a static method that takes two queues of sorted items as arguments and returns a queue that results from merging the queues
Make a program that accepts an integer : 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.
What is the overlap between life-culture and art : What is the overlap between life, culture, and art? How can art of all types positively impact office productivity and success?
Discuss the technological changes that have been made since : Discuss the technological changes that have been made since now and how those changes have affected humanity, and how those changes have affected themselves.
Current state of the claim and allocation matrices : Consider a system of 4 processes P1, P2, P3, P4 and a single resource R1. The current state of the claim and allocation matrices (for deadlock avoidance
How to conduct an audit in a simulated business environment : How to conduct an audit in a simulated business environment. Each team will also present a 8-10 minute power point presentation in-class based around report

Reviews

Write a Review

Business Management Questions & Answers

  Planning the schedule for project

The company's president, Michael Dean, is currently planning the schedule for this project. Michael has identified the five major activities

  What are core and augmented services

What is the service continuum? What are goods-dominated services, equipment- or facility-based services, and peoplebased services?

  Illustrate what are their wants and needs

Who are the stakeholders in your place of employment or in a corporation with which you are familiar? Illustrate what are their wants and needs?

  Marilyn didn''t get the job at the quick mart

Marilyn didn't get the job at the Quick Mart. She communicated a lawyer to discuss her options.

  Strategic plan of porsche analysis

Continuation of what you've done on "Porsche's Analysis" you need to make a Case Study and Strategic Plan of what you Read about "What's Driving Porsche?

  Do you think one smooth stone is organized by function

Do you think One Smooth Stone is organized by function. Product, location, or customer? Why do you think that.

  What is refractive index

What is refractive index State the reason why when a ray of light strikes a mirror at 900, the reflected ray travels along the same path as the incident ray

  Developing a virtualization solution

Your paper must use proper APA and must contain citations and references to all materials you access to help you with this paper.

  Confidence interval for the difference in the proportions

Give a 99% confidence interval for the difference in the proportions of the two populations that develop tumors.

  Size and scope of the sports business

The purpose of this assignment is for students to examine the size and scope of the sports business industry and use that information to identify sports business career opportunities and trends.

  Purpose of conducting an experiment

1. Jackson (2012) even-numbered Chapter Exercises (p. 244). 2. What is the purpose of conducting an experiment? How does an experimental design accomplish its purpose? 3. What are the advantages and disadvantages of an experimental design in an educa..

  Balanced appraisal of all three parameters

Does it allow a balanced appraisal of all three parameters? Why or why not?

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