1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
son4ous [18]
3 years ago
14

Once upon a time there was a country called Plusplusland. The monetary system they used there was simple: the currency name was

the "plussar" and their central bank issued five different banknotes of values 50, 20, 10, 5 and 1 plussar.Your task is to write a program for the ATMs of Plusplusland. The program should find the minimal number of banknotes needed to deliver any amount of money to the client.The Treasury Minister has asked you personally to do this. He expects your code to print the values of all the needed banknotes in a row – this is the format accepted by all ATMs in Plusplusland. Your program will require the use of an integer array combined with different loops to process the currency.Test your code using the sample data provided below......Example input125Example output50 50 20 5Example input127Example output50 50 20 5 1 1Example input49Example output20 20 5 1 1 1 1(HINT: Here is an array that maybe helpful for all known banknotes ordered from the most valuable to the leastint banknotes[] = {50, 20, 10, 5, 1} and then use your skill with array related processing combining different kinds of loops)
Computers and Technology
1 answer:
Rainbow [258]3 years ago
3 0

Answer:

Hi!

The answer coded in Javascript is:

function minimalNumbersOfBanknotes(input) {

var banknotes = [50, 20, 10, 5, 1];

var output = '';

 <em>//Each while writes on output variable the banknote and substract the same quantity on input variable.</em>

<em>  //If the input is lesser than the value of while banknote, step into next while.</em>

<em />

<em>   </em>for (var i = 0; i < banknotes.length; i++) {

      while(input >= banknotes[i]) {

         output = output + '  ' + banknotes[i];

         input = input - banknotes[i];

     }

 }

 return output;

}

You might be interested in
We can draw crescent using ?
Anarel [89]

Answer:

I think it's B

hope this helps

have a good day :)

Explanation:

4 0
3 years ago
Read 2 more answers
Suponiendo que el centro de la gravedad de la barra se enchentra a 3 m del punto de apoyo,y su contrapeso, de 4800 N, se encuent
VikaD [51]

Answer:

C

Explanation:

because...

6 0
3 years ago
Which statements about viruses are true? select the four statements that are true. select the four statements that are true. all
navik [9.2K]
<span>A) All viral genomes contain both DNA and RNA. FALSE. Viruses contain the smallest necessary amount of genetic information packaged in a capsule composed of proteins. Containing both DNA and RNA would be a redundancy that would unnecessarily increase the size of the virus and make it more difficult for the virus to penetrate a cell. B) A retrovirus contains RNA. TRUE. By definition a retrovirus contains single-stranded positive-sense RNA instead of DNA. C) HIV contains two identical strands of DNA. FALSE. HIV is a retrovirus and, therefore, contains RNA instead of DNA. D) HIV contains reverse transcriptase. TRUE. HIV is a retrovirus that contains an RNA genome. All retroviruses require reverse transcriptase to convert their genome from RNA to DNA once the virus has been entered the cell. E) The capsid enters the host cell if the virus is enveloped. TRUE. Viruses are to large to enter a cell by passive diffusion or active transport. The only remaining major form a transport into the cell is endocytosis, or being enveloped. F) All RNA-containing viruses are retroviruses. FALSE. By definition a retrovirus contains single-stranded positive-sense RNA. Viruses can contain RNA in other forms (ie double-stranded) and would, therefore, not be considered a retrovirus. G) Enveloped viruses bud from the host cell. TRUE. Viruses are to large to enter a cell by passive diffusion or active transport. The only remaining major form a transport into the cell is exocytosis. For a virus to exit the host cell and infect other cells, they must exit by exocytosis, or budding.</span>
4 0
4 years ago
Anyone got an xb0x and wann be friends 16+
Amiraneli [1.4K]

Answer:pointsssExplanation:

4 0
3 years ago
Read 2 more answers
An ATM card is used on January 24 to withdraw cash. What is the balance after this transaction
Nezavi [6.7K]
The balance is what ever money is left in the account
4 0
3 years ago
Read 2 more answers
Other questions:
  • The compare_strings function is supposed to compare just the alphanumeric content of two strings, ignoring upper vs lower case a
    15·1 answer
  • In this recitation assignment, will write a complete C program that accepts as input any two integers from the user and swaps bo
    5·1 answer
  • Write a program in C which will open a text file named Story.txt. You can create the file using any text editor like notepad etc
    9·1 answer
  • You’re responsible for an always-on VPN connection for your company and have been told that it must utilize the most secure mode
    12·1 answer
  • What are the advantages of upgrading computer hardware?
    13·2 answers
  • Sidney works in the accounting department. His boss just assigned him a task that involves creating budget formulas for the comp
    15·1 answer
  • create a function named dispAry. This function has 2 arguments, the first one is an integer array and second one is a integer to
    15·1 answer
  • Sort short_names in reverse alphabetic order.
    11·1 answer
  • What is Geocortex and how does it work in web or mobile?
    11·1 answer
  • Sidney needs to create a decimal number variable that will be added to another number. What kind of variable is required?binaryB
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!