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 level of system and network is required for cui
galben [10]

Answer:

CUI will be classified at a “moderate” confidentiality level and follow DoDI 8500.01 and 8510.01 in all DOD systems. Non-DoD systems must provide adequate security with requirements incorporated into all legal documents with non-DoD entities following DoDI 8582.01 guideline

Explanation:

6 0
3 years ago
Compare and contrast between Client/Server and Peer-to-Peer networks. What are some of the business benefits of using such netwo
fgiga [73]
Client/Server and Peer-to-Peer networks are the two major network architecture models in use today. They each have advantages and disadvantages that can be used to benefit a particular outcome.

Briefly, the client/server model relates to one or many client performing relatively simple requests, which are then executed by a server. The server is performing more complex tasks, and often interacting with many clients simultaneously. Examples of client/server models include most websites, including the Brainly page you are running right this instant. Your web browser is acting as a client, and the Brainly.com website is running as a web server. It receives simple requests or information from your browser, such as clicking on a question or text typed by your keyboard, and then acts on this information by consulting a database, returning values, or returning a whole new web page to your browser. The client/server model is very powerful in business as it allows powerful and secure server-side processing and relatively simple clients. Office 365 that runs all microsoft office suites such as word and excel in a web browser on 'the cloud' is an example of a highly sophisticated client/server architecture.

By contrast, peer-to-peer networks are a distributed architecture of equals. Instead of a simple client and complex server, all clients are equals and link together to form nodes on a distributed network. There is no central control (server) and each node acts as a client and server to other nodes. This is also an extremely powerful network; as there is no central control it is difficult to shut down a peer-to-peer network. Taking out one node will not break the network in comparison to the client/server architecture where if the server goes down, services halt. Prime examples of famous peer-to-peer networks are the Bitcoin network and similar cryptographic currency networks, and music and file sharing networks such as Torrents. The torrent tracker websites are client/server however once a torrent is loaded into a torrent downloading application, the file is collectively downloaded from hundreds of 'peers' across the world as part of the torrent peer-to-peer network.


3 0
3 years ago
Where could cloud computing fit in the organizational structure and operations?
vampirchik [111]

Answer:

Computing cloud could fit in the website under the IT directory, with total access to all employees and shareholders.

Explanation:

8 0
3 years ago
Which name is assigned to the transport layer pdu?
12345 [234]

Answer:

TCP segment

Explanation:

4 0
2 years ago
Read 2 more answers
Describe the unique qualities that attract you to the specific undergraduate college or school (including preferred admission an
Digiron [165]
<span>I look for small classes to assure personal attention from the professors. I also make sure it has a good program scope for things I am initially interested in. Furthermore, good graduation rates are preferable.</span>
6 0
3 years ago
Other questions:
  • A ___ block unauthorized access to a network or an individual computer
    8·1 answer
  • Which term refers to actions that you would typically perform on a computer to revive it if it functions in an unexpected manner
    15·2 answers
  • In a ___ traversal of a binary tree, you begin at the root and visit nodes one level at a time
    10·1 answer
  • Tom wants a way to automatically create ads and simplify campaign management, using his resources and Google's machine learning
    12·1 answer
  • What are the most common MIS (management information systems) used in a business place.
    5·1 answer
  • The two principal catalysts for the Information Age have been:________.
    15·1 answer
  • Most network behavior analysis system sensors can be deployed in __________ mode only, using the same connection methods as netw
    8·1 answer
  • Why do we use the internet so much?​
    6·1 answer
  • What data type or you use to represent true or false values?
    13·1 answer
  • A program is required to three (3) numbers. calculate and print their total
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!