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
ad-work [718]
4 years ago
9

1. Write a function that will ask the user to enter a value in dollars. The function should calculate and display the equivalent

number of pennies, nickels, dimes, and quarters. Acceptable values are those which when multiplied by 100 will be exactly divisible by 50 (100*value must be exactly divisible by 50). Write a caller main function to call your function.
Computers and Technology
1 answer:
julia-pushkina [17]4 years ago
3 0

Answer:

import java.util.Scanner;

public class Main

{

public static void main(String[] args) {

   

    valueInDollars();

}

   public static void valueInDollars() {

       double currentMoney, quarters, dimes, nickels, pennies;

       Scanner input = new Scanner(System.in);

       

       System.out.print("Enter a value in dollars: ");

       currentMoney = input.nextDouble();

       currentMoney *= 100;

       quarters = (int)currentMoney / 25;

       currentMoney = currentMoney % 25;

       

       dimes = (int)currentMoney / 10;

       currentMoney = currentMoney % 10;

       

       nickels = (int)currentMoney / 5;

       currentMoney = currentMoney % 5;

       

       pennies = currentMoney;

       

       System.out.print("Quarters: " + quarters + "\n" + "Dimes: " + dimes + "\n" + "Nickels: " + nickels + "\n" + "Pennies: " + pennies);

   }

}

Explanation:

<u>Inside the function:</u>

- Declare the variables

- Ask the user for a value in dollars

- Multiply that value by 100

- Find the amount of quarters, dimes, nickels, and pennies

- Print the values

<u>Inside the main:</u>

- Call the function

You might be interested in
I have a summary to write for my robotics class but it is way too hard and i have a bery less time. If you can help me it would
Ierofanga [76]

Answer:

What is Robotics?

Robotics is the branch of technology that deal with the design, construction, operation and application of robots as well as computer system for there control, sensory feed back, and information processing. the design of given robotic system often contain principle of mechanical or electronic engineering and computer science. The word robotic was first used in 1941 by the writer Isaac Asimov.

Branches of robotics:

Artificial intelligence: The developing of an intelligence of machine and is a branch of computer science.

Nano Robotics : the field of creating machines that are at a scale of a nano meter.

Tele-presence: The study given to an illusion of being at a place without being there physically.

Robot Locomotion: The study of method that Robots used to transport them selves from place to another.

Robots have long captured the human imagination but despite many advances robots have yet to reach the potential so often envisioned in science fiction today engineers and computer scientist are still pursuing one missing ingredient high intelligence it would be nice for example: if robots possessed the intelligent needed to cope  with uncertainty, learn from experience and work as team.

Intelligent robots will be one of the engineering achievement of 21 century said Junku Yuh, how leads the robotics program in the national science foundation computers and information science and engineering directorate "we will see them more and more in our daily life".

5 0
3 years ago
If you like to play graphic-intensive games on your computer and you find that your computer can't keep up, you should add a ___
s344n2d4d5 [400]
I think its video card tell me if i'm wrong
6 0
3 years ago
Which of the following statements is true about mobile devices and procedures?
Zarrin [17]

Answer:

No

Explanation:

No

5 0
3 years ago
E-mail is an temporary message medium.<br> a. True<br> b. False
Volgvan

E-mail stands for Electronic mail. It is a method of exchanging messages ("mail") between people in a telecommunication network with the usage of electronic devices. There is a sender and a receiver for any given message, and they switch positions in turn.

The statement that E-mail is an temporary message medium is false. E-mail can be kept forever and are not temporary.


6 0
3 years ago
Read 2 more answers
Which of the following is NOT used to describe rhythm?<br> Beat<br> Pitch<br> Tempo<br> Meter
PtichkaEL [24]

Answer:

pitch

Explanation:

Rhythm is, by definition, a strong, regular, repeated pattern of movement or sound. This means that it's a pattern of one thing.

Out of beat, pitch, tempo, and meter, three of them have one thing in common when corresponding to rhythm: monotony. Monotony is the same thing, unchanged in sound and movement.

For example, drawing a straight line continuously.

Beat is a main accent or rhythmic unit in music or poetry.

Pitch is the degree of highness or lowness of a tone.

Tempo is the speed at which a passage of music is or should be played.

Meter is  the rhythm of a piece of poetry, determined by the number and length of feet in a line.

When you listen to music, a rap, or poetry, you can "feel the beat." This means you can pick out the main sound being accentuated, like the "boom-boom-boom" or a clapping track.

Tempo is how fast something goes. A slow song played at a ballet may be different than a rap song, which is fast. Tempo is the speed.

Meter is the rhythm, usually in poetry. It's like a beat and other patterns in the poem.

Pitch is the one that is different. It changes the tone. For example, a high note vs. a low note. That's pitch. When someone swallows helium and talks, their voice is now "high-pitched" because it has a higher-sound tone.

Rhythm does not change—it's a pattern of beats, tempos, and rhythms. Unlike pitch, pitch is musical. Rhythm is not—it's just the pattern.

4 0
3 years ago
Read 2 more answers
Other questions:
  • What precaution can you take while using a social networking site to prevent a data breach?
    15·1 answer
  • How old is the oldest asian
    14·2 answers
  • Climate is considered a(n) _______ limiting factor. (2 points)
    9·1 answer
  • Characteristics of successful entrepreneurs include
    11·1 answer
  • Which devices typically generate computer output ?
    8·2 answers
  • Benjamin recently issued new mobile phones to the marketing team at his company. Each phone can transmit encrypted information f
    8·1 answer
  • Phishing is a broad term that describes any program that is designed to cause harm or transmit information to others without the
    8·1 answer
  • In the digital age we have less time to absorb and make sense of new information
    12·2 answers
  • Write a script that checks to see if at least one argument has been given on the command line and tests whether the argument is
    5·1 answer
  • Is there a way of how to delete this if so pleas tell me
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!