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]
3 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]3 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 x squared times b squared
Pie

Answer:

x^2 * b^2

Explanation:

Like 3 squared times 2 squared is 3*3*2*2. Similarly the expression given in the question is equal to x*x*b*b. And that explains what is mentioned in question.

3 0
3 years ago
How did machines get involved throughout the years?
Nataliya [291]

Answer:

Although the primary goal of a political machine is keeping itself in power rather than providing good government, machines have been responsible for restructuring city governments to centralize authority, improving facilities and services, helping to assimilate immigrant groups, and encouraging the growth of business and industry. Supporters of political machines say that they “work” and that consolidating power in the hands of a boss.

Explanation:a political machine is a political group in which an authoritative leader or small group command the support of a corps of supporters and businesses

4 0
2 years ago
A technician replaces a defective 250GB hard drive in a desktop with a 2TB hard drive. After installation, the computer detects
FinnZ [79.3K]

Answer:

D. Flash the BIOS

Explanation:

The function of the BIOS is to test all computer hardware that is attached to a machine before loading the operating system. Since the bios contains firmware that enables the configuration of computer hardware. when the 2 TB hard drive is connected the technician should update the program stored on the BIOS chip in other words flash the bios for it to be able to read the new hard drive. Reinstalling the drive will not make a difference as long as the BIOS still detects the 250 GB hard drive.

6 0
3 years ago
Providing incentives for customers to learn more about your service is known as?
Julli [10]
B) Advertising is the answer
3 0
3 years ago
What are the advantages and disadvantages of using wireless communications? What are the advantages and disadvantages of using w
Nimfa-mama [501]

Answer:

<u>Advantages of wireless communication:-</u>

  • Flexibility in transferring the message through communication for which the sender and receiver can be in any place.
  • Speed of the communication is accurate and fast
  • Due to no wiring , the cost of the wireless communication is less.

<u>Disadvantages of wireless communication:-</u>

  • The security is less as the data can be accessed by unauthorized sources at times.
  • The setting up of wireless communication complex and expensive.

<u>Advantages of wired communication:-</u>

  • Simple configuration
  • Higher bandwidth is present in the cable
  • High reliability

<u>Disadvantages of wired communication:-</u>

  • Mobility is present for communication
  • Installation requires lot of time due to cabling
  • Requires extra devices for covering large areas for communication

Wireless communication is more preferable than wired communication in the conditions like communication connection that should face low damage and longer life which is not present in cable connection as they break or get disrupted.The flexibility of moving while communication is required by most people so, they use wireless communication .

8 0
3 years ago
Other questions:
  • Whos ready for sao ordinal scale this march!!!( ಥـْـِـِـِـْಥ)
    7·1 answer
  • Malcolm is part of a team developing a new smartphone app to track traffic patterns. Because team members are located throughout
    12·1 answer
  • So I was wondering how I should get into Game Development?
    12·1 answer
  • Henry went to an IT software company for an interview he was offered a position in lower level management which positions could
    11·1 answer
  • Which one is correct
    8·1 answer
  • In a linked chain implementation of a queue, the performance of the enqueue operation
    14·1 answer
  • A good practice when using public domain content is to
    7·1 answer
  • World pade is world processing software true or false​
    15·1 answer
  • Dynamics
    11·1 answer
  • If you anticipate running a particular query often, you can improve overall performance by saving the query in a special file ca
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!