answer.
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
FromTheMoon
2 months ago
11

(Java)Write a program that calculates and displays the conversion of an entered number of dollars into currency denominations—20

s, 10s, 5s, and 1s. Example output: $452 converted is 22 $20s, 1 $10s, 0 $5s, and 2 $1s.​
Computers and Technology
1 answer:
Harlamova29_29 [1K]2 months ago
8 0

Answer:

Below!

Explanation:

Here’s the code I have. I’m unsure what I’m missing that prevents it from being accepted -

import java.util.Scanner;

class Dollars {

   public static void main(String[] args) {

        int numTwenties,numTens,numFives,numOnes,dollarAmount;  

       Scanner sc= new Scanner(System.in);

       System.out.println("Please enter a dollar amount: ");  

       dollarAmount = sc.nextInt();

        numTwenties = dollarAmount/20;

        numTens = (dollarAmount - 20*numTwenties)/10;

        numFives = (dollarAmount - (10*numTens + 20*numTwenties))/5;

        numOnes = (dollarAmount - (10*numTens + 20*numTwenties + 5*numFives));

       System.out.println(+ dollarAmount + " converted is" + numTwenties + " $20s, " + numTens + " $10s, " + numFives + " $5s, and " + numOnes + " $1s.");  

   }

}

The output I’m getting is -

Test CaseIncomplete

Dollars 598

Input598

OutputPlease enter a dollar amount: 598

598 converted is29 $20s, 1 $10s, 1 $5s, and 3 $1s.

Results

$598 converted is 29 $20s, 1 $10s, 1 $5s, and 3 $1s

Expected Output

$598 converted is 29 $20s, 1 $10s, 1 $5s, and 3 $1s

You might be interested in
In 2007, this wireless security algorithm was rendered useless by capturing packets and discovering the passkey in a matter of s
8_murik_8 [964]

Answer:

The appropriate answer to the question is option A, Wired Equivalent Privacy (WEP).

Explanation:

WEP (Wired Equivalent Privacy) is the security protocol detailed in the IEEE Wi-Fi (Wireless Fidelity) standard 802.11b, which aims to offer a Wireless Local Area Network (WLAN) with adequate security and privacy.

Wardriving refers to the practice in which individuals search for Wi-Fi (Wireless Fidelity) networks while traveling in a vehicle using devices like PDAs (Personal Digital Assistants), smartphones, or portable computers.

7 0
2 months ago
Read 2 more answers
A business wants to centralize its administrative tasks. At the same time, it wants the existing systems to manage and sustain t
Harlamova29_29 [1022]
Time management and documentation.
7 0
1 month ago
Read 2 more answers
Any software or program that comes in many forms and is designed to disrupt the normal operation of a computer by allowing an un
ivann1987 [1066]
Trojan horse. They arrive disguised.
8 0
2 months ago
A ____ partition contains the data necessary to restore a hard drive back to its state at the time the computer was purchased an
zubka84 [1067]
The answer is back up
8 0
1 month ago
Read 2 more answers
A company that allows you to license software monthly to use online is an example of
oksian1 [950]

A business that offers monthly software licensing for online use exemplifies a Subscription model.

Explanation:

Software license agreements authorize individuals or organizations to utilize software applications, with various licensing methods tailored to different financial situations. The main licensing types include Stand-alone, Networked, Site, Cloud, and Subscription.

Subscription:

This approach involves temporarily renting software rather than purchasing it outright. Instead of a one-time full payment, users pay periodically—monthly, quarterly, or yearly.

Subscription licenses are ideal for short-term assignments, temporary employees, or scenarios requiring limited software use.

Currently, subscription licensing is popular because it offers software updates and flexible payment plans. Permanent licenses often have high upfront costs, making subscriptions a more accessible option.

4 0
3 months ago
Read 2 more answers
Other questions:
  • An author is preparing to send their book to a publisher as an email attachment. The file on their computer is 1000 bytes. When
    6·1 answer
  • Until 2015, each new Roblox user automatically had one friend. What was he called?
    12·2 answers
  • This question involves a simulation of a two-player game. In the game, two simulated players each start out with an equal number
    7·1 answer
  • To finish creating a design for the webpage, use one shape to cut away part of the other. Create a 700 pixel by 700 pixel square
    10·1 answer
  • Describe a situation involving making a copy of a computer program or an entertainment file of some sort for which you think it
    7·1 answer
  • The ______ is the information center that drivers need to refer to when they're NOT scanning the road.
    7·1 answer
  • What problem does the DNS solve? How does the DNS help the world wide web scale so that billions of users can access billions of
    11·1 answer
  • Consider two different implementations, M1 and M2, of the same instruction set. There are three classes of instructions (A, B, a
    14·1 answer
  • Kylee needs to ensure that if a particular client sends her an email while she is on vacation, the email is forwarded to a
    10·1 answer
  • _ is a model of computing in which computer processing, storage, software, and other services are provided as a shared pool of v
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!