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
What is shouting pertaining to the internet
Ludmilka [50]
Hi!

What is considered shouting on the internet is when WHEN YOU TYPE IN ALL CAPS LIKE THIS!!! Doing this seems to make the words appear louder and more prominent. You can also add more emphasis to ALL CAP words by adding ***ASTERISKS***.
8 0
3 years ago
The ____ loop can be used to process each element of an array.?
salantis [7]
The "For each" loop can be used to process each element of an array.?
4 0
3 years ago
Nate wants to copy the style of his contact address to the normal template. Complete the paragraph to describe how he can access
blondinia [14]

Answer:

1) Nate open his template first and clicks the tab on the ribbon

2) Then, he clicks the dialog box that appears

3) He chooses Templates from the menu

4) Clicks Go to clicks the Organizer button

5) Then he clicks copy

6) Next he clicks on the left side to the backstage view

7) Finally, he selects the document that includes the style he wants to transfer to the normal template

Explanation:

I hope this helps

5 0
3 years ago
________ systems help supervisors by generating databases that act as the foundation for other information systems. Group of ans
Dahasolnce [82]

Answer:

1. Decision support systems

Explanation:

DSS (Decision Support Systems) are systems that provide supports for decisions, judgments and analysis in an organization. They help in solving problems and in decision-making. With DSS, databases that act as foundation for other information systems can be generated for supervisors helping them to make logical analysis of a particular problem hence solving it.

DSS will actually not give the decision, but will guide the decision maker in making the decision by helping to gather raw facts and useful models which enhance decision making.

6 0
4 years ago
Jin is an editor and ready to purchase the domain name for his website where he plans to market his services. He wants to be cre
AveGali [126]

Answer:

D. R2D2editing.com

Explanation:

mark btainliest please

6 0
3 years ago
Other questions:
  • Describe network in terms of the class computer lab
    14·1 answer
  • Use the balanced equation of a nitrogen cycle pathway below to support the conservation of matter and energy. N2 + 8 H --&gt; 2
    9·1 answer
  • Which of the following might not exist in a URL?
    10·2 answers
  • What is a short example of public domain?
    8·1 answer
  • PPE that should be used by every technician include all of the following, EXCEPT
    6·2 answers
  • What is an electronic ledger that tracks mathematical data
    14·1 answer
  • To use a jQuery UI widget, you must code two things in the way that’s prescribed for the widget. What are they?
    5·1 answer
  • In computer science how can you define "copyright, designs and patents act 1988"?​
    8·1 answer
  • Which view is most often used to reorder slides in a presentation that has already been created?
    15·2 answers
  • unlike tv or newspaper ads, internet communications are interactive, and consumers can choose which messages and information the
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!